Skip to content

Commit

Permalink
Merge pull request #38 from byrnHDF/hdf5_1_8
Browse files Browse the repository at this point in the history
Reduce code differences between HDF5 1.8 and 1.10
  • Loading branch information
lrknox authored Nov 12, 2020
2 parents 1ce4c8d + 05a7b25 commit aab84e7
Show file tree
Hide file tree
Showing 327 changed files with 12,662 additions and 16,499 deletions.
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
Empty file modified bin/test-driver
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion config/cmake/scripts/HDF5config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ endif ()
#set (LOCAL_NO_PACKAGE "TRUE")
##### Following controls source update #####
#set (LOCAL_UPDATE "TRUE")
set (REPOSITORY_URL "https://[email protected]/scm/hdffv/hdf5.git")
set (REPOSITORY_URL "https://github.com/HDFGroup/hdf5.git")
set (REPOSITORY_BRANCH "hdf5_1_8")

#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows
Expand Down
2 changes: 2 additions & 0 deletions config/cmake/scripts/HDF5options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT")
### ext libs on system
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=NO")
#set(ENV{ZLIB_ROOT} "some_location")
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include")
#set(ENV{SZIP_ROOT} "some_location")
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include")

### disable using ext zlib
Expand Down
5 changes: 4 additions & 1 deletion m4/libtool.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2867,6 +2867,9 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
# before this can be enabled.
hardcode_into_libs=yes
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
# Ideally, we could use ldconfig to report *all* directores which are
# searched for libraries, however this is still not possible. Aside from not
# being certain /sbin/ldconfig is available, command
Expand All @@ -2875,7 +2878,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
# appending ld.so.conf contents (and includes) to the search path.
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
Expand Down
11 changes: 0 additions & 11 deletions m4/ltsugar.m4
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# If you do not have access to either file, you may request a copy from
# [email protected].

# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
Expand Down
142 changes: 71 additions & 71 deletions release_docs/README_HPC
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
************************************************************************
* Using CMake to build and test HDF5 source on HPC machines *
************************************************************************
************************************************************************

Contents

Expand All @@ -16,34 +16,34 @@ Section VI: Other cross compiling options
========================================================================
I. Prerequisites
========================================================================
1. Create a working directory that is accessible from the compute nodes for
1. Create a working directory that is accessible from the compute nodes for
running tests; the working directory should be in a scratch space or a
parallel file system space since testing will use this space. Building
from HDF5 source in a 'home' directory typically results in test
from HDF5 source in a 'home' directory typically results in test
failures and should be avoided.
2. Load modules for desired compilers, module for cmake version 3.10 or greater,

2. Load modules for desired compilers, module for cmake version 3.12 or greater,
and set any needed environment variables for compilers (i.e., CC, FC, CXX).
Unload any problematic modules (i.e., craype-hugepages2M).

========================================================================
II. Obtain HDF5 source
========================================================================
Obtain HDF5 source code from the HDF5 repository using a git command or
Obtain HDF5 source code from the HDF5 repository using a git command or
from a release tar file in a working directory:

git clone https://[email protected]/scm/hdffv/hdf5.git
git clone https://github.com/HDFGroup/hdf5.git
[-b branch] [source directory]

If no branch is specified, then the 'develop' version will be checked out.
If no source directory is specified, then the source will be located in the
'hdf5' directory. The Cmake scripts expect the source to be in a directory
If no source directory is specified, then the source will be located in the
'hdf5' directory. The CMake scripts expect the source to be in a directory
named hdf5-<version string>, where 'version string' uses the format '1.xx.xx'.
For example, for the current 'develop' version, the "hdf5" directory should
be renamed "hdf5-1.8.22", or for the first hdf5_1_8_22 pre-release version,
For example, for the current 'develop' version, the "hdf5" directory should
be renamed "hdf5-1.8.22", or for the first hdf5_1_8_22 pre-release version,
it should be renamed "hdf5-1.8.22-pre1".

If the version number is not known a priori, the version string
If the version number is not known a priori, the version string
can be obtained by running bin/h5vers in the top level directory of the source clone, and
the source directory renamed 'hdf5-<version string>'.

Expand All @@ -57,23 +57,23 @@ The ctest command [1]:

ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix -C Release -V -O hdf5.log

will configure, build, test and package HDF5 from the downloaded source
will configure, build, test and package HDF5 from the downloaded source
after the setup steps outlined below are followed.

CMake option variables are available to allow running test programs in batch
scripts on compute nodes and to cross-compile for compute node hardware using
CMake option variables are available to allow running test programs in batch
scripts on compute nodes and to cross-compile for compute node hardware using
a cross-compiling emulator. The setup steps will make default settings for
parallel or serial only builds available to the CMake command.
parallel or serial only builds available to the CMake command.

1. For the current 'develop' version the "hdf5" directory should be renamed
1. For the current 'develop' version the "hdf5" directory should be renamed
"hdf5-1.8.22".

2. Three cmake script files need to be copied to the working directory, or
have symbolic links to them, created in the working directory:

hdf5-1.8.22/config/cmake/scripts/HDF5config.cmake
hdf5-1.8.22/config/cmake/scripts/CTestScript.cmake
hdf5-1.8.22/config/cmake/scripts/HDF5options.cmake
hdf5-1.8.22/config/cmake/scripts/HDF5options.cmake

should be copied to the working directory.

Expand All @@ -84,14 +84,14 @@ parallel or serial only builds available to the CMake command.
HDF5options.cmake
hdf5-1.8.22

Additionally, when the ctest command runs [1], it will add a build directory
Additionally, when the ctest command runs [1], it will add a build directory
in the working directory.

4. The following options (among others) can be added to the ctest
command [1], following '-S HDF5config.cmake,' and separated by ',':

HPC=sbatch (or 'bsub' or 'raybsub') indicates which type of batch
files to use for running tests. If omitted, test
files to use for running tests. If omitted, test
will run on the local machine or login node.

KNL=true to cross-compile for KNL compute nodes on CrayXC40
Expand All @@ -104,27 +104,27 @@ parallel or serial only builds available to the CMake command.

The HPC options will add BUILD_GENERATOR=Unix for the three HPC options.
An example ctest command for a parallel build on a system using sbatch is

ctest -S HDF5config.cmake,HPC=sbatch,MPI=true -C Release -V -O hdf5.log

Adding the option 'KNL=true' to the above list will compile for KNL nodes,
Adding the option 'KNL=true' to the above list will compile for KNL nodes,
for example, on 'mutrino' and other CrayXC40 machines.

Changing -V to -VV will produce more logging information in HDF5.log.
Changing -V to -VV will produce more logging information in HDF5.log.

More detailed CMake information can be found in the HDF5 source in
More detailed CMake information can be found in the HDF5 source in
release_docs/INSTALL_CMake.txt.

========================================================================
IV. Cross-compiling
========================================================================
For cross-compiling on Cray, set environment variables CC=cc, FC=ftn
For cross-compiling on Cray, set environment variables CC=cc, FC=ftn
and CXX=CC (for c++) after all compiler modules are loaded since switching
compiler modules may unset or reset these variables.

CMake provides options for cross-compiling. To cross-compile for KNL hardware
on mutrino and other CrayXC40 machines, add HPC=sbatch,KNL=true to the
ctest command line. This will set the following options from the
CMake provides options for cross-compiling. To cross-compile for KNL hardware
on mutrino and other CrayXC40 machines, add HPC=sbatch,KNL=true to the
ctest command line. This will set the following options from the
config/cmake/scripts/HPC/sbatch-HDF5options.cmake file:

set (COMPILENODE_HWCOMPILE_MODULE "craype-haswell")
Expand All @@ -133,74 +133,74 @@ config/cmake/scripts/HPC/sbatch-HDF5options.cmake file:
set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "knl_ctestP.sl")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/crayle.cmake")

On the Cray XC40 the craype-haswell module is needed for configuring, and the
On the Cray XC40 the craype-haswell module is needed for configuring, and the
craype-mic-knl module is needed for building to run on the KNL nodes. CMake
with the above options will swap modules after configuring is complete,
with the above options will swap modules after configuring is complete,
but before compiling programs for KNL.

The sbatch script arguments for running jobs on KNL nodes may differ on CrayXC40
machines other than mutrino. The batch scripts knl_ctestS.sl and knl_ctestP.sl
have the correct arguments for mutrino: "#SBATCH -p knl -C quad,cache". For
cori, another CrayXC40, that line is replaced by "#SBATCH -C knl,quad,cache".
For cori (and other machines), the values in LOCAL_BATCH_SCRIPT_NAME and
LOCAL_BATCH_SCRIPT_PARALLEL_NAME in the config/cmake/scripts/HPC/sbatch-HDF5options.cmake
file can be replaced by cori_knl_ctestS.sl and cori_knl_ctestS.sl, or the lines
machines other than mutrino. The batch scripts knl_ctestS.sl and knl_ctestP.sl
have the correct arguments for mutrino: "#SBATCH -p knl -C quad,cache". For
cori, another CrayXC40, that line is replaced by "#SBATCH -C knl,quad,cache".
For cori (and other machines), the values in LOCAL_BATCH_SCRIPT_NAME and
LOCAL_BATCH_SCRIPT_PARALLEL_NAME in the config/cmake/scripts/HPC/sbatch-HDF5options.cmake
file can be replaced by cori_knl_ctestS.sl and cori_knl_ctestS.sl, or the lines
can be edited in the batch files in hdf5-1.8.22/bin/batch.

========================================================================
V. Manual alternatives
========================================================================
If using ctest is undesirable, one can create a build directory and run the cmake
If using ctest is undesirable, one can create a build directory and run the cmake
configure command, for example

"/projects/Mutrino/hpcsoft/cle6.0/common/cmake/3.10.2/bin/cmake"
-C "<working directory>/hdf5-1.8.22/config/cmake/cacheinit.cmake"
-DCMAKE_BUILD_TYPE:STRING=Release -DHDF5_BUILD_FORTRAN:BOOL=ON
-DHDF5_BUILD_JAVA:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=<working directory>/HDF_Group/HDF5/1.8.22
-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF
-DHDF5_ENABLE_PARALLEL:BOOL=ON -DHDF5_BUILD_CPP_LIB:BOOL=OFF
-DHDF5_ENABLE_THREADSAFE:BOOL=OFF
-DHDF5_PACKAGE_EXTLIBS:BOOL=ON -DLOCAL_BATCH_TEST:BOOL=ON
-DMPIEXEC_EXECUTABLE:STRING=srun -DMPIEXEC_NUMPROC_FLAG:STRING=-n
-DMPIEXEC_MAX_NUMPROCS:STRING=6
-DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/crayle.cmake
-DLOCAL_BATCH_SCRIPT_NAME:STRING=knl_ctestS.sl
-DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=knl_ctestP.sl -DSITE:STRING=mutrino
-DBUILDNAME:STRING=par-knl_GCC493-SHARED-Linux-4.4.156-94.61.1.16335.0.PTF.1107299-default-x86_64
"/projects/Mutrino/hpcsoft/cle6.0/common/cmake/3.12/bin/cmake"
-C "<working directory>/hdf5-1.8.22/config/cmake/cacheinit.cmake"
-DCMAKE_BUILD_TYPE:STRING=Release -DHDF5_BUILD_FORTRAN:BOOL=ON
-DHDF5_BUILD_JAVA:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=<working directory>/HDF_Group/HDF5/1.8.22
-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF
-DHDF5_ENABLE_PARALLEL:BOOL=ON -DHDF5_BUILD_CPP_LIB:BOOL=OFF
-DHDF5_ENABLE_THREADSAFE:BOOL=OFF
-DHDF5_PACKAGE_EXTLIBS:BOOL=ON -DLOCAL_BATCH_TEST:BOOL=ON
-DMPIEXEC_EXECUTABLE:STRING=srun -DMPIEXEC_NUMPROC_FLAG:STRING=-n
-DMPIEXEC_MAX_NUMPROCS:STRING=6
-DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/crayle.cmake
-DLOCAL_BATCH_SCRIPT_NAME:STRING=knl_ctestS.sl
-DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=knl_ctestP.sl -DSITE:STRING=mutrino
-DBUILDNAME:STRING=par-knl_GCC493-SHARED-Linux-4.4.156-94.61.1.16335.0.PTF.1107299-default-x86_64
"-GUnix Makefiles" "" "<working directory>/hdf5-1.8.22"

followed by make and batch jobs to run tests.

To cross-compile on CrayXC40, run the configure command with the craype-haswell
To cross-compile on CrayXC40, run the configure command with the craype-haswell
module loaded, then switch to the craype-mic-knl module for the build process.

Tests on machines using slurm can be run with
Tests on machines using slurm can be run with

"sbatch -p knl -C quad,cache ctestS.sl"
"sbatch -p knl -C quad,cache ctestS.sl"

or
or

"sbatch -p knl -C quad,cache ctestP.sl"
"sbatch -p knl -C quad,cache ctestP.sl"

for parallel builds.

Tests on machines using LSF will typically use "bsub ctestS.lsf", etc.

========================================================================
VI. Other cross compiling options
========================================================================
Settings for two other cross-compiling options are also in the config/toolchain
Settings for two other cross-compiling options are also in the config/toolchain
files which do not seem to be necessary with the Cray PrgEnv-* modules

1. HDF5_USE_PREGEN. This option, along with the HDF5_USE_PREGEN_DIR CMake
variable would allow the use of an appropriate H5Tinit.c file with type
information generated on a compute node to be used when cross compiling
for those compute nodes. The use of the variables in lines 110 and 111
of HDF5options.cmake file seem to preclude needing this option with the
available Cray modules and CMake option.

2. HDF5_BATCH_H5DETECT and associated CMake variables. This option when
properly configured will run H5detect in a batch job on a compute node
at the beginning of the CMake build process. It was also found to be
unnecessary with the available Cray modules and CMake options.
1. HDF5_USE_PREGEN. This option, along with the HDF5_USE_PREGEN_DIR CMake
variable would allow the use of an appropriate H5Tinit.c file with type
information generated on a compute node to be used when cross compiling
for those compute nodes. The use of the variables in lines 110 and 111
of HDF5options.cmake file seem to preclude needing this option with the
available Cray modules and CMake option.

2. HDF5_BATCH_H5DETECT and associated CMake variables. This option when
properly configured will run H5detect in a batch job on a compute node
at the beginning of the CMake build process. It was also found to be
unnecessary with the available Cray modules and CMake options.
14 changes: 7 additions & 7 deletions src/H5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -223,11 +223,6 @@ H5_init_library(void)
*
* Return: void
*
* Programmer: Robb Matzke
* Friday, November 20, 1998
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
void
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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() */
Expand Down Expand Up @@ -954,6 +951,9 @@ H5is_library_threadsafe(hbool_t *is_ts)
* NOTE: The main purpose of this is for handling Win32 thread cleanup
* on thread/process detach.
*
* Only enabled when the shared Windows library is built with
* thread safety enabled.
*
* Return: TRUE on success, FALSE on failure
*
*-------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit aab84e7

Please sign in to comment.