Skip to content

Commit 848ee8d

Browse files
committed
updates kernel testing
1 parent a4cd1c7 commit 848ee8d

File tree

3 files changed

+65
-20
lines changed

3 files changed

+65
-20
lines changed

.github/scripts/run_build.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ else
6060
hip=()
6161
fi
6262

63+
## special testflags
64+
if [ "${TESTFLAGS}" == "check-mcmodel-medium" ]; then
65+
# note: this is a work-around as using the 'env:' parameter in the workflow 'CI.yml' with TESTFLAGS: FLAGS_CHECK=".."
66+
# won't work as the FLAGS_CHECK string will then get split up and ./configure .. complains about unknown parameters.
67+
# here, we re-define TESTFLAGS with a single quote around FLAGS_CHECK=".." to avoid the splitting.
68+
# use FLAGS_CHECK
69+
flags=(FLAGS_CHECK="-O3 -mcmodel=medium -std=f2008 -Wall -Wno-do-subscript -Wno-conversion -Wno-maybe-uninitialized")
70+
TESTFLAGS="" # reset
71+
else
72+
flags=()
73+
fi
74+
6375
# configuration
6476
echo
6577
echo "configuration:"
@@ -72,6 +84,7 @@ set -- ${TESTFLAGS}
7284
"${adios[@]}" \
7385
"${hdf[@]}" \
7486
"${hip[@]}" \
87+
"${flags[@]}" \
7588
FC=gfortran MPIFC=mpif90 CC=gcc "$@"
7689

7790
# checks

.github/scripts/run_tests.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ echo
2222

2323
# bash function for checking seismogram output with reference solutions
2424
my_test(){
25-
echo "**********************************************************";echo "**********************************************************"
25+
echo "######################################################################################################################"
2626
echo "testing seismograms"
2727
ln -s $WORKDIR/utils/scripts/compare_seismogram_correlations.py
2828
./compare_seismogram_correlations.py REF_SEIS/ OUTPUT_FILES/
2929
if [[ $? -ne 0 ]]; then exit 1; fi
3030
./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;}}'
3131
if [[ $? -ne 0 ]]; then exit 1; fi
32-
echo "**********************************************************";echo "**********************************************************"
32+
echo "######################################################################################################################"
3333
}
3434

3535
my_kernel_test(){
3636
# kernel value test - checks rho/kappa/mu kernel value outputs
37-
echo "**********************************************************";echo "**********************************************************"
37+
echo "######################################################################################################################"
3838
echo "testing kernel values"
3939
file_ref=REF_KERNEL/output_solver.txt
4040
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(){
8282
else
8383
echo "testing kernel values: all good"
8484
fi
85-
echo "**********************************************************";echo "**********************************************************"
85+
echo "######################################################################################################################"
8686
}
8787

8888
# test example

.github/workflows/CI.yml

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,31 @@ jobs:
414414
run: ./.github/scripts/run_tests.sh
415415
shell: bash
416416

417-
linuxTest_5:
418-
name: Test 5 - kernel HIP GPU homogeneous acoustic
417+
linuxTest_5a:
418+
name: Test 5a - kernel homogeneous acoustic
419+
runs-on: ubuntu-latest
420+
needs: [linuxCheck]
421+
422+
steps:
423+
- uses: actions/checkout@v4
424+
425+
- name: Install packages
426+
run: ./.github/scripts/run_install.sh
427+
shell: bash
428+
429+
- name: Run build
430+
run: ./.github/scripts/run_build.sh
431+
shell: bash
432+
433+
- name: Run test kernel
434+
env:
435+
TESTDIR: EXAMPLES/applications/homogeneous_acoustic/
436+
RUN_KERNEL: true
437+
run: ./.github/scripts/run_tests.sh
438+
shell: bash
439+
440+
linuxTest_5b:
441+
name: Test 5b - kernel homogeneous acoustic GPU HIP
419442
runs-on: ubuntu-latest
420443
needs: [linuxCheck]
421444

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

439-
- name: Run test kernel
462+
- name: Run test kernel w/ GPU
440463
env:
441464
TESTDIR: EXAMPLES/applications/homogeneous_acoustic/
442465
RUN_KERNEL: true
466+
GPU: true
443467
run: ./.github/scripts/run_tests.sh
444468
shell: bash
445469

446-
- name: Run test kernel w/ GPU
470+
linuxTest_6a:
471+
name: Test 6a - kernel homogeneous halfspace
472+
runs-on: ubuntu-latest
473+
needs: [linuxCheck]
474+
475+
steps:
476+
- uses: actions/checkout@v4
477+
478+
- name: Install packages
479+
run: ./.github/scripts/run_install.sh
480+
shell: bash
481+
482+
- name: Run build
483+
run: ./.github/scripts/run_build.sh
484+
shell: bash
485+
486+
- name: Run test kernel
447487
env:
448-
TESTDIR: EXAMPLES/applications/homogeneous_acoustic/
488+
TESTDIR: EXAMPLES/applications/homogeneous_halfspace/
449489
RUN_KERNEL: true
450-
GPU: true
451490
run: ./.github/scripts/run_tests.sh
452491
shell: bash
453492

454-
linuxTest_6:
455-
name: Test 6 - kernel HIP GPU homogeneous halfspace
493+
linuxTest_6b:
494+
name: Test 6b - kernel homogeneous halfspace GPU HIP
456495
runs-on: ubuntu-latest
457496
needs: [linuxCheck]
458497

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

476-
- name: Run test kernel
477-
env:
478-
TESTDIR: EXAMPLES/applications/homogeneous_halfspace/
479-
RUN_KERNEL: true
480-
run: ./.github/scripts/run_tests.sh
481-
shell: bash
482-
483515
- name: Run test kernel w/ GPU
484516
env:
485517
TESTDIR: EXAMPLES/applications/homogeneous_halfspace/
@@ -626,7 +658,7 @@ jobs:
626658

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

0 commit comments

Comments
 (0)