Skip to content

Commit 3e7a2b9

Browse files
authored
Merge branch 'SPECFEM:devel' into devel
2 parents 8ba40c5 + a5bb135 commit 3e7a2b9

File tree

393 files changed

+14103
-7027
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

393 files changed

+14103
-7027
lines changed

.github/scripts/run_build.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,25 @@ echo "mpif90 --version"
2929
mpif90 --version
3030
echo
3131

32+
## ADIOS2
33+
if [ "${ADIOS2}" == "true" ]; then
34+
echo
35+
echo "enabling ADIOS2"
36+
echo
37+
ADIOS2_CONFIG="${ADIOS2_DIR}/bin/adios2-config"
38+
adios=(--with-adios2 ADIOS2_CONFIG="$ADIOS2_CONFIG" )
39+
else
40+
adios=()
41+
fi
3242

3343
# configuration
3444
echo
35-
echo "configuration: default"
45+
echo "configuration:"
3646
echo
3747

38-
./configure FC=gfortran MPIFC=mpif90 CC=gcc ${TESTFLAGS}
48+
./configure \
49+
${adios[@]} \
50+
FC=gfortran MPIFC=mpif90 CC=gcc ${TESTFLAGS}
3951

4052
# checks
4153
if [[ $? -ne 0 ]]; then echo "configuration failed:"; cat config.log; echo ""; echo "exiting..."; exit 1; fi

.github/scripts/run_install.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ fi
3838
if [[ $? -ne 0 ]]; then exit 1; fi
3939
echo
4040

41+
# python3 pip upgrade might complain: "ERROR: launchpadlib 1.10.13 requires testresources"
42+
sudo apt-get install -yq --no-install-recommends python3-testresources
43+
# checks exit code
44+
if [[ $? -ne 0 ]]; then exit 1; fi
45+
echo
46+
4147
# python script needs numpy
4248
#sudo apt-get install -qq python-numpy # not working, likely installed on older python version
4349
pip install --user --upgrade pip setuptools wheel
@@ -68,6 +74,39 @@ echo "mpif90 --version"
6874
mpif90 --version
6975
echo
7076

77+
## ADIOS2
78+
if [ "${ADIOS2}" == "true" ]; then
79+
echo
80+
echo "ADIOS2 installation:"
81+
echo
82+
# installs cmake wget
83+
sudo apt-get install -yq --no-install-recommends cmake wget
84+
# checks exit code
85+
if [[ $? -ne 0 ]]; then exit 1; fi
86+
# uses /opt as installation directory
87+
mkdir -p /opt; cd /opt
88+
# download source
89+
wget https://github.com/ornladios/ADIOS2/archive/refs/tags/v2.10.1.tar.gz
90+
tar zxf v2.10.1.tar.gz
91+
cd ADIOS2-2.10.1/
92+
# build source
93+
mkdir -p build; cd build/
94+
CC=gcc CXX=g++ FC=gfortran cmake -DADIOS2_USE_Fortran=ON \
95+
-DADIOS2_USE_HDF5=OFF -DADIOS2_BUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF \
96+
-DCMAKE_INSTALL_PREFIX=/opt/ADIOS2 ../
97+
# checks exit code
98+
if [[ $? -ne 0 ]]; then exit 1; fi
99+
make -j4
100+
# checks exit code
101+
if [[ $? -ne 0 ]]; then exit 1; fi
102+
make install
103+
# checks exit code
104+
if [[ $? -ne 0 ]]; then exit 1; fi
105+
# environment for directory
106+
echo "ADIOS2_DIR=/opt/ADIOS2" >> $GITHUB_ENV
107+
echo; echo "done ADIOS2"; echo
108+
fi
109+
71110
# MPI
72111
# github actions uses for Linux virtual machines a 2-core CPU environment
73112
# see: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

.github/scripts/run_tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ if [[ "${TEST}" == *"with-hdf5"* ]]; then
117117
cp -v run_this_example_HDF5_IO_server.sh run_this_example.sh
118118
fi
119119

120+
# adios
121+
if [ "${ADIOS2}" == "true" ]; then
122+
# turns on ADIOS
123+
sed -i "s:^ADIOS_ENABLED .*:ADIOS_ENABLED = .true.:" DATA/Par_file
124+
fi
125+
120126
# default script
121127
./run_this_example.sh
122128

.github/workflows/CI.yml

Lines changed: 65 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515

1616
- name: Check for changes
1717
id: diff
@@ -86,7 +86,7 @@ jobs:
8686
needs: changesCheck
8787

8888
steps:
89-
- uses: actions/checkout@v3
89+
- uses: actions/checkout@v4
9090

9191
- name: Install dependencies
9292
run: |
@@ -104,9 +104,16 @@ jobs:
104104
echo ""
105105
## avoids sed -i '' issue on MacOS, using gnu sed to have the same sed command lines as in linux
106106
brew install gnu-sed
107-
echo "PATH=/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" >> $GITHUB_ENV
107+
echo "PATH=/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" >> $GITHUB_ENV
108108
## OpenMP
109109
echo "OMP_NUM_THREADS=2" >> $GITHUB_ENV
110+
## MPI
111+
echo
112+
echo "MPI environment:"
113+
echo "mpif90 on path: $(which mpif90)"
114+
echo
115+
# add OpenMPI path to have ./configure detect mpi.h
116+
echo "MPI_INC=/opt/homebrew/include" >> $GITHUB_ENV
110117
## avoids MPI issue with number of slots
111118
echo "OMPI_MCA_rmaps_base_oversubscribe=1" >> $GITHUB_ENV
112119
echo "OMPI_MCA_rmaps_base_inherit=1" >> $GITHUB_ENV
@@ -121,7 +128,8 @@ jobs:
121128
122129
- name: configure
123130
run: |
124-
./configure
131+
./configure ; if [[ $? -ne 0 ]]; then cat config.log; exit 1; fi
132+
# changes SCOTCH Makefile for macOS
125133
echo "modifying external_libs/scotch/src/Makefile.inc"
126134
cp -v external_libs/scotch/src/Make.inc/Makefile.inc.i686_mac_darwin8 external_libs/scotch/src/Makefile.inc
127135
@@ -139,10 +147,10 @@ jobs:
139147

140148
strategy:
141149
matrix:
142-
os: [ubuntu-latest,ubuntu-20.04]
150+
os: [ubuntu-latest,ubuntu-22.04]
143151

144152
steps:
145-
- uses: actions/checkout@v3
153+
- uses: actions/checkout@v4
146154

147155
- name: Install packages
148156
run: ./.github/scripts/run_install.sh
@@ -156,16 +164,16 @@ jobs:
156164

157165

158166
linuxCheck-Intel:
159-
name: Test Intel on ubuntu-20.04
160-
runs-on: ubuntu-20.04
167+
name: Test Intel on ubuntu-22.04
168+
runs-on: ubuntu-22.04
161169
needs: changesCheck
162170

163171
steps:
164-
- uses: actions/checkout@v3
172+
- uses: actions/checkout@v4
165173

166174
- name: Cache Intel oneapi packages
167175
id: cache-intel-oneapi
168-
uses: actions/cache@v3
176+
uses: actions/cache@v4
169177
with:
170178
path: /opt/intel/oneapi
171179
key: install-${{ runner.os }}-all
@@ -296,7 +304,7 @@ jobs:
296304
needs: [linuxCheck]
297305

298306
steps:
299-
- uses: actions/checkout@v3
307+
- uses: actions/checkout@v4
300308

301309
- name: Install packages
302310
run: ./.github/scripts/run_install.sh
@@ -315,7 +323,7 @@ jobs:
315323
needs: [linuxCheck]
316324

317325
steps:
318-
- uses: actions/checkout@v3
326+
- uses: actions/checkout@v4
319327

320328
- name: Install packages
321329
run: ./.github/scripts/run_install.sh
@@ -339,7 +347,7 @@ jobs:
339347
needs: [linuxCheck]
340348

341349
steps:
342-
- uses: actions/checkout@v3
350+
- uses: actions/checkout@v4
343351

344352
- name: Install packages
345353
run: ./.github/scripts/run_install.sh
@@ -363,7 +371,7 @@ jobs:
363371
needs: [linuxCheck]
364372

365373
steps:
366-
- uses: actions/checkout@v3
374+
- uses: actions/checkout@v4
367375

368376
- name: Install packages
369377
run: ./.github/scripts/run_install.sh
@@ -388,7 +396,7 @@ jobs:
388396
needs: [linuxCheck]
389397

390398
steps:
391-
- uses: actions/checkout@v3
399+
- uses: actions/checkout@v4
392400

393401
- name: Install packages
394402
run: ./.github/scripts/run_install.sh
@@ -412,7 +420,7 @@ jobs:
412420
needs: [linuxCheck]
413421

414422
steps:
415-
- uses: actions/checkout@v3
423+
- uses: actions/checkout@v4
416424

417425
- name: Install packages
418426
run: ./.github/scripts/run_install.sh
@@ -437,7 +445,7 @@ jobs:
437445
needs: [linuxCheck]
438446

439447
steps:
440-
- uses: actions/checkout@v3
448+
- uses: actions/checkout@v4
441449

442450
- name: Install packages
443451
run: ./.github/scripts/run_install.sh
@@ -462,7 +470,7 @@ jobs:
462470
needs: [linuxCheck]
463471

464472
steps:
465-
- uses: actions/checkout@v3
473+
- uses: actions/checkout@v4
466474

467475
- name: Install packages
468476
run: ./.github/scripts/run_install.sh
@@ -488,7 +496,7 @@ jobs:
488496
needs: [linuxCheck]
489497

490498
steps:
491-
- uses: actions/checkout@v3
499+
- uses: actions/checkout@v4
492500

493501
- name: Install packages
494502
run: ./.github/scripts/run_install.sh
@@ -513,7 +521,7 @@ jobs:
513521
needs: [linuxCheck]
514522

515523
steps:
516-
- uses: actions/checkout@v3
524+
- uses: actions/checkout@v4
517525

518526
- name: Install packages
519527
run: ./.github/scripts/run_install.sh
@@ -537,7 +545,7 @@ jobs:
537545
needs: [linuxCheck]
538546

539547
steps:
540-
- uses: actions/checkout@v3
548+
- uses: actions/checkout@v4
541549

542550
- name: Install packages
543551
run: ./.github/scripts/run_install.sh
@@ -561,7 +569,7 @@ jobs:
561569
needs: [linuxCheck]
562570

563571
steps:
564-
- uses: actions/checkout@v3
572+
- uses: actions/checkout@v4
565573

566574
- name: Install packages
567575
run: ./.github/scripts/run_install.sh
@@ -585,7 +593,7 @@ jobs:
585593
needs: [linuxCheck]
586594

587595
steps:
588-
- uses: actions/checkout@v3
596+
- uses: actions/checkout@v4
589597

590598
- name: Install packages
591599
run: ./.github/scripts/run_install.sh
@@ -609,7 +617,7 @@ jobs:
609617
needs: [linuxCheck]
610618

611619
steps:
612-
- uses: actions/checkout@v3
620+
- uses: actions/checkout@v4
613621

614622
- name: Install packages
615623
run: ./.github/scripts/run_install.sh
@@ -633,7 +641,7 @@ jobs:
633641
needs: [linuxCheck]
634642

635643
steps:
636-
- uses: actions/checkout@v3
644+
- uses: actions/checkout@v4
637645

638646
- name: Install packages
639647
run: ./.github/scripts/run_install.sh
@@ -657,7 +665,7 @@ jobs:
657665
needs: [linuxCheck]
658666

659667
steps:
660-
- uses: actions/checkout@v3
668+
- uses: actions/checkout@v4
661669

662670
- name: Install packages
663671
run: ./.github/scripts/run_install.sh
@@ -681,7 +689,7 @@ jobs:
681689
needs: [linuxCheck]
682690

683691
steps:
684-
- uses: actions/checkout@v3
692+
- uses: actions/checkout@v4
685693

686694
- name: Install packages
687695
run: ./.github/scripts/run_install.sh
@@ -705,7 +713,7 @@ jobs:
705713
needs: [linuxCheck]
706714

707715
steps:
708-
- uses: actions/checkout@v3
716+
- uses: actions/checkout@v4
709717

710718
- name: Install packages
711719
run: ./.github/scripts/run_install.sh
@@ -729,7 +737,7 @@ jobs:
729737
needs: [linuxCheck]
730738

731739
steps:
732-
- uses: actions/checkout@v3
740+
- uses: actions/checkout@v4
733741

734742
- name: Install packages
735743
env:
@@ -751,3 +759,31 @@ jobs:
751759
run: ./.github/scripts/run_tests.sh
752760
shell: bash
753761

762+
linuxTest_19:
763+
name: Test run example 19 - meshfem3D simple model w/ ADIOS2
764+
runs-on: ubuntu-latest
765+
needs: [linuxCheck]
766+
767+
steps:
768+
- uses: actions/checkout@v4
769+
770+
- name: Install packages
771+
env:
772+
ADIOS2: true
773+
run: ./.github/scripts/run_install.sh
774+
shell: bash
775+
776+
- name: Run build
777+
env:
778+
TESTFLAGS: --with-mpi --enable-vectorization
779+
ADIOS2: true
780+
run: ./.github/scripts/run_build.sh
781+
shell: bash
782+
783+
- name: Run test
784+
env:
785+
TESTDIR: EXAMPLES/applications/meshfem3D_examples/simple_model/
786+
ADIOS2: true
787+
run: ./.github/scripts/run_tests.sh
788+
shell: bash
789+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ src/generate_databases/*.mod
2424
src/meshfem3D/*.mod
2525
src/specfem3D/*.mod
2626
*__genmod.f90
27+
my_mpi.mod
2728

2829
# documentation
2930
manual_SPECFEM3D_Cartesian.aux

0 commit comments

Comments
 (0)