Skip to content

Commit

Permalink
Merge branch 'SPECFEM:devel' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
homnath authored Oct 7, 2024
2 parents 8ba40c5 + a5bb135 commit 3e7a2b9
Show file tree
Hide file tree
Showing 393 changed files with 14,103 additions and 7,027 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 zxf 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
94 changes: 65 additions & 29 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check for changes
id: diff
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
needs: changesCheck

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand All @@ -104,9 +104,16 @@ jobs:
echo ""
## avoids sed -i '' issue on MacOS, using gnu sed to have the same sed command lines as in linux
brew install gnu-sed
echo "PATH=/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" >> $GITHUB_ENV
echo "PATH=/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" >> $GITHUB_ENV
## OpenMP
echo "OMP_NUM_THREADS=2" >> $GITHUB_ENV
## MPI
echo
echo "MPI environment:"
echo "mpif90 on path: $(which mpif90)"
echo
# add OpenMPI path to have ./configure detect mpi.h
echo "MPI_INC=/opt/homebrew/include" >> $GITHUB_ENV
## avoids MPI issue with number of slots
echo "OMPI_MCA_rmaps_base_oversubscribe=1" >> $GITHUB_ENV
echo "OMPI_MCA_rmaps_base_inherit=1" >> $GITHUB_ENV
Expand All @@ -121,7 +128,8 @@ jobs:
- name: configure
run: |
./configure
./configure ; if [[ $? -ne 0 ]]; then cat config.log; exit 1; fi
# changes SCOTCH Makefile for macOS
echo "modifying external_libs/scotch/src/Makefile.inc"
cp -v external_libs/scotch/src/Make.inc/Makefile.inc.i686_mac_darwin8 external_libs/scotch/src/Makefile.inc
Expand All @@ -139,10 +147,10 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest,ubuntu-20.04]
os: [ubuntu-latest,ubuntu-22.04]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -156,16 +164,16 @@ jobs:


linuxCheck-Intel:
name: Test Intel on ubuntu-20.04
runs-on: ubuntu-20.04
name: Test Intel on ubuntu-22.04
runs-on: ubuntu-22.04
needs: changesCheck

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Cache Intel oneapi packages
id: cache-intel-oneapi
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /opt/intel/oneapi
key: install-${{ runner.os }}-all
Expand Down Expand Up @@ -296,7 +304,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -315,7 +323,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -339,7 +347,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -363,7 +371,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -388,7 +396,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -412,7 +420,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -437,7 +445,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -462,7 +470,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -488,7 +496,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -513,7 +521,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -537,7 +545,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -561,7 +569,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -585,7 +593,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -609,7 +617,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -633,7 +641,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -657,7 +665,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -681,7 +689,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -705,7 +713,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
run: ./.github/scripts/run_install.sh
Expand All @@ -729,7 +737,7 @@ jobs:
needs: [linuxCheck]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages
env:
Expand All @@ -751,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

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ src/generate_databases/*.mod
src/meshfem3D/*.mod
src/specfem3D/*.mod
*__genmod.f90
my_mpi.mod

# documentation
manual_SPECFEM3D_Cartesian.aux
Expand Down
Loading

0 comments on commit 3e7a2b9

Please sign in to comment.