Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce code differences between HDF5 1.8 and 1.10 #38

Merged
merged 15 commits into from
Nov 12, 2020
Next Next commit
Merge from 1.10
Comments, whitespace
Simple init and if block brackets.
Minimal code changes limited to return value and spelling
byrnHDF committed Oct 15, 2020
commit 48d171b04730aff7beade684e9afd164f0204b0c
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -11,11 +11,11 @@
CMakeLists.txt @byrnHDF @derobins
CMakeTests.* @byrnHDF @derobins

/bin/ @lrknox @derobins @qkoziol
/bin/ @lrknox @derobins

/c++/ @bmribler @byrnHDF

/config/ @lrknox @derobins @qkoziol @byrnHDF
/config/ @lrknox @derobins @byrnHDF

/doc/ @gnuoyd @jrmainzer

@@ -29,11 +29,11 @@ CMakeTests.* @byrnHDF @derobins

/release_docs/ @lrknox @bljhdf @byrnHDF

/src/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup @jrmainzer
/src/ @jhendersonHDF @derobins @fortnern @soumagne @vchoi-hdfgroup @jrmainzer

/test/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup @jrmainzer
/test/ @jhendersonHDF @derobins @fortnern @soumagne @vchoi-hdfgroup @jrmainzer

/testpar/ @jhendersonHDF @rawarren @jrmainzer @qkoziol
/testpar/ @jhendersonHDF @rawarren @jrmainzer

/tools/ @byrnHDF @bmribler

11 changes: 4 additions & 7 deletions src/H5.c
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ hbool_t H5_MPEinit_g = FALSE; /* MPE Library hasn't been initialized */

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 */

/*******************/
/* Local Variables */
@@ -223,11 +223,6 @@ H5_init_library(void)
*
* Return: void
*
* Programmer: Robb Matzke
* Friday, November 20, 1998
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
void
@@ -264,6 +259,7 @@ H5_term_library(void)

do {
pending = 0;

/* Try to organize these so the "higher" level components get shut
* down before "lower" level components that they might rely on. -QAK
*/
@@ -739,7 +735,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
HDsnprintf(lib_str, sizeof(lib_str), "HDF5 library version: %d.%d.%d", H5_VERS_MAJOR, H5_VERS_MINOR,
H5_VERS_RELEASE);
if (*substr) {
HDstrncat(lib_str, "-", 1);
HDstrncat(lib_str, "-", (size_t)1);
HDstrncat(lib_str, substr, (sizeof(lib_str) - HDstrlen(lib_str)) - 1);
} /* end if */
if (HDstrcmp(lib_str, H5_lib_vers_info_g)) {
@@ -782,6 +778,7 @@ H5open(void)
FUNC_ENTER_API_NOCLEAR(FAIL)
H5TRACE0("e", "");
/* all work is done by FUNC_ENTER() */

done:
FUNC_LEAVE_API(ret_value)
} /* end H5open() */
93 changes: 40 additions & 53 deletions src/H5AC.c
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
*
* Created: H5AC.c
* Jul 9 1997
* Robb Matzke <[email protected]>
* Robb Matzke
*
* Purpose: Functions in this file implement a cache for
* things which exist on disk. All "things" associated
@@ -175,7 +175,7 @@ static herr_t H5AC_run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op);
*
* Failure: negative
*
* Programmer: Quincey Koziol
* Programmer: Quincey Koziol
* Saturday, January 18, 2003
*
*-------------------------------------------------------------------------
@@ -195,11 +195,11 @@ H5AC_init(void)
/*-------------------------------------------------------------------------
* Function: H5AC_init_interface
*
* Purpose: Initialize interface-specific information
* Purpose: Initialize interface-specific information
*
* Return: Non-negative on success/Negative on failure
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Programmer: Quincey Koziol
* Thursday, July 18, 2002
*
*-------------------------------------------------------------------------
@@ -272,7 +272,7 @@ H5AC_init_interface(void)
*
* Failure: Negative.
*
* Programmer: Quincey Koziol
* Programmer: Quincey Koziol
* Thursday, July 18, 2002
*
*-------------------------------------------------------------------------
@@ -350,7 +350,6 @@ static const char *H5AC_entry_type_names[H5AC_NTYPES] = {
* Failure: Negative
*
* Programmer: Robb Matzke
* [email protected]
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -366,6 +365,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr)

FUNC_ENTER_NOAPI(FAIL)

/* Check arguments */
HDassert(f);
HDassert(NULL == f->shared->cache);
HDassert(config_ptr != NULL);
@@ -488,13 +488,10 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr)
if (aux_ptr != NULL) {
if (aux_ptr->d_slist_ptr != NULL)
H5SL_close(aux_ptr->d_slist_ptr);

if (aux_ptr->c_slist_ptr != NULL)
H5SL_close(aux_ptr->c_slist_ptr);

if (aux_ptr->candidate_slist_ptr != NULL)
H5SL_close(aux_ptr->candidate_slist_ptr);

aux_ptr->magic = 0;
aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr);
} /* end if */
@@ -514,7 +511,6 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
* [email protected]
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -569,6 +565,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
H5SL_close(aux_ptr->candidate_slist_ptr);
aux_ptr->magic = 0;
aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr);

} /* end if */
#endif /* H5_HAVE_PARALLEL */

@@ -649,19 +646,18 @@ H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t ad
/*-------------------------------------------------------------------------
* Function: H5AC_flush
*
* Purpose: Flush (and possibly destroy) the metadata cache associated
* with the specified file.
* Purpose: Flush (and possibly destroy) the metadata cache associated
* with the specified file.
*
* If the cache contains protected entries, the function will
* fail, as protected entries cannot be flushed. However
* all unprotected entries should be flushed before the
* function returns failure.
* If the cache contains protected entries, the function will
* fail, as protected entries cannot be flushed. However
* all unprotected entries should be flushed before the
* function returns failure.
*
* Return: Non-negative on success/Negative on failure if there was a
* request to flush all items and something was protected.
*
* Programmer: Robb Matzke
* [email protected]
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -713,15 +709,15 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id)
* Function: H5AC_get_entry_status
*
* Purpose: Given a file address, determine whether the metadata
* cache contains an entry at that location. If it does,
* also determine whether the entry is dirty, protected,
* pinned, etc. and return that information to the caller
* in *status_ptr.
* cache contains an entry at that location. If it does,
* also determine whether the entry is dirty, protected,
* pinned, etc. and return that information to the caller
* in *status.
*
* If the specified entry doesn't exist, set *status_ptr
* to zero.
* If the specified entry doesn't exist, set *status_ptr
* to zero.
*
* On error, the value of *status_ptr is undefined.
* On error, the value of *status is undefined.
*
* Return: Non-negative on success/Negative on failure
*
@@ -775,7 +771,6 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status_ptr)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
* [email protected]
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -862,8 +857,8 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add
/*-------------------------------------------------------------------------
* Function: H5AC_mark_entry_dirty
*
* Purpose: Mark a pinned or protected entry as dirty. The target
* entry MUST be either pinned, protected, or both.
* Purpose: Mark a pinned or protected entry as dirty. The target
* entry MUST be either pinned, protected, or both.
*
* Return: Non-negative on success/Negative on failure
*
@@ -932,7 +927,6 @@ H5AC_mark_entry_dirty(void *thing)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
* [email protected]
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -1002,7 +996,7 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne
/*-------------------------------------------------------------------------
* Function: H5AC_pin_protected_entry()
*
* Purpose: Pin a protected cache entry. The entry must be protected
* Purpose: Pin a protected cache entry. The entry must be protected
* at the time of call, and must be unpinned.
*
* Return: Non-negative on success/Negative on failure
@@ -1304,7 +1298,6 @@ H5AC_unpin_entry(void *thing)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
* [email protected]
* Sep 2 1997
*
*-------------------------------------------------------------------------
@@ -1628,9 +1621,7 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, H5AC_cache_config_t *
#endif /* H5_HAVE_PARALLEL */

done:

FUNC_LEAVE_NOAPI(ret_value)

} /* H5AC_get_cache_auto_resize_config() */

/*-------------------------------------------------------------------------
@@ -1663,9 +1654,7 @@ H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_s
}

done:

FUNC_LEAVE_NOAPI(ret_value)

} /* H5AC_get_cache_size() */

/*-------------------------------------------------------------------------
@@ -1722,9 +1711,7 @@ H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr)
}

done:

FUNC_LEAVE_NOAPI(ret_value)

} /* H5AC_reset_cache_hit_rate_stats() */

/*-------------------------------------------------------------------------
@@ -1868,16 +1855,16 @@ H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config
* Function: H5AC_validate_config()
*
* Purpose: Run a sanity check on the contents of the supplied
* instance of H5AC_cache_config_t.
* instance of H5AC_cache_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_config_t into an instance
* of H5C_auto_size_ctl_t, and then calling
* H5C_validate_resize_config(). As H5AC_cache_config_t and
* H5C_auto_size_ctl_t diverge, we may have to change this.
* At present, this function operates by packing the data
* from the instance of H5AC_cache_config_t into an instance
* of H5C_auto_size_ctl_t, and then calling
* H5C_validate_resize_config(). As H5AC_cache_config_t and
* H5C_auto_size_ctl_t diverge, we may have to change this.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2476,13 +2463,13 @@ H5AC_broadcast_clean_list(H5AC_t *cache_ptr)
* Function: H5AC_check_if_write_permitted
*
* Purpose: Determine if a write is permitted under the current
* circumstances, and set *write_permitted_ptr accordingly.
* As a general rule it is, but when we are running in parallel
* mode with collective I/O, we must ensure that a read cannot
* cause a write.
* circumstances, and set *write_permitted_ptr accordingly.
* As a general rule it is, but when we are running in parallel
* mode with collective I/O, we must ensure that a read cannot
* cause a write.
*
* In the event of failure, the value of *write_permitted_ptr
* is undefined.
* In the event of failure, the value of *write_permitted_ptr
* is undefined.
*
* Return: Non-negative on success/Negative on failure.
*
@@ -2747,12 +2734,12 @@ H5AC_copy_candidate_list_to_buffer(H5AC_t *cache_ptr, int *num_entries_ptr, hadd
* Function: H5AC_ext_config_2_int_config()
*
* Purpose: Utility function to translate an instance of
* H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t.
* H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t.
*
* Places translation in *int_conf_ptr and returns SUCCEED
* if successful. Returns FAIL on failure.
* Places translation in *int_conf_ptr and returns SUCCEED
* if successful. Returns FAIL on failure.
*
* Does only minimal sanity checking.
* Does only minimal sanity checking.
*
* Return: Non-negative on success/Negative on failure
*
Loading