summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/h5vers48
-rwxr-xr-xbin/release205
-rw-r--r--c++/test/tfile.cpp3
-rw-r--r--src/H5ACmpio.c64
-rw-r--r--src/H5ACpkg.h4
-rw-r--r--src/H5Cdbg.c4
-rw-r--r--src/H5Cmpio.c98
-rw-r--r--src/H5Cpkg.h50
-rw-r--r--src/H5Cprivate.h6
-rw-r--r--src/H5win32defs.h4
-rw-r--r--test/cache.c47
-rw-r--r--test/cache_api.c13
-rw-r--r--test/cache_common.c2
-rw-r--r--test/links.c12
-rw-r--r--testpar/t_cache.c39
15 files changed, 363 insertions, 236 deletions
diff --git a/bin/h5vers b/bin/h5vers
index 9babf97..6ecf446 100755
--- a/bin/h5vers
+++ b/bin/h5vers
@@ -127,7 +127,7 @@ EOF
exit 1;
}
-# Parse arguments
+
my ($verbose, $set, $inc, $file, $rc);
my (@files) = ("H5public.h", "src/H5public.h", "../src/H5public.h");
while ($_ = shift) {
@@ -160,9 +160,10 @@ die "mutually exclusive options given\n" if $set && $inc;
# Determine file to use as H5public.h, README.txt,
# release_docs/RELEASE.txt, configure.ac, windows/src/H5pubconf.h
-# and config/lt_vers.am.
+# config/lt_vers.am and config/cmake/scripts/HDF5config.cmake.
# The README.txt, release_docs/RELEASE.txt, configure.ac,
-# windows/src/H5pubconf.h, and config/lt_vers.am
+# windows/src/H5pubconf.h, config/lt_vers.am and
+# config/cmake/scripts/HDF5config.cmake
# files are always in the directory above H5public.h
unless ($file) {
for (@files) {
@@ -175,6 +176,10 @@ die "unable to read file: $file\n" unless -r $file;
my $LT_VERS = $file;
$LT_VERS =~ s/[^\/]*$/..\/config\/lt_vers.am/;
die "unable to read file: $LT_VERS\n" unless -r $file;
+# config/cmake/scripts/HDF5config.cmake
+my $HDF5CONFIGCMAKE = $file;
+$HDF5CONFIGCMAKE =~ s/[^\/]*$/..\/config\/cmake\/scripts\/HDF5config.cmake/;
+die "unable to read file: $HDF5CONFIGCMAKE\n" unless -r $file;
# README.txt
my $README = $file;
$README =~ s/[^\/]*$/..\/README.txt/;
@@ -239,7 +244,8 @@ if ($set) {
$RELEASE = "";
$CONFIGURE = "";
$CPP_DOC_CONFIG = "";
- $LT_VERS = "";
+ $LT_VERS = "";
+ $HDF5CONFIGCMAKE = "";
@newver = @curver;
}
@@ -321,20 +327,43 @@ if ($RELEASE) {
# Update the c++/src/cpp_doc_config file
if ($CPP_DOC_CONFIG) {
my $data = read_file($CPP_DOC_CONFIG);
- my $version_string = sprintf("\"%d.%d.%d%s %s\"",
+ my $sub_rel_ver_str = (
+ $newver[3] eq ""
+ ? sprintf("%s", "")
+ : sprintf("%s", "-".$newver[3].", currently under development")
+ );
+ my $version_string = sprintf("\"%d.%d.%d%s%s\"",
@newver[0,1,2],
- $newver[3] eq "" ? "" : "-".$newver[3],
- "currently under development");
-
+ $sub_rel_ver_str);
$data =~ s/PROJECT_NUMBER\s*=.*/PROJECT_NUMBER = $version_string/;
write_file($CPP_DOC_CONFIG, $data);
}
+# Update the config/cmake/scripts/HDF5config.cmake file
+if ($HDF5CONFIGCMAKE) {
+ my $data = read_file($HDF5CONFIGCMAKE);
+# my $sub_rel_ver_str = "";
+ my $sub_rel_ver_str = (
+ $newver[3] eq ""
+ ? sprintf("\"%s\"", "")
+ : sprintf("\"%s\"", "-".$newver[3].", currently under development")
+ );
+ my $version_string = sprintf("\"%d.%d.%d\"", @newver[0,1,2]);
+
+ $data =~ s/set\(CTEST_SOURCE_VERSION .*\)/set\(CTEST_SOURCE_VERSION $version_string\)/;
+ $data =~ s/set\(CTEST_SOURCE_VERSEXT .*\)/set\(CTEST_SOURCE_VERSEXT $sub_rel_ver_str\)/;
+
+ write_file($HDF5CONFIGCMAKE, $data);
+}
+
+
+
# helper function to read the file for updating c++/src/cpp_doc_config file.
# 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
# facilitates the substring replacement.
+#Presumably these will also work for resetting the version in HDF5config.cmake.
sub read_file {
my ($filename) = @_;
@@ -346,7 +375,8 @@ sub read_file {
return $all;
}
-# helper function to write the file for updating c++/src/cpp_doc_config file.
+# helper function to write the file for updating c++/src/cpp_doc_config
+# and config/cmake/scripts/HDF5config.cmake files.
sub write_file {
my ($filename, $content) = @_;
diff --git a/bin/release b/bin/release
index f742926..352384f 100755
--- a/bin/release
+++ b/bin/release
@@ -57,8 +57,13 @@ for compressing the resulting tar archive (if none are given then
tar -- use tar and don't do any compressing.
gzip -- use gzip with "-9" and append ".gz" to the output name.
+ cmake-tgz -- create a tar file using the gzip default level with a build-unix.sh
+ command file and all other CMake files needed to build HDF5 source
+ using CMake on unix machines.
bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name.
zip -- convert all text files to DOS style and form a zip file for Windows use.
+ cmake-zip -- convert all text files to DOS style and create a zip file inluding cmake
+ scripts and .bat files to build HDF5 source using CMake on Windows.
doc -- produce the latest doc tree in addition to the archive.
An md5 checksum is produced for each archive created and stored in the md5 file.
@@ -95,9 +100,9 @@ EOF
# Modifications
#
# Steps:
-# 1. untar the tarball in a temporay directory;
+# 1. untar the tarball in a temporary directory;
# Note: do this in a temporary directory to avoid changing
-# the original source directory which maybe around.
+# the original source directory which may be around.
# 2. convert all its text files to DOS (LF-CR) style;
# 3. form a zip file which is usable by Windows users.
#
@@ -114,7 +119,7 @@ tar2zip()
echo "usage: tar2zip <tarfilename> <zipfilename>"
return 1
fi
- ztmpdir=/tmp/tmpdir$$
+ ztmpdir=/tmp/ztmpdir$$
mkdir -p $ztmpdir
version=$1
tarfile=$2
@@ -153,6 +158,175 @@ tar2zip()
rm -rf $ztmpdir
}
+# Function name: tar2cmakezip
+# Convert the release tarball to a Windows zipball with files to run CMake build.
+#
+# Programmer: Larry Knox
+# Creation date: 2017-02-20
+#
+# Modifications
+#
+# Steps:
+# 1. untar the tarball in a temporary directory;
+# Note: do this in a temporary directory to avoid changing
+# the original source directory which may be around.
+# 2. add build-unix.sh script.
+# 3. add SZIP.tar.gz, ZLib.tar.gz and cmake files to top level directory.
+# 4. create gzipped tar file with these contents:
+# build-unix.sh script
+# hdf5-<version> source code directory extracted from tar file
+# CTestScript.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
+# HDF5config.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
+# HDF5options.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
+# SZip.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake
+# ZLib.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake
+
+
+# Parameters:
+# $1 version
+# $2 release tarball
+# $3 output zipball file name
+#
+# Returns 0 if successful; 1 otherwise
+#
+ # need function to create another temporary directory, extract the
+ # $tmpdir/$HDF5_VERS.tar into it, add (create) build-unix.sh,
+ # CTestScript.cmake, HDF5config.cmake, SZIP.tar.gz and ZLib.tar.gz,
+ # and then tar.gz it.
+tar2cmakezip()
+{
+ if [ $# -ne 3 ]; then
+ echo "usage: tar2cmakezip <tarfilename> <tgzfilename>"
+ return 1
+ fi
+ cmziptmpdir=/tmp/cmziptmpdir$$
+ mkdir -p $cmziptmpdir
+ version=$1
+ tarfile=$2
+ zipfile=$3
+
+ # step 1: untar tarball in cmgztmpdir
+ (cd $cmziptmpdir; tar xf -) < $tarfile
+ # sanity check
+ if [ ! -d $cmziptmpdir/$version ]; then
+ echo "untar did not create $cmziptmpdir/$version source dir"
+ # cleanup
+ rm -rf $cmziptmpdir
+ return 1
+ 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
+
+ # step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files
+ cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmziptmpdir
+ cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmziptmpdir
+ cp $cmziptmpdir/$version/config/cmake/scripts/CTestScript.cmake $cmziptmpdir
+ cp $cmziptmpdir/$version/config/cmake/scripts/HDF5config.cmake $cmziptmpdir
+ cp $cmziptmpdir/$version/config/cmake/scripts/HDF5options.cmake $cmziptmpdir
+
+ # step 4: convert text files
+ # There maybe a simpler way to do this.
+ # options used in unix2dos:
+ # -k Keep the date stamp
+ # -q quiet mode
+ # grep redirect output to /dev/null because -q or -s are not portable.
+ find $cmziptmpdir/$version | \
+ while read inf; do \
+ if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \
+ unix2dos -q -k $inf; \
+ fi\
+ done
+ # step 3: make zipball
+ # -9 maximum compression
+ # -y Store symbolic links as such in the zip archive
+ # -r recursive
+ # -q quiet
+ (cd $cmziptmpdir; zip -9 -y -r -q CMake-$version.zip *)
+ mv $cmziptmpdir/CMake-$version.zip $zipfile
+
+ # cleanup
+ rm -rf $cmziptmpdir
+}
+
+# Function name: tar2cmaketgz
+# Convert the release tarball to a Windows zipball with files to run CMake build.
+#
+# Programmer: Larry Knox
+# Creation date: 2017-02-20
+#
+# Modifications
+#
+# Steps:
+# 1. untar the tarball in a temporary directory;
+# Note: do this in a temporary directory to avoid changing
+# the original source directory which may be around.
+# 2. add build-unix.sh script.
+# 3. add SZIP.tar.gz, ZLib.tar.gz and cmake files to top level directory.
+# 4. create gzipped tar file with these contents:
+# build-unix.sh script
+# hdf5-<version> source code directory extracted from tar file
+# CTestScript.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
+# HDF5config.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
+# HDF5options.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
+# SZip.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake
+# ZLib.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake
+
+
+# Parameters:
+# $1 version
+# $2 release tarball
+# $3 output zipball file name
+#
+# Returns 0 if successful; 1 otherwise
+#
+ # need function to create another temporary directory, extract the
+ # $tmpdir/$HDF5_VERS.tar into it, add (create) build-unix.sh,
+ # CTestScript.cmake, HDF5config.cmake, SZIP.tar.gz and ZLib.tar.gz,
+ # and then tar.gz it.
+tar2cmaketgz()
+{
+ if [ $# -ne 3 ]; then
+ echo "usage: tar2cmaketgz <tarfilename> <tgzfilename>"
+ return 1
+ fi
+ cmgztmpdir=/tmp/cmgztmpdir$$
+ mkdir -p $cmgztmpdir
+ version=$1
+ tarfile=$2
+ tgzfile=$3
+
+ # step 1: untar tarball in cmgztmpdir
+ (cd $cmgztmpdir; tar xf -) < $tarfile
+ # sanity check
+ if [ ! -d $cmgztmpdir/$version ]; then
+ echo "untar did not create $cmgztmpdir/$version source dir"
+ # cleanup
+ rm -rf $cmgztmpdir
+ return 1
+ fi
+
+
+ # step 2: add build-unix.sh script
+ (cd $cmgztmpdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix -C Release -V -O hdf5.log" > build-unix.sh; chmod 755 build-unix.sh)
+
+ # step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files
+ cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmgztmpdir
+ cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpdir
+ cp $cmgztmpdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpdir
+ cp $cmgztmpdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpdir
+ cp $cmgztmpdir/$version/config/cmake/scripts/HDF5options.cmake $cmgztmpdir
+ tar czf $DEST/CMake-$HDF5_VERS.tar.gz -C $cmgztmpdir . || exit 1
+
+ # cleanup
+ rm -rf $cmgztmpdir
+}
+
# This command must be run at the top level of the hdf5 source directory.
# Verify this requirement.
if [ ! \( -f configure.ac -a -f bin/release \) ]; then
@@ -256,6 +430,7 @@ if [ X$pmode = Xyes ]; then
# (h5vers does not correctly handle just m.n.r-$today.)
VERS=`echo $VERS | sed -e s/-.*//`-of$today
echo Private release of $VERS
+else
bin/h5vers -s $VERS
fi
@@ -325,6 +500,11 @@ for comp in $methods; do
gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz
(cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file)
;;
+ cmake-tgz)
+ test "$verbose" && echo " Creating CMake tar.gz file..." 1>&2
+ tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2
+ (cd $DEST; md5sum CMake-$HDF5_VERS.tar.gz >> $MD5file)
+ ;;
bzip2)
test "$verbose" && echo " Running bzip2..." 1>&2
bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2
@@ -335,6 +515,11 @@ for comp in $methods; do
tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2
(cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file)
;;
+ cmake-zip)
+ test "$verbose" && echo " Creating CMake-zip ball..." 1>&2
+ tar2cmakezip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.zip 1>&2
+ (cd $DEST; md5sum CMake-$HDF5_VERS.zip >> $MD5file)
+ ;;
doc)
if [ "${DOCVERSION}" = "" ]; then
DOCVERSION=master
@@ -342,15 +527,15 @@ for comp in $methods; do
test "$verbose" && echo " Creating docs..." 1>&2
# Check out docs from git repo
(cd $tmpdir; git clone -q $DOC_URL ${DOCVERSION} > /dev/null) || exit 1
- # Create doxygen C++ RM
+ # Create doxygen C++ RM
(cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1
# Replace version of C++ RM with just-created version
- rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME
- mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME
- # Compress the docs and move them to the release area
- mv $tmpdir/${DOCVERSION} $tmpdir/${HDF5_VERS}_docs
- (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs)
- mv $tmpdir/${HDF5_VERS}_docs.tar $DEST
+ rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1
+ mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1
+ # Compress the docs and move them to the release area
+ mv $tmpdir/${DOCVERSION} $tmpdir/${HDF5_VERS}_docs || exit 1
+ (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) || exit 1
+ mv $tmpdir/${HDF5_VERS}_docs.tar $DEST || exit 1
;;
*)
echo "***Error*** Unknown method $comp"
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index d085d29..934d6e6 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -411,10 +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");
+ issue_fail_msg("test_file_size()", __LINE__, __FILE__, "H5Pclose failed");
} // test_file_size()
diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c
index 44ffd9d..cccb3bd 100644
--- a/src/H5ACmpio.c
+++ b/src/H5ACmpio.c
@@ -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 = 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;
+ size_t buf_size = 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 */
@@ -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 = 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,7 +446,7 @@ 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")
@@ -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
@@ -640,7 +640,7 @@ H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, int *num_entries_pt
/* 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")
@@ -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
@@ -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 816f1d5..77ba0ae 100644
--- a/src/H5ACpkg.h
+++ b/src/H5ACpkg.h
@@ -404,7 +404,7 @@ 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;
@@ -430,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/H5Cdbg.c b/src/H5Cdbg.c
index f926c71..3dbe86c 100644
--- a/src/H5Cdbg.c
+++ b/src/H5Cdbg.c
@@ -211,7 +211,7 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn)
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) {
@@ -651,7 +651,7 @@ H5C_stats(H5C_t * cache_ptr,
(long long)(cache_ptr->index_scan_restarts));
HDfprintf(stdout,
- "%s cache image creations/loads/size = %d / %d / %lld\n",
+ "%s cache image creations/loads/size = %d / %d / %Hu\n",
cache_ptr->prefix,
cache_ptr->images_created,
cache_ptr->images_loaded,
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c
index 137e21d..7df8093 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)
@@ -231,7 +206,8 @@ 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)
@@ -250,8 +226,8 @@ H5C_apply_candidate_list(H5F_t * f,
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);
@@ -327,12 +303,12 @@ H5C_apply_candidate_list(H5F_t * f,
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];
+ 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(u > 0) {
if(last_addr == addr)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "duplicate entry in cleaned list")
else if(last_addr > addr)
@@ -352,7 +328,7 @@ H5C_apply_candidate_list(H5F_t * f,
* 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?!?!?.")
+ 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
@@ -367,20 +343,21 @@ H5C_apply_candidate_list(H5F_t * f,
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 */
+ /* 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,
+ HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%d/%d.\n",
+ FUNC, mpi_rank, num_candidates, (int)entries_to_clear,
(int)entries_to_flush);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
@@ -829,7 +806,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;
@@ -943,7 +920,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 );
@@ -1010,29 +987,6 @@ 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
@@ -1043,9 +997,9 @@ H5C_mark_entries_as_clean(H5F_t * f,
{
H5C_t * cache_ptr;
int entries_cleared;
- int entries_examined;
+ unsigned entries_examined;
int i;
- int initial_list_len;
+ unsigned initial_list_len;
haddr_t addr;
#if H5C_DO_SANITY_CHECKS
int pinned_entries_marked = 0;
@@ -1266,7 +1220,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;
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h
index 9a9e038..2474c3a 100644
--- a/src/H5Cpkg.h
+++ b/src/H5Cpkg.h
@@ -523,7 +523,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") \
}
@@ -1008,8 +1008,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) \
@@ -1031,8 +1030,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) \
@@ -1073,7 +1071,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) \
@@ -1099,7 +1097,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) */
@@ -1111,7 +1109,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) */
@@ -1133,8 +1131,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) */
@@ -1142,8 +1139,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, \
@@ -1178,8 +1174,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, \
@@ -1209,8 +1204,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) \
@@ -1237,8 +1231,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) \
@@ -1265,8 +1258,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) \
@@ -1282,8 +1274,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) \
@@ -1299,8 +1290,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 */
@@ -1601,8 +1591,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; \
@@ -1690,8 +1679,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)) \
@@ -2560,7 +2548,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 { \
\
@@ -2966,7 +2953,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 */ \
\
@@ -4311,7 +4297,7 @@ typedef struct H5C_tag_info_t {
* 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
@@ -4328,7 +4314,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
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index 47573f9..9696cc0 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -1661,8 +1661,8 @@ typedef struct H5C_cache_entry_t {
* JRM - 8/5/15
*
* magic: Unsigned 32 bit integer that must always be set to
- * H5C__H5C_IMAGE_ENTRY_T_MAGIC when the entry is valid.
- * The field must be set to H5C__H5C_IMAGE__ENTRY_T_BAD_MAGIC
+ * 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.
@@ -2279,7 +2279,7 @@ H5_DLL herr_t H5C_cache_image_status(H5F_t * f, hbool_t *load_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);
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/test/cache.c b/test/cache.c
index d09a122..1cfc0b1 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -13697,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,
@@ -16779,7 +16779,6 @@ check_expunge_entry_errs(void)
*
*-------------------------------------------------------------------------
*/
-
static unsigned
check_move_entry_errs(void)
{
@@ -16801,7 +16800,6 @@ check_move_entry_errs(void)
*/
if(pass) {
-
reset_entries();
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024));
@@ -16814,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.
*
@@ -16852,7 +16843,6 @@ check_move_entry_errs(void)
*/
if(pass) {
-
reset_entries();
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024));
@@ -16860,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);
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);
@@ -16892,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;
diff --git a/test/cache_api.c b/test/cache_api.c
index a0d6e83..6c43796 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -2314,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 bb526c1..81e62ae 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -6438,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/links.c b/test/links.c
index d5a3b83..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 */
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 039b3ab..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;
};
@@ -485,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);
@@ -1214,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 */
@@ -4334,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 ) );
@@ -4362,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
@@ -4399,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);
}
@@ -4929,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 ) {
@@ -4997,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);
}
@@ -5319,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 ) {
@@ -5423,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 ) {