Skip to content

Commit

Permalink
adds github action test for adios2
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeter committed Jun 4, 2024
1 parent 68dfd57 commit 2e3887e
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 9 deletions.
14 changes: 13 additions & 1 deletion .github/scripts/run_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ echo "mpif90 --version"
mpif90 --version
echo

## ADIOS2
if [ "${ADIOS2}" == "true" ]; then
echo
echo "enabling ADIOS2"
echo
ADIOS2_CONFIG="${ADIOS2_DIR}/bin/adios2-config"
adios=(--with-adios2 ADIOS2_CONFIG="$ADIOS2_CONFIG" )
else
adios=()
fi

## NetCDF
if [ "${NETCDF}" == "true" ]; then
echo
Expand All @@ -39,7 +50,7 @@ else
netcdf=()
fi

# PETSc
## PETSc
if [ "${PETSC}" == "true" ]; then
echo
echo "enabling PETSc"
Expand All @@ -55,6 +66,7 @@ echo "configuration:"
echo

./configure \
${adios[@]} \
${netcdf[@]} \
${petsc[@]} \
FC=gfortran MPIFC=mpif90 CC=gcc "${TESTFLAGS}"
Expand Down
41 changes: 37 additions & 4 deletions .github/scripts/run_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sudo apt-get install -yq --no-install-recommends gfortran g++ openmpi-bin libope
if [[ $? -ne 0 ]]; then exit 1; fi
echo

# NetCDF
## NetCDF
if [ "${NETCDF}" == "true" ]; then
echo
echo "NETCDF installation:"
Expand All @@ -27,10 +27,10 @@ if [ "${NETCDF}" == "true" ]; then
sudo apt-get install -yq --no-install-recommends libnetcdff-dev
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
echo "done"; echo
echo; echo "done netCDF"; echo
fi

# PETSc
## PETSc
if [ "${PETSC}" == "true" ]; then
echo
echo "PETSc installation:"
Expand All @@ -43,7 +43,7 @@ if [ "${PETSC}" == "true" ]; then
sudo apt-get install -yq --no-install-recommends petsc-dev
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
echo "done"; echo
echo; echo "done PETSc"; echo
fi

# python3 pip upgrade might complain: "ERROR: launchpadlib 1.10.13 requires testresources"
Expand Down Expand Up @@ -88,6 +88,39 @@ echo "mpif90 --version"
mpif90 --version
echo

## ADIOS2
if [ "${ADIOS2}" == "true" ]; then
echo
echo "ADIOS2 installation:"
echo
# installs cmake wget
sudo apt-get install -yq --no-install-recommends cmake wget
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
# uses /opt as installation directory
mkdir -p /opt; cd /opt
# download source
wget https://github.com/ornladios/ADIOS2/archive/refs/tags/v2.10.1.tar.gz
tar zxvf v2.10.1.tar.gz
cd ADIOS2-2.10.1/
# build source
mkdir -p build; cd build/
CC=gcc CXX=g++ FC=gfortran cmake -DADIOS2_USE_Fortran=ON \
-DADIOS2_USE_HDF5=OFF -DADIOS2_BUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=/opt/ADIOS2 ../
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
make -j4
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
make install
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
# environment for directory
echo "ADIOS2_DIR=/opt/ADIOS2" >> $GITHUB_ENV
echo; echo "done ADIOS2"; echo
fi

# MPI
# github actions uses for Linux virtual machines a 2-core CPU environment
# see: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
Expand Down
17 changes: 14 additions & 3 deletions .github/scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,20 @@ if [ "${FULL_GRAVITY}" == "true" ]; then
echo "NSTEP = 2" >> DATA/Par_file
fi

# default script
./run_this_example.sh
# full gravity
if [ "${ADIOS2}" == "true" ]; then
# turns on ADIOS
sed -i "s:^ADIOS_ENABLED .*:ADIOS_ENABLED = .true.:" DATA/Par_file
fi

# use kernel script
if [ "${RUN_KERNEL}" == "true" ]; then
# use kernel script
./run_this_example.kernel.sh
else
# default script
./run_this_example.sh
fi
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

Expand All @@ -75,7 +86,7 @@ echo `date`
echo

# seismogram comparison
if [ "${DEBUG}" == "true" ] || [ "${FULL_GRAVITY}" == "true" ]; then
if [ "${DEBUG}" == "true" ] || [ "${FULL_GRAVITY}" == "true" ] || [ "${RUN_KERNEL}" == "true" ]; then
# no comparisons
: # do nothing
else
Expand Down
31 changes: 30 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ jobs:

- name: Run build
env:
TESTFLAGS: --enable-vectorization
TESTFLAGS: # no extra flags
PETSC: true
run: ./.github/scripts/run_build.sh
shell: bash
Expand All @@ -523,3 +523,32 @@ jobs:
PETSC: true
run: ./.github/scripts/run_tests.sh
shell: bash

linuxTest_10:
name: Test run example 10 - regional_Greece_small_LDDRK kernel ADIOS2
runs-on: ubuntu-latest
needs: [linuxCheck]

steps:
- uses: actions/checkout@v4

- name: Install packages
env:
ADIOS2: true
run: ./.github/scripts/run_install.sh
shell: bash

- name: Run build
env:
TESTFLAGS: # no extra flags
ADIOS2: true
run: ./.github/scripts/run_build.sh
shell: bash

- name: Run test
env:
TESTDIR: EXAMPLES/regional_Greece_small_LDDRK
ADIOS2: true
RUN_KERNEL: true
run: ./.github/scripts/run_tests.sh
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ program convert_model_file_adios
call world_size(sizeprocs)
call world_rank(myrank)

! initialization
is_model_file_conversion = .false.
convert_format = 0

! reads input arguments
do i = 1, 4
call get_command_argument(i,arg)
Expand Down

0 comments on commit 2e3887e

Please sign in to comment.