Skip to content

Commit

Permalink
VFD SWMR: sync with develop (#830)
Browse files Browse the repository at this point in the history
* Normalization with develop

* Removes checks and work-arounds for strtoll and strtoull (#769)

* Removes checks for (v)snprintf, which are C99 (#772)

* Update missing release note info. (#776)

* Replaces the H5_OVERRIDE macro with override (#773)

The macro is no longer necessary now that we require C++11.

* Cleans up some POSIX header bits in H5private.h (#783)

* Removes outdated checks for ways inline might be defined (#781)

These are obsolete now that we require C99.

* Removes checks for system(), which is C89/90 (#782)

* Removes C++ dependency on H5private.h (#774)

* Removes C++ dependency on H5private.h

Most C API calls have been removed, aside from a few uses of free,
where we just dropped the 'HD'. A couple of H5_ATTR_UNUSED macros
were also replaced with (void) statements.

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Further simplifies Autotools type size checks (#789)

Also fixes an issue where clock_gettime and difftime are not detected
due to earlier simplifications of this code.

* Release Note (#784)

* Normalization of CMake H5pubconf.h with Autotools (#791)

Mostly just moving things around and changing the comments to keep the
delta small. The only symbol change is that for curl/curl.h which I
changed to H5_HAVE_CURL_CURL_H to match the Autotools. This symbol
is not used in the library and is just an artifact of the checks.

* Fix tools test (#794)

* Removes ancient Autotools cruft (#790)

* Reorganization of C and POSIX headers in H5public.h & H5private.h (#793)

* Reorganization of C and POSIX headers in H5public.h & H5private.h

Consolidated and removed duplicates

* It turns out Windows has sys/types.h

Co-authored-by: Larry Knox <lrknox@hdfgroup.org>

* Removes checks for signal and set/longjmp, which are C89 (#798)

Also removes checks for setjmp.h and stddef.h

* Assume frexpl/f and fabsl/f, which are C99 (#799)

* Assume the library has C99 types in C++ type code (#806)

* Assume the library has C99 types in C++ type code

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Removes obsolete equivalents of C99's __func__ (#800)

* Cleans up POSIX/C bits in H5private.h (#804)

* Cleans up POSIX/C bits in H5private.h

* Assume difftime exists (C89)
* Reorg AC_CHECK_HEADERS so headers are in alphabetical order
* Split off networking-related AC_CHECK_HEADERS
* Remove unused UNAME_CYGWIN from configure.ac
* Remove checks for unused sys/timeb.h
* Tidying pass over H5private.h HD prefix macros
* Tidy H5win32defs.h
* Add HD prefix to various scanf calls

* Committing clang-format changes

* Fixes to the alarm(2) code used in the tests to make Windows happy

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Brings the tools getopt(3) replacement into the main library (#803)

* Moves get_option from the tools library to the C library

* Adds H5 prefix to get_option call and variables

* Renames the H5_get_option long options struct and enum

* Removes type guesses when C99 types are missing (#807)

* Assume C99 types exist in H5detect.c (#808)

* Fixes parallel issues from recent C99 changes

* Adds MPE FUNC --> __func__ changes missed in earlier PRs

* Fix typo

* Fixes parallel issues from recent C99 changes (#809)

* Fixes parallel issues from recent C99 changes

* Adds MPE FUNC --> __func__ changes missed in earlier PRs

* Even more missed FUNC --> __func__ macros

* Removes remaining H5_TIME_WITH_SYS_TIME cruft (#810)

Mostly from CMake

* Merges with develop

* Committing clang-format changes

* Normalization with develop

* direct_chunk test and H5Dget_chunk_storage_size changes
* Removes unused H5O call

* Brings some dataspace changes from the combo branch merge

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
  • Loading branch information
3 people authored Jul 12, 2021
1 parent b9dbabc commit eebaee6
Show file tree
Hide file tree
Showing 38 changed files with 698 additions and 324 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# .gitignore file for HDF5

# ctags
**/tags

# vim swap files
**/.*.swp

# Makefile.in files
**/Makefile.in

Expand Down
3 changes: 0 additions & 3 deletions config/cmake/H5pubconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,6 @@
/* Define if your system has window style path name. */
#cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@

/* Define to 1 if you have the <winsock2.h> header file. */
#cmakedefine H5_HAVE_WINSOCK2_H @H5_HAVE_WINSOCK2_H@

/* Define to 1 if you have the <zlib.h> header file. */
#cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@

Expand Down
6 changes: 0 additions & 6 deletions config/cmake_ext_mod/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ if (MINGW)
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")
set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
set (__USE_MINGW_ANSI_STDIO 1)
endif ()

Expand Down Expand Up @@ -117,11 +116,6 @@ CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H)
CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H)
CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H)

# Windows
if (NOT CYGWIN)
CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H)
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)
CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H)
Expand Down
67 changes: 33 additions & 34 deletions src/H5Dchunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,6 @@ H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage
HDassert(offset);
HDassert(storage_size);

*storage_size = 0;

/* Allocate dataspace and initialize it if it hasn't been. */
if (!(*layout->ops->is_space_alloc)(&layout->storage))
HGOTO_DONE(SUCCEED)
Expand Down Expand Up @@ -5031,7 +5029,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
* order of offset in the file.
*/
if (need_addr_sort)
HDqsort(chunk_disp_array, blocks, sizeof(MPI_Aint), H5D__chunk_cmp_addr);
HDqsort(chunk_disp_array, (size_t)blocks, sizeof(MPI_Aint), H5D__chunk_cmp_addr);

/* MSC - should use this if MPI_type_create_hindexed block is working:
* mpi_code = MPI_Type_create_hindexed_block(blocks, block_len, chunk_disp_array, MPI_BYTE,
Expand Down Expand Up @@ -6066,6 +6064,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)

if (udata->chunk_in_cache) {
HDassert(H5F_addr_defined(chunk_rec->chunk_addr));
HDassert(ent);
HDassert(H5F_addr_defined(ent->chunk_block.offset));

H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t);
Expand Down Expand Up @@ -7498,6 +7497,36 @@ H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *offset, unsigned
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5D__get_chunk_info_by_coord() */

/*-------------------------------------------------------------------------
* Function: H5D__chunk_iter_cb
*
* Purpose: Call the user-defined function with the chunk data. The iterator continues if
* the user-defined function returns H5_ITER_CONT, and stops if H5_ITER_STOP is
* returned.
*
* Return: Success: H5_ITER_CONT or H5_ITER_STOP
* Failure: Negative (H5_ITER_ERROR)
*
* Programmer: Gaute Hope
* August 2020
*
*-------------------------------------------------------------------------
*/
static int
H5D__chunk_iter_cb(const H5D_chunk_rec_t *chunk_rec, void *udata)
{
int ret_value = 0;

FUNC_ENTER_STATIC_NOERR

const H5D_chunk_iter_cb_data_t *data = (H5D_chunk_iter_cb_data_t *)udata;

ret_value = (data->cb)(chunk_rec->scaled, chunk_rec->filter_mask, chunk_rec->chunk_addr,
chunk_rec->nbytes, data->op_data);

FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_iter_cb */

/*-------------------------------------------------------------------------
* Function: H5D__chunk_iter
*
Expand Down Expand Up @@ -7537,7 +7566,7 @@ H5D__chunk_iter(const H5D_t *dset, H5D_chunk_iter_op_t cb, void *op_data)
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, ent, FALSE) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer")
HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "cannot flush indexed storage buffer")

/* Compose chunked index info struct */
idx_info.f = dset->oloc.file;
Expand All @@ -7559,33 +7588,3 @@ H5D__chunk_iter(const H5D_t *dset, H5D_chunk_iter_op_t cb, void *op_data)
done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5D__chunk_iter() */

/*-------------------------------------------------------------------------
* Function: H5D__chunk_iter_cb
*
* Purpose: Call the user-defined function with the chunk data. The iterator continues if
* the user-defined function returns H5_ITER_CONT, and stops if H5_ITER_STOP is
* returned.
*
* Return: Success: H5_ITER_CONT or H5_ITER_STOP
* Failure: Negative (H5_ITER_ERROR)
*
* Programmer: Gaute Hope
* August 2020
*
*-------------------------------------------------------------------------
*/
static int
H5D__chunk_iter_cb(const H5D_chunk_rec_t *chunk_rec, void *udata)
{
int ret_value = 0;

FUNC_ENTER_STATIC_NOERR

const H5D_chunk_iter_cb_data_t *data = (H5D_chunk_iter_cb_data_t *)udata;

ret_value = (data->cb)(chunk_rec->scaled, chunk_rec->filter_mask, chunk_rec->chunk_addr,
chunk_rec->nbytes, data->op_data);

FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_iter_cb */
11 changes: 6 additions & 5 deletions src/H5Dprivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@
#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_XFORM_NAME "data_transform" /* Data transform */
"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_XFORM_NAME "data_transform" /* Data transform */
#define H5D_XFER_DSET_IO_SEL_NAME "dset_io_selection" /* Dataset I/O selection */
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
/* Collective chunk instrumentation properties */
#define H5D_XFER_COLL_CHUNK_LINK_HARD_NAME "coll_chunk_link_hard"
Expand Down
45 changes: 0 additions & 45 deletions src/H5Oattribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,48 +1901,3 @@ H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info)

FUNC_LEAVE_NOAPI(ret_value)
} /* H5O__attr_bh_info() */

#ifndef H5_NO_DEPRECATED_SYMBOLS

/*-------------------------------------------------------------------------
* Function: H5O__attr_count
*
* Purpose: Determine the # of attributes on an object
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Monday, December 11, 2006
*
*-------------------------------------------------------------------------
*/
int
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_PACKAGE

/* Check arguments */
HDassert(loc);

/* Protect the object header to iterate over */
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, 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, 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 */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
Loading

0 comments on commit eebaee6

Please sign in to comment.