From 62868dabe1010a7b73a37fc7020ab19ced7571a7 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Fri, 28 May 2021 12:04:18 -0700 Subject: Parallel updates and fixes for VFD SWMR (#705) * Brings CMake updates from develop * Brings reduction in pedantic casts from develop * Purges UFAIL from the library (#637) * Committing clang-format changes * Purges UFAIL from the library * H5HL_insert change requested in PR Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Removes gratuitous (double)x.yF casts (#632) * Committing clang-format changes * Removes gratuitous (double)x.yF casts * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Committing clang-format changes * Cleans up a const warning left over from previous constification (#633) * Committing clang-format changes * Adds consts to a few global variables * Cleans up a const warning left over from previous constification Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Formatted source * Bring over some VOL registration changes * VOL cleanup * H5VL_request_status_t substitutions * H5F.c cleanup * Minor API tweaks from develop * Moves H5G package init/teardown to H5Gint.c * H5G cleanup * H5M cleanup * H5SM cleanup * H5T cleanup * H5R cleanup * H5Lpublic.h cleanup * H5L cleanup * H5O cleanup * H5A, H5CS, and H5AC cleanup * Moved H5A init/teardown code to H5Aint.c * Moves H5D I/O functions to H5D.c * H5D cleanup * Misc minor cleanup * H5P close cleanup * H5Tpublic.h cleanup * Fixes err_compat test * H5PLpublic.h cleanup * Updates H5Ppublic.h * H5Fpublic.h updates * H5A.c cleanup * Brings over H5Aexists and related changes * Brings CMake shell testing changes from develop * Close callback changes * H5R and H5Tcommit normalization * err_compat test works now * H5O tweaks * Updates VOL registration code * Brings over H5VL_create_object * H5Tconv.c reformatting * H5T.c tweaks * Brings datatype and reference updates from develop * Brings VOL plugin loading changes from develop * Brings event sets from develop * Brings async functions over * Tools changes * Brings over many tools changes from develop * Brings VOL flags from develop * Fixes h5dump double/float tests * Updates h5repack tests * Brings h5diff test changes from develop * Last h5dump changes * Brings test changes from develop * Committing clang-format changes * Tidied h5_testing() * Brings chunk iteration code + misc from develop * Updates vds test * Enables external link parallel test * Brings updated property lists from develop * H5G changes from develop * H5MF cleanup * Brings vfd_swmr test back into CMake * Updates threadsafe test * Updates plist test * Brings recent changes from develop * Require a C++11 compiler to build the C++ wrappers (#693) * Committing clang-format changes * Requires a C++11 compiler to build the C++ wrappers Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix H5FD_mpio_Debug="rw" can report MPI_count instead of bytes (#699) * Removes pre-C99 build and header cruft (#700) * Assumes ANSI C headers exist * Assumes stdbool.h, stdint.h, and inttypes.h are present * Assumes the C++ compiler can handle stdint.h * Removes all work-arounds for missing functionality, especially stdbool.h Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Updates release documents * Brings parallel changes from develop * Adds a VFD/parallel check program for the VFD SWMR shell test * Updates MANIFEST * Disable building VFD SWMR acceptance tests on CMake * Removes err.h from genall5.c Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- MANIFEST | 2 + src/H5ACmpio.c | 4 +- src/H5Cimage.c | 57 ++++++++++++++------------- src/H5Cmpio.c | 92 +++++++++++++++++++++++++++++--------------- src/H5Cpublic.h | 23 ++++++++++- src/H5Fint.c | 18 ++++++++- test/CMakeLists.txt | 44 ++++++++++----------- test/Makefile.am | 1 + test/genall5.c | 5 +-- test/testvfdswmr.sh.in | 10 +++-- test/vfd_swmr_check_compat.c | 62 +++++++++++++++++++++++++++++ 11 files changed, 226 insertions(+), 92 deletions(-) create mode 100644 test/vfd_swmr_check_compat.c diff --git a/MANIFEST b/MANIFEST index b028661..9984fb4 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1402,8 +1402,10 @@ ./test/vfd_swmr_addrem_writer.c ./test/vfd_swmr_attrdset_writer.c ./test/vfd_swmr_bigset_writer.c +./test/vfd_swmr_check_compat.c ./test/vfd_swmr_common.c ./test/vfd_swmr_common.h +./test/vfd_swmr_dsetops_writer.c ./test/vfd_swmr_generator.c ./test/vfd_swmr_group_writer.c ./test/vfd_swmr_reader.c diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index afc15d1..7d2ba25 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -772,7 +772,7 @@ H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr) else { aux_ptr->dirty_bytes += entry_ptr->size; #if H5AC_DEBUG_DIRTY_BYTES_CREATION - aux_ptr->unprotect_dirty_bytes += entry_size; + aux_ptr->unprotect_dirty_bytes += entry_ptr->size; aux_ptr->unprotect_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ } /* end else */ @@ -970,7 +970,7 @@ H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr) aux_ptr->dirty_bytes += entry_ptr->size; #if H5AC_DEBUG_DIRTY_BYTES_CREATION - aux_ptr->insert_dirty_bytes += size; + aux_ptr->insert_dirty_bytes += entry_ptr->size; aux_ptr->insert_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ diff --git a/src/H5Cimage.c b/src/H5Cimage.c index d56aafc..5776c31 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -423,33 +423,33 @@ done: * Function: H5C__deserialize_prefetched_entry() * * Purpose: Deserialize the supplied prefetched entry entry, and return - * a pointer to the deserialized entry in *entry_ptr_ptr. - * If successful, remove the prefetched entry from the cache, - * and free it. Insert the deserialized entry into the cache. - * - * Note that the on disk image of the entry is not freed -- - * a pointer to it is stored in the deserialized entries' - * image_ptr field, and its image_up_to_date field is set to - * TRUE unless the entry is dirtied by the deserialize call. - * - * If the prefetched entry is a flush dependency child, - * destroy that flush dependency prior to calling the - * deserialize callback. If appropriate, the flush dependency - * relationship will be recreated by the cache client. - * - * If the prefetched entry is a flush dependency parent, - * destroy the flush dependency relationship with all its - * children. As all these children must be prefetched entries, - * recreate these flush dependency relationships with - * deserialized entry after it is inserted in the cache. - * - * Since deserializing a prefetched entry is semantically - * equivalent to a load, issue an entry loaded nofification - * if the notify callback is defined. + * a pointer to the deserialized entry in *entry_ptr_ptr. + * If successful, remove the prefetched entry from the cache, + * and free it. Insert the deserialized entry into the cache. + * + * Note that the on disk image of the entry is not freed -- + * a pointer to it is stored in the deserialized entries' + * image_ptr field, and its image_up_to_date field is set to + * TRUE unless the entry is dirtied by the deserialize call. + * + * If the prefetched entry is a flush dependency child, + * destroy that flush dependency prior to calling the + * deserialize callback. If appropriate, the flush dependency + * relationship will be recreated by the cache client. + * + * If the prefetched entry is a flush dependency parent, + * destroy the flush dependency relationship with all its + * children. As all these children must be prefetched entries, + * recreate these flush dependency relationships with + * deserialized entry after it is inserted in the cache. + * + * Since deserializing a prefetched entry is semantically + * equivalent to a load, issue an entry loaded nofification + * if the notify callback is defined. * * Return: SUCCEED on success, and FAIL on failure. * - * Note that *entry_ptr_ptr is undefined on failure. + * Note that *entry_ptr_ptr is undefined on failure. * * Programmer: John Mainzer, 8/10/15 * @@ -685,15 +685,17 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t * * 1) Set pf_entry_ptr->image_ptr to NULL. Since we have already * transferred the buffer containing the image to *ds_entry_ptr, - * this is not a memory leak. + * this is not a memory leak. * * 2) Call H5C__flush_single_entry() with the H5C__FLUSH_INVALIDATE_FLAG * and H5C__FLUSH_CLEAR_ONLY_FLAG flags set. */ pf_entry_ptr->image_ptr = NULL; + if (pf_entry_ptr->is_dirty) { HDassert(pf_entry_ptr->in_slist); flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; + } /* end if */ if (H5C__flush_single_entry(f, pf_entry_ptr, flush_flags) < 0) @@ -1211,7 +1213,8 @@ H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); /* Set information needed to load cache image */ - cache_ptr->image_addr = addr, cache_ptr->image_len = len; + cache_ptr->image_addr = addr; + cache_ptr->image_len = len; cache_ptr->load_image = TRUE; cache_ptr->delete_image = rw; @@ -1825,7 +1828,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, const uint8_t * p = *buf; /* Check signature */ - if (HDmemcmp(p, H5C__MDCI_BLOCK_SIGNATURE, (size_t)H5C__MDCI_BLOCK_SIGNATURE_LEN)) + if (HDmemcmp(p, H5C__MDCI_BLOCK_SIGNATURE, (size_t)H5C__MDCI_BLOCK_SIGNATURE_LEN) != 0) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad metadata cache image header signature") p += H5C__MDCI_BLOCK_SIGNATURE_LEN; diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 12dde12..6543ae5 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -160,9 +160,6 @@ 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) { - int i; - int m; - unsigned n; unsigned first_entry_to_flush; unsigned last_entry_to_flush; unsigned total_entries_to_clear = 0; @@ -177,7 +174,8 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG char tbl_buf[1024]; -#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ +#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ + unsigned m, n; unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -219,9 +217,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha } /* end if */ n = num_candidates / (unsigned)mpi_size; - if (num_candidates % (unsigned)mpi_size > INT_MAX) - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "m overflow") - m = (int)(num_candidates % (unsigned)mpi_size); + m = num_candidates % (unsigned)mpi_size; if (NULL == (candidate_assignment_table = (unsigned *)H5MM_malloc(sizeof(unsigned) * (size_t)(mpi_size + 1)))) @@ -232,31 +228,31 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha candidate_assignment_table[mpi_size] = num_candidates; if (m == 0) { /* mpi_size is an even divisor of num_candidates */ - for (i = 1; i < mpi_size; i++) - candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n; + for (u = 1; u < (unsigned)mpi_size; u++) + candidate_assignment_table[u] = candidate_assignment_table[u - 1] + n; } /* end if */ else { - for (i = 1; i <= m; i++) - candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n + 1; + for (u = 1; u <= m; u++) + candidate_assignment_table[u] = candidate_assignment_table[u - 1] + n + 1; if (num_candidates < (unsigned)mpi_size) { - for (i = m + 1; i < mpi_size; i++) - candidate_assignment_table[i] = num_candidates; + for (u = m + 1; u < (unsigned)mpi_size; u++) + candidate_assignment_table[u] = num_candidates; } /* end if */ else { - for (i = m + 1; i < mpi_size; i++) - candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n; + for (u = m + 1; u < (unsigned)mpi_size; u++) + candidate_assignment_table[u] = candidate_assignment_table[u - 1] + n; } /* end else */ } /* end else */ 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++) { + for (u = 1; u < (unsigned)(mpi_size - 1); u++) { unsigned a, b; - a = candidate_assignment_table[i] - candidate_assignment_table[i - 1]; - b = candidate_assignment_table[i + 1] - candidate_assignment_table[i]; + a = candidate_assignment_table[u] - candidate_assignment_table[u - 1]; + b = candidate_assignment_table[u + 1] - candidate_assignment_table[u]; HDassert(n + 1 >= a); HDassert(a >= b); @@ -268,11 +264,11 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha last_entry_to_flush = candidate_assignment_table[mpi_rank + 1] - 1; #if H5C_APPLY_CANDIDATE_LIST__DEBUG - for (i = 0; i < 1024; i++) - tbl_buf[i] = '\0'; + for (u = 0; u < 1024; u++) + tbl_buf[u] = '\0'; HDsprintf(&(tbl_buf[0]), "candidate assignment table = "); - for (i = 0; i <= mpi_size; i++) - HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %u", candidate_assignment_table[i]); + for (u = 0; u <= (unsigned)mpi_size; u++) + HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %u", candidate_assignment_table[u]); HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); HDfprintf(stdout, "%s", tbl_buf); @@ -347,9 +343,9 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha #if H5C_DO_SANITY_CHECKS m = 0; n = 0; - for (i = 0; i < H5C_RING_NTYPES; i++) { - m += (int)entries_to_flush[i]; - n += entries_to_clear[i]; + for (u = 0; u < H5C_RING_NTYPES; u++) { + m += entries_to_flush[u]; + n += entries_to_clear[u]; } /* end if */ HDassert((unsigned)m == total_entries_to_flush); @@ -439,6 +435,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) HDassert(cache_ptr->slist_len <= (cache_ptr->dLRU_list_len + cache_ptr->pel_len)); if (space_needed > 0) { /* we have work to do */ + H5C_cache_entry_t *entry_ptr; unsigned nominated_entries_count = 0; size_t nominated_entries_size = 0; @@ -450,8 +447,10 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) * entries to free up the necessary space. */ entry_ptr = cache_ptr->dLRU_tail_ptr; + while ((nominated_entries_size < space_needed) && (nominated_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); @@ -459,22 +458,29 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) HDassert(entry_ptr->in_slist); 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") nominated_entries_size += entry_ptr->size; nominated_entries_count++; entry_ptr = entry_ptr->aux_prev; + } /* end while */ + HDassert(entry_ptr == NULL); /* it is possible that there are some dirty entries on the * protected entry list as well -- scan it too if necessary */ entry_ptr = cache_ptr->pel_head_ptr; + while ((nominated_entries_size < space_needed) && (nominated_entries_count < cache_ptr->slist_len) && (entry_ptr != NULL)) { + if (entry_ptr->is_dirty) { + HDassert(!(entry_ptr->is_protected)); HDassert(!(entry_ptr->is_read_only)); HDassert(entry_ptr->ro_ref_count == 0); @@ -482,22 +488,29 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) HDassert(entry_ptr->in_slist); 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") nominated_entries_size += entry_ptr->size; nominated_entries_count++; + } /* end if */ entry_ptr = entry_ptr->next; + } /* end while */ HDassert(nominated_entries_count == cache_ptr->slist_len); HDassert(nominated_entries_size == space_needed); + } /* end if */ done: + FUNC_LEAVE_NOAPI(ret_value) + } /* H5C_construct_candidate_list__clean_cache() */ /*------------------------------------------------------------------------- @@ -533,21 +546,32 @@ H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr) * cache back within its min clean constraints. */ 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) + cache_ptr->min_clean_size) { + space_needed = 0; - else + } + else { + space_needed = cache_ptr->min_clean_size - ((cache_ptr->max_cache_size - cache_ptr->index_size) + cache_ptr->cLRU_list_size); + } } /* end if */ else { - if (cache_ptr->min_clean_size <= cache_ptr->cLRU_list_size) + + if (cache_ptr->min_clean_size <= cache_ptr->cLRU_list_size) { + space_needed = 0; - else + } + else { + space_needed = cache_ptr->min_clean_size - cache_ptr->cLRU_list_size; + } } /* end else */ if (space_needed > 0) { /* we have work to do */ + H5C_cache_entry_t *entry_ptr; unsigned nominated_entries_count = 0; size_t nominated_entries_size = 0; @@ -558,8 +582,10 @@ H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr) * entries to free up the necessary space. */ entry_ptr = cache_ptr->dLRU_tail_ptr; + while ((nominated_entries_size < space_needed) && (nominated_entries_count < cache_ptr->slist_len) && (entry_ptr != NULL) && (!entry_ptr->flush_me_last)) { + haddr_t nominated_addr; HDassert(!(entry_ptr->is_protected)); @@ -569,12 +595,15 @@ H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr) HDassert(entry_ptr->in_slist); 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") nominated_entries_size += entry_ptr->size; nominated_entries_count++; entry_ptr = entry_ptr->aux_prev; + } /* end while */ HDassert(nominated_entries_count <= cache_ptr->slist_len); HDassert(nominated_entries_size >= space_needed); @@ -679,13 +708,14 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr 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); + HDfprintf(stdout, "H5C_mark_entries_as_clean: entry[%u] = %" PRIuHADDR " not in cache.\n", u, + 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) { #if H5C_DO_SANITY_CHECKS - HDfprintf(stdout, "H5C_mark_entries_as_clean: entry %a is not dirty!?!\n", addr); + HDfprintf(stdout, "H5C_mark_entries_as_clean: entry %" PRIuHADDR " is not dirty!?!\n", addr); #endif /* H5C_DO_SANITY_CHECKS */ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?") } /* end else-if */ diff --git a/src/H5Cpublic.h b/src/H5Cpublic.h index 0e6fb84..79ece10 100644 --- a/src/H5Cpublic.h +++ b/src/H5Cpublic.h @@ -31,15 +31,34 @@ extern "C" { #endif -enum H5C_cache_incr_mode { H5C_incr__off, H5C_incr__threshold }; +enum H5C_cache_incr_mode { + H5C_incr__off, + /**shared->pb_ptr->min_meta_perc)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set minimum metadata fraction of page buffer") if (H5P_set(new_plist, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, &(f->shared->pb_ptr->min_raw_perc)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, @@ -434,6 +434,22 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read flag") if (H5P_set(new_plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &(f->shared->coll_md_write)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read flag") + if (H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { + MPI_Comm mpi_comm; + MPI_Info mpi_info; + + /* Retrieve and set MPI communicator */ + if (MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(f))) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't get MPI communicator") + if (H5P_set(new_plist, H5F_ACS_MPI_PARAMS_COMM_NAME, &mpi_comm) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set MPI communicator") + + /* Retrieve and set MPI info object */ + if (H5P_get(old_plist, H5F_ACS_MPI_PARAMS_INFO_NAME, &mpi_info) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't get MPI info object") + if (H5P_set(new_plist, H5F_ACS_MPI_PARAMS_INFO_NAME, &mpi_info) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set MPI info object") + } #endif /* H5_HAVE_PARALLEL */ if (H5P_set(new_plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) < 0) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 22f63f7..61f11a9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -260,15 +260,15 @@ set(mirror_vfd_SOURCES ${HDF5_TEST_SOURCE_DIR}/genall5.c ) -set(vfd_swmr_zoo_reader_SOURCES - ${HDF5_TEST_SOURCE_DIR}/vfd_swmr_zoo_reader.c - ${HDF5_TEST_SOURCE_DIR}/genall5.c -) +#set(vfd_swmr_zoo_reader_SOURCES +# ${HDF5_TEST_SOURCE_DIR}/vfd_swmr_zoo_reader.c +# ${HDF5_TEST_SOURCE_DIR}/genall5.c +#) -set(vfd_swmr_zoo_writer_SOURCES - ${HDF5_TEST_SOURCE_DIR}/vfd_swmr_zoo_writer.c - ${HDF5_TEST_SOURCE_DIR}/genall5.c -) +#set(vfd_swmr_zoo_writer_SOURCES +# ${HDF5_TEST_SOURCE_DIR}/vfd_swmr_zoo_writer.c +# ${HDF5_TEST_SOURCE_DIR}/genall5.c +#) set (ttsafe_SOURCES ${HDF5_TEST_SOURCE_DIR}/ttsafe.h @@ -641,20 +641,20 @@ foreach (h5_test ${H5_VDS_SWMR_TESTS}) ADD_H5_VDS_EXE(${h5_test}) endforeach () -set (H5_VFD_SWMR_TESTS - vfd_swmr_addrem_writer - vfd_swmr_bigset_writer - vfd_swmr_generator - vfd_swmr_group_writer - vfd_swmr_reader - vfd_swmr_remove_reader - vfd_swmr_remove_writer - vfd_swmr_sparse_reader - vfd_swmr_sparse_writer - vfd_swmr_vlstr_reader - vfd_swmr_vlstr_writer - vfd_swmr_writer -) +#set (H5_VFD_SWMR_TESTS +# vfd_swmr_addrem_writer +# vfd_swmr_bigset_writer +# vfd_swmr_generator +# vfd_swmr_group_writer +# vfd_swmr_reader +# vfd_swmr_remove_reader +# vfd_swmr_remove_writer +# vfd_swmr_sparse_reader +# vfd_swmr_sparse_writer +# vfd_swmr_vlstr_reader +# vfd_swmr_vlstr_writer +# vfd_swmr_writer +#) foreach (h5_test ${H5_VFD_SWMR_TESTS}) ADD_H5_EXE(${h5_test}) diff --git a/test/Makefile.am b/test/Makefile.am index 82fee2a..2d76946 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -111,6 +111,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ vfd_swmr_vlstr_reader vfd_swmr_vlstr_writer \ vfd_swmr_zoo_reader vfd_swmr_zoo_writer \ vfd_swmr_attrdset_reader vfd_swmr_attrdset_writer \ + vfd_swmr_check_compat \ swmr_check_compat_vfd vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer \ mirror_vfd if HAVE_SHARED_CONDITIONAL diff --git a/test/genall5.c b/test/genall5.c index 2c9586b..f1189fb 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -19,7 +19,6 @@ * of the same name. */ -#include #include "cache_common.h" #include "vfd_swmr_common.h" /* for below_speed_limit() */ #include "genall5.h" @@ -2756,12 +2755,12 @@ out: if (!ok) { /* Currently not used: this step makes sure the operation doesn't take too long. * Any test that sets config.msgival or lastmsgtime to 0 will skip this step */ - if (strcmp(failure_mssg, last_failure_mssg) != 0 && + if (HDstrcmp(failure_mssg, last_failure_mssg) != 0 && ((config.msgival.tv_sec || config.msgival.tv_nsec)) && (lastmsgtime->tv_sec || lastmsgtime->tv_nsec)) { if (below_speed_limit(lastmsgtime, &config.msgival)) { last_failure_mssg = failure_mssg; - warnx("%s: %s", __func__, failure_mssg); + HDfprintf(stderr, "%s: %s", __func__, failure_mssg); } } } diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in index 819d51a..ea2fd7b 100644 --- a/test/testvfdswmr.sh.in +++ b/test/testvfdswmr.sh.in @@ -150,13 +150,15 @@ if test -z "$srcdir"; then fi # Check to see if the VFD specified by the HDF5_DRIVER environment variable -# supports SWMR. ??? DO I NEED TO MODIFY THIS ???? -./swmr_check_compat_vfd +# supports SWMR and/or if we are using parallel HDF5, which does not +# currently support SWMR. +./vfd_swmr_check_compat rc=$? if [ $rc -ne 0 ] ; then echo - echo "The VFD specified by the HDF5_DRIVER environment variable" - echo "does not support VFD SWMR." + echo "Either the VFD specified by the HDF5_DRIVER environment variable" + echo "does not support VFD SWMR or parallel HDF5 was configured, which" + echo "currently does not support SWMR." echo echo "VFD SWMR acceptance tests skipped" echo diff --git a/test/vfd_swmr_check_compat.c b/test/vfd_swmr_check_compat.c new file mode 100644 index 0000000..dec88c5 --- /dev/null +++ b/test/vfd_swmr_check_compat.c @@ -0,0 +1,62 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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://www.hdfgroup.org/licenses. * + * 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 + * environment variable is set to a value that supports VFD SWMR. + * + * Also checks to see if this is a parallel build, as VFD SWMR + * and parallel HDF5 are fundamentally incompatible due to the + * page buffer changes. + * + * 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_TESTING +#include "H5FDpkg.h" /* File drivers */ + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Inspects the HDF5_DRIVER environment variable, which + * determines the VFD that the test harness will use with + * the majority of the tests. + * + * Return: VFD supports SWMR: EXIT_SUCCESS + * + * VFD does not support SWMR + * or failure: EXIT_FAILURE + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ +#ifdef H5_HAVE_PARALLEL + return EXIT_FAILURE; +#else + char *driver = NULL; + + driver = HDgetenv("HDF5_DRIVER"); + + /* Currently using SWMR support as a proxy for VFD SWMR support */ + if (H5FD__supports_swmr_test(driver)) + return EXIT_SUCCESS; + else + return EXIT_FAILURE; +#endif + +} /* end main() */ -- cgit v0.12