Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates kernel testing
Browse files Browse the repository at this point in the history
danielpeter committed Nov 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent a4cd1c7 commit a006171
Showing 3 changed files with 61 additions and 20 deletions.
9 changes: 9 additions & 0 deletions .github/scripts/run_build.sh
Original file line number Diff line number Diff line change
@@ -60,6 +60,15 @@ else
hip=()
fi

## special testflags
if [ "${TESTFLAGS}" == "check-mcmodel-medium" ]; then
# note: this is a work-around as using the 'env:' parameter in the workflow 'CI.yml' with TESTFLAGS: FLAGS_CHECK=".."
# won't work as the FLAGS_CHECK string will then get split up and ./configure .. complains about unknown parameters.
# here, we re-define TESTFLAGS with a single quote around FLAGS_CHECK=".." to avoid the splitting.
# use FLAGS_CHECK
TESTFLAGS='FLAGS_CHECK="-O3 -mcmodel=medium -std=f2008 -Wall -Wno-do-subscript -Wno-conversion -Wno-maybe-uninitialized"'
fi

# configuration
echo
echo "configuration:"
8 changes: 4 additions & 4 deletions .github/scripts/run_tests.sh
Original file line number Diff line number Diff line change
@@ -22,19 +22,19 @@ echo

# bash function for checking seismogram output with reference solutions
my_test(){
echo "**********************************************************";echo "**********************************************************"
echo "######################################################################################################################"
echo "testing seismograms"
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;}}'
if [[ $? -ne 0 ]]; then exit 1; fi
echo "**********************************************************";echo "**********************************************************"
echo "######################################################################################################################"
}

my_kernel_test(){
# kernel value test - checks rho/kappa/mu kernel value outputs
echo "**********************************************************";echo "**********************************************************"
echo "######################################################################################################################"
echo "testing kernel values"
file_ref=REF_KERNEL/output_solver.txt
file_out=output.log # captures the OUTPUT_FILES/output_solver.txt when running solver since IMAIN was set to standard out
@@ -82,7 +82,7 @@ my_kernel_test(){
else
echo "testing kernel values: all good"
fi
echo "**********************************************************";echo "**********************************************************"
echo "######################################################################################################################"
}

# test example
64 changes: 48 additions & 16 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -414,8 +414,31 @@ jobs:
run: ./.github/scripts/run_tests.sh
shell: bash

linuxTest_5:
name: Test 5 - kernel HIP GPU homogeneous acoustic
linuxTest_5a:
name: Test 5a - kernel homogeneous acoustic
runs-on: ubuntu-latest
needs: [linuxCheck]

steps:
- uses: actions/checkout@v4

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

- name: Run build
run: ./.github/scripts/run_build.sh
shell: bash

- name: Run test kernel
env:
TESTDIR: EXAMPLES/applications/homogeneous_acoustic/
RUN_KERNEL: true
run: ./.github/scripts/run_tests.sh
shell: bash

linuxTest_5b:
name: Test 5b - kernel homogeneous acoustic GPU HIP
runs-on: ubuntu-latest
needs: [linuxCheck]

@@ -436,23 +459,39 @@ jobs:
run: ./.github/scripts/run_build.sh
shell: bash

- name: Run test kernel
- name: Run test kernel w/ GPU
env:
TESTDIR: EXAMPLES/applications/homogeneous_acoustic/
RUN_KERNEL: true
GPU: true
run: ./.github/scripts/run_tests.sh
shell: bash

- name: Run test kernel w/ GPU
linuxTest_6a:
name: Test 6a - kernel homogeneous halfspace
runs-on: ubuntu-latest
needs: [linuxCheck]

steps:
- uses: actions/checkout@v4

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

- name: Run build
run: ./.github/scripts/run_build.sh
shell: bash

- name: Run test kernel
env:
TESTDIR: EXAMPLES/applications/homogeneous_acoustic/
TESTDIR: EXAMPLES/applications/homogeneous_halfspace/
RUN_KERNEL: true
GPU: true
run: ./.github/scripts/run_tests.sh
shell: bash

linuxTest_6:
name: Test 6 - kernel HIP GPU homogeneous halfspace
linuxTest_6b:
name: Test 6b - kernel homogeneous halfspace GPU HIP
runs-on: ubuntu-latest
needs: [linuxCheck]

@@ -473,13 +512,6 @@ jobs:
run: ./.github/scripts/run_build.sh
shell: bash

- name: Run test kernel
env:
TESTDIR: EXAMPLES/applications/homogeneous_halfspace/
RUN_KERNEL: true
run: ./.github/scripts/run_tests.sh
shell: bash

- name: Run test kernel w/ GPU
env:
TESTDIR: EXAMPLES/applications/homogeneous_halfspace/
@@ -626,7 +658,7 @@ jobs:

- name: Run build
env:
TESTFLAGS: 'FLAGS_CHECK="-O3 -mcmodel=medium -std=f2008 -Wall -Wno-do-subscript -Wno-conversion -Wno-maybe-uninitialized"'
TESTFLAGS: check-mcmodel-medium
run: ./.github/scripts/run_build.sh
shell: bash

0 comments on commit a006171

Please sign in to comment.