Skip to content

Commit

Permalink
adds github actions hdf5 compilation test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeter committed Nov 6, 2024
1 parent 0cf3984 commit f290bbc
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/scripts/run_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ sudo apt-get install -yq --no-install-recommends gfortran g++ openmpi-bin libope
if [[ $? -ne 0 ]]; then exit 1; fi
echo

# parallel hdf5
if [[ "${TEST}" == *"with-hdf5"* ]]; then
echo
echo "additional installation: ${TEST}"
echo
sudo apt-get install -yq --no-install-recommends libhdf5-mpi-dev
## checks installation paths
#echo
#dpkg -L libhdf5-mpi-dev
#echo
#dpkg -L libhdf5-openmpi-dev
#echo
#echo "hdf5 module paths:"
#find /usr/ -iname 'hdf5.mod'
#echo "hdf5 library paths:"
#find /usr/ -iname 'libhdf5hl_fortran*'
#echo
fi

## NetCDF
if [ "${NETCDF}" == "true" ]; then
echo
Expand Down
14 changes: 13 additions & 1 deletion .github/scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ echo
# bash function for checking seismogram output with reference solutions
my_test(){
echo "testing seismograms:"
ln -s $WORKDIR/utils/compare_seismogram_correlations.py
ln -s $WORKDIR/utils/scripts/compare_seismogram_correlations.py
./compare_seismogram_correlations.py REF_SEIS/ OUTPUT_FILES/
if [[ $? -ne 0 ]]; then exit 1; fi
./compare_seismogram_correlations.py REF_SEIS/ OUTPUT_FILES/ | grep min/max | cut -d \| -f 3 | awk '{print "correlation:",$1; if ($1 < 0.999 ){print $1,"failed"; exit 1;}else{ print $1,"good"; exit 0;}}'
Expand Down Expand Up @@ -65,6 +65,18 @@ if [ "${FULL_GRAVITY}" == "true" ]; then
echo "NSTEP = 2" >> DATA/Par_file
fi

# hdf5 i/o example
if [[ "${TEST}" == *"with-hdf5"* ]]; then
echo
echo "test run: ${TEST}"
echo
sed -i "s:^HDF5_ENABLED .*:HDF5_ENABLED = .true.:" DATA/Par_file
#sed -i "s:^HDF5_FOR_MOVIES .*:HDF5_FOR_MOVIES = .true.:" DATA/Par_file
#sed -i "s:^HDF5_IO_NODES .*:HDF5_IO_NODES = 1:" DATA/Par_file
# replaces run script
#cp -v run_this_example_HDF5_IO_server.sh run_this_example.sh
fi

# adios
if [ "${ADIOS2}" == "true" ]; then
# turns on ADIOS
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -552,3 +552,30 @@ jobs:
RUN_KERNEL: true
run: ./.github/scripts/run_tests.sh
shell: bash

linuxTest_11:
name: Test run example 11 - regional_Greece_small hdf5 i/o
runs-on: ubuntu-latest
needs: [linuxCheck]

steps:
- uses: actions/checkout@v4

- name: Install packages
env:
TEST: with-hdf5
run: ./.github/scripts/run_install.sh
shell: bash

- name: Run build
env:
TESTFLAGS: --with-hdf5 HDF5_INC=/usr/include/hdf5/openmpi/ HDF5_LIBS=-L/usr/lib/x86_64-linux-gnu/hdf5/openmpi
run: ./.github/scripts/run_build.sh
shell: bash

- name: Run test
env:
TEST: with-hdf5
TESTDIR: EXAMPLES/regional_Greece_small
run: ./.github/scripts/run_tests.sh
shell: bash

0 comments on commit f290bbc

Please sign in to comment.