Skip to content

Commit

Permalink
adds github action test case w/ ADIOS2
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeter committed Jun 5, 2024
1 parent 560c1f9 commit 4d38bff
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/scripts/run_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,25 @@ 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

# configuration
echo
echo "configuration: default"
echo "configuration:"
echo

./configure FC=gfortran MPIFC=mpif90 CC=gcc ${TESTFLAGS}
./configure \
${adios[@]} \
FC=gfortran MPIFC=mpif90 CC=gcc ${TESTFLAGS}

# checks
if [[ $? -ne 0 ]]; then echo "configuration failed:"; cat config.log; echo ""; echo "exiting..."; exit 1; fi
Expand Down
39 changes: 39 additions & 0 deletions .github/scripts/run_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ fi
if [[ $? -ne 0 ]]; then exit 1; fi
echo

# python3 pip upgrade might complain: "ERROR: launchpadlib 1.10.13 requires testresources"
sudo apt-get install -yq --no-install-recommends python3-testresources
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
echo

# python script needs numpy
#sudo apt-get install -qq python-numpy # not working, likely installed on older python version
pip install --user --upgrade pip setuptools wheel
Expand Down Expand Up @@ -68,6 +74,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
6 changes: 6 additions & 0 deletions .github/scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ if [[ "${TEST}" == *"with-hdf5"* ]]; then
cp -v run_this_example_HDF5_IO_server.sh run_this_example.sh
fi

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

# default script
./run_this_example.sh

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -759,3 +759,31 @@ jobs:
run: ./.github/scripts/run_tests.sh
shell: bash

linuxTest_19:
name: Test run example 19 - meshfem3D simple model w/ 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: --with-mpi --enable-vectorization
ADIOS2: true
run: ./.github/scripts/run_build.sh
shell: bash

- name: Run test
env:
TESTDIR: EXAMPLES/applications/meshfem3D_examples/simple_model/
ADIOS2: true
run: ./.github/scripts/run_tests.sh
shell: bash

0 comments on commit 4d38bff

Please sign in to comment.