Skip to content

Commit

Permalink
updates EXAMPLES/ and utils/ folder with new sections; adapts travis/…
Browse files Browse the repository at this point in the history
…azure/github actions scripts
  • Loading branch information
danielpeter committed Nov 15, 2023
1 parent 2afc818 commit cf65997
Show file tree
Hide file tree
Showing 2,526 changed files with 1,454 additions and 1,406 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,6 @@ jobs:
BUILD: true
- template: .azure-pipelines/test-template.yml
parameters:
workingDirectory: EXAMPLES/meshfem3D_examples/simple_model
workingDirectory: EXAMPLES/applications/meshfem3D_examples/simple_model


2 changes: 1 addition & 1 deletion .azure-pipelines/test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ steps:
echo "workdir: $WORKDIR"
echo "current dir: `pwd`"
echo
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
2 changes: 1 addition & 1 deletion .docker/Dockerfile.alpine_minimal
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ RUN ./configure CC=${CC} FC=${FC} MPIFC=${MPIFC} FLAGS_CHECK="${FLAGS}" --with-m
RUN rm -rf .git \
&& rm -rf external_libs/ doc/ lib/ m4/ obj/ \
&& rm -rf src/inverse_problem_for_source/ \
&& rm -rf utils/ADJOINT_TOMOGRAPHY_TOOLS/ utils/dynamic_rupture/ utils/unused_routines/ utils/Visualization/ \
&& rm -rf utils/ADJOINT_TOMOGRAPHY_TOOLS/ utils/dynamic_rupture/ utils/infos/ utils/Visualization/ \
&& find ./EXAMPLES -mindepth 1 -maxdepth 1 -type d -not -name "homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides" | xargs rm -rf

#########################################################
Expand Down
24 changes: 12 additions & 12 deletions .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 All @@ -41,24 +41,24 @@ sed -i "s:^NTSTEP_BETWEEN_OUTPUT_INFO .*:NTSTEP_BETWEEN_OUTPUT_INFO = 50:" DA

# limit time steps for specific examples
# simple mesh example
if [ "$TESTDIR" == "EXAMPLES/meshfem3D_examples/simple_model/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/meshfem3D_examples/simple_model/" ]; then
sed -i "s:^NSTEP .*:NSTEP = 800:" DATA/Par_file
fi
# tpv5 example
if [ "$TESTDIR" == "EXAMPLES/fault_examples/tpv5/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/fault_examples/tpv5/" ]; then
sed -i "s:^NSTEP .*:NSTEP = 1500:" DATA/Par_file
fi
# layered halfspace example
if [ "$TESTDIR" == "EXAMPLES/layered_halfspace/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/layered_halfspace/" ]; then
sed -i "s:^NSTEP .*:NSTEP = 200:" DATA/Par_file
fi
# small adjoint example
if [ "$TESTDIR" == "EXAMPLES/small_adjoint_multiple_sources/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/small_adjoint_multiple_sources/" ]; then
# full length
sed -i "s:^NSTEP .*:NSTEP = 1000:" DATA/Par_file
fi
# socal examples
if [ "$TESTDIR" == "EXAMPLES/meshfem3D_examples/socal1D/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/meshfem3D_examples/socal1D/" ]; then
# full length
sed -i "s:^NSTEP .*:NSTEP = 840:" DATA/Par_file
# model setup
Expand All @@ -80,27 +80,27 @@ if [ "$TESTDIR" == "EXAMPLES/meshfem3D_examples/socal1D/" ]; then
fi
fi
# coupling FK
if [ "$TESTDIR" == "EXAMPLES/small_example_coupling_FK_specfem/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/small_example_coupling_FK_specfem/" ]; then
sed -i "s:^NSTEP .*:NSTEP = 1000:" DATA/Par_file
fi
# elastic halfspace, no absorbing
if [ "$TESTDIR" == "EXAMPLES/homogeneous_halfspace_HEX8_elastic_no_absorbing/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/homogeneous_halfspace_HEX8_elastic_no_absorbing/" ]; then
sed -i "s:^NSTEP .*:NSTEP = 600:" DATA/Par_file
fi
# waterlayered_halfspace example
if [ "$TESTDIR" == "EXAMPLES/waterlayered_halfspace/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/waterlayered_halfspace/" ]; then
sed -i "s:^NSTEP .*:NSTEP = 600:" DATA/Par_file
fi
# tomographic model
if [ "$TESTDIR" == "EXAMPLES/tomographic_model/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/tomographic_model/" ]; then
sed -i "s:^NSTEP .*:NSTEP = 500:" DATA/Par_file
fi
# cavity example
if [ "$TESTDIR" == "EXAMPLES/meshfem3D_examples/cavity/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/meshfem3D_examples/cavity/" ]; then
sed -i "s:^NSTEP .*:NSTEP = 2000:" DATA/Par_file
fi
# SEP example
if [ "$TESTDIR" == "EXAMPLES/meshfem3D_examples/sep_bathymetry/" ]; then
if [ "$TESTDIR" == "EXAMPLES/applications/meshfem3D_examples/sep_bathymetry/" ]; then
sed -i "s:^NSTEP .*:NSTEP = 1000:" DATA/Par_file
fi

Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ jobs:

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

Expand All @@ -312,7 +312,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/fault_examples/tpv5/
TESTDIR: EXAMPLES/applications/fault_examples/tpv5/
run: ./.github/scripts/run_tests.sh
shell: bash

Expand All @@ -337,7 +337,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/layered_halfspace/
TESTDIR: EXAMPLES/applications/layered_halfspace/
run: ./.github/scripts/run_tests.sh
shell: bash

Expand All @@ -361,7 +361,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/small_adjoint_multiple_sources/
TESTDIR: EXAMPLES/applications/small_adjoint_multiple_sources/
run: ./.github/scripts/run_tests.sh
shell: bash

Expand All @@ -385,7 +385,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/meshfem3D_examples/socal1D/
TESTDIR: EXAMPLES/applications/meshfem3D_examples/socal1D/
TESTID: 0
run: ./.github/scripts/run_tests.sh
shell: bash
Expand All @@ -410,7 +410,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/meshfem3D_examples/socal1D/
TESTDIR: EXAMPLES/applications/meshfem3D_examples/socal1D/
TESTID: 1
run: ./.github/scripts/run_tests.sh
shell: bash
Expand All @@ -435,7 +435,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/meshfem3D_examples/socal1D/
TESTDIR: EXAMPLES/applications/meshfem3D_examples/socal1D/
TESTID: 2
run: ./.github/scripts/run_tests.sh
shell: bash
Expand All @@ -461,7 +461,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/meshfem3D_examples/socal1D/
TESTDIR: EXAMPLES/applications/meshfem3D_examples/socal1D/
TESTID: 3
run: ./.github/scripts/run_tests.sh
shell: bash
Expand All @@ -486,7 +486,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/small_example_coupling_FK_specfem/
TESTDIR: EXAMPLES/applications/small_example_coupling_FK_specfem/
run: ./.github/scripts/run_tests.sh
shell: bash

Expand All @@ -510,7 +510,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/homogeneous_halfspace_HEX8_elastic_no_absorbing/
TESTDIR: EXAMPLES/applications/homogeneous_halfspace_HEX8_elastic_no_absorbing/
run: ./.github/scripts/run_tests.sh
shell: bash

Expand All @@ -534,7 +534,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/homogeneous_poroelastic/
TESTDIR: EXAMPLES/applications/homogeneous_poroelastic/
run: ./.github/scripts/run_tests.sh
shell: bash

Expand All @@ -558,7 +558,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/CPML_examples/homogeneous_halfspace_HEX8_elastic_absorbing_CPML_5sides/
TESTDIR: EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_elastic_absorbing_CPML_5sides/
run: ./.github/scripts/run_tests.sh
shell: bash

Expand All @@ -582,7 +582,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/CPML_examples/homogeneous_halfspace_HEX8_acoustic_absorbing_CPML_5sides/
TESTDIR: EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_absorbing_CPML_5sides/
run: ./.github/scripts/run_tests.sh
shell: bash

Expand All @@ -606,7 +606,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/waterlayered_halfspace/
TESTDIR: EXAMPLES/applications/waterlayered_halfspace/
run: ./.github/scripts/run_tests.sh
shell: bash

Expand All @@ -630,7 +630,7 @@ jobs:

- name: Run test
env:
TESTDIR: EXAMPLES/tomographic_model/
TESTDIR: EXAMPLES/applications/tomographic_model/
run: ./.github/scripts/run_tests.sh
shell: bash

Expand All @@ -654,7 +654,7 @@ jobs:

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

Expand All @@ -678,7 +678,7 @@ jobs:

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

Expand Down
Loading

0 comments on commit cf65997

Please sign in to comment.