Skip to content

Commit fd8e489

Browse files
committed
new technique
1 parent 740b086 commit fd8e489

File tree

1 file changed

+52
-49
lines changed

1 file changed

+52
-49
lines changed

.github/workflows/CI.yml

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,25 @@ jobs:
2121
os: ["macos-latest", "ubuntu-latest"]
2222
compiler: ["gfortran", "lfortran"]
2323
mpi: ["openmpi", "mpich"]
24-
test_type: ["standalone", "standalone_no_wrappers", "pot3d"]
25-
exclude:
26-
# Only run standalone_no_wrappers for gfortran
27-
- compiler: "lfortran"
28-
test_type: "standalone_no_wrappers"
24+
test_type: ["standalone", "pot3d"]
25+
include:
26+
# Add standalone-no-wrappers tests only for GFortran
27+
- os: "macos-latest"
28+
compiler: "gfortran"
29+
mpi: "openmpi"
30+
test_type: "standalone-no-wrappers"
31+
- os: "macos-latest"
32+
compiler: "gfortran"
33+
mpi: "mpich"
34+
test_type: "standalone-no-wrappers"
35+
- os: "ubuntu-latest"
36+
compiler: "gfortran"
37+
mpi: "openmpi"
38+
test_type: "standalone-no-wrappers"
39+
- os: "ubuntu-latest"
40+
compiler: "gfortran"
41+
mpi: "mpich"
42+
test_type: "standalone-no-wrappers"
2943
steps:
3044
- uses: actions/checkout@v4
3145

@@ -35,68 +49,57 @@ jobs:
3549
micromamba-version: '2.0.4-0'
3650
environment-file: ci/environment_${{ matrix.compiler }}_${{ matrix.mpi }}.yml
3751

38-
# Standalone tests without custom MPI wrappers
3952
- name: Run standalone tests without MPI wrappers
40-
if: matrix.test_type == 'standalone_no_wrappers'
53+
if: matrix.test_type == 'standalone-no-wrappers'
4154
shell: bash -e -x -l {0}
4255
run: |
4356
cd tests
4457
./run_tests.sh --without-wrappers
4558
46-
# Standalone tests with compiler and optimization variations
47-
- name: Run standalone tests with ${{ matrix.compiler }}
59+
- name: Run standalone tests with optimization variations
4860
if: matrix.test_type == 'standalone'
4961
shell: bash -e -x -l {0}
5062
run: |
5163
cd tests
52-
53-
# Set compiler-specific flags
5464
if [[ "${{ matrix.compiler }}" == "gfortran" ]]; then
55-
BASE_FLAGS="-cpp"
56-
OPT_FLAGS="-O3 -march=native -cpp"
57-
else
58-
BASE_FLAGS="--cpp"
59-
OPT_FLAGS="--fast --cpp"
65+
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
66+
FC="gfortran -cpp -DOPEN_MPI=yes" ./run_tests.sh
67+
FC="gfortran -O3 -march=native -cpp -DOPEN_MPI=yes" ./run_tests.sh
68+
else
69+
FC="gfortran -cpp" ./run_tests.sh
70+
FC="gfortran -O3 -march=native -cpp" ./run_tests.sh
71+
fi
72+
else # lfortran
73+
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
74+
FC="lfortran --cpp -DOPEN_MPI=yes" ./run_tests.sh
75+
FC="lfortran --fast --cpp -DOPEN_MPI=yes" ./run_tests.sh
76+
else
77+
FC="lfortran --cpp" ./run_tests.sh
78+
FC="lfortran --fast --cpp" ./run_tests.sh
79+
fi
6080
fi
61-
62-
# Add MPI-specific flags for OpenMPI
63-
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
64-
BASE_FLAGS="$BASE_FLAGS -DOPEN_MPI=yes"
65-
OPT_FLAGS="$OPT_FLAGS -DOPEN_MPI=yes"
66-
fi
67-
68-
# Run tests without optimization
69-
FC="${{ matrix.compiler }} $BASE_FLAGS" ./run_tests.sh
70-
71-
# Run tests with optimization
72-
FC="${{ matrix.compiler }} $OPT_FLAGS" ./run_tests.sh
7381
74-
# POT3D tests
75-
- name: Build and validate POT3D with ${{ matrix.compiler }}
82+
- name: Build and validate POT3D
7683
if: matrix.test_type == 'pot3d'
7784
shell: bash -e -x -l {0}
7885
run: |
7986
cd tests/pot3d
80-
81-
# Set compiler-specific build script
8287
if [[ "${{ matrix.compiler }}" == "gfortran" ]]; then
8388
BUILD_SCRIPT="./build_and_run_gfortran.sh"
84-
BASE_FLAGS="-cpp"
85-
OPT_FLAGS="-O3 -march=native -cpp"
86-
else
89+
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
90+
FC="gfortran -O3 -march=native -cpp -DOPEN_MPI=yes" $BUILD_SCRIPT
91+
FC="gfortran -cpp -DOPEN_MPI=yes" $BUILD_SCRIPT
92+
else
93+
FC="gfortran -O3 -march=native -cpp" $BUILD_SCRIPT
94+
FC="gfortran -cpp" $BUILD_SCRIPT
95+
fi
96+
else # lfortran
8797
BUILD_SCRIPT="./build_and_run_lfortran.sh"
88-
BASE_FLAGS="--cpp"
89-
OPT_FLAGS="--fast --cpp"
90-
fi
91-
92-
# Add MPI-specific flags for OpenMPI
93-
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
94-
BASE_FLAGS="$BASE_FLAGS -DOPEN_MPI=yes"
95-
OPT_FLAGS="$OPT_FLAGS -DOPEN_MPI=yes"
98+
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
99+
FC="lfortran --fast --cpp -DOPEN_MPI=yes" $BUILD_SCRIPT
100+
FC="lfortran --cpp -DOPEN_MPI=yes" $BUILD_SCRIPT
101+
else
102+
FC="lfortran --fast --cpp" $BUILD_SCRIPT
103+
FC="lfortran --cpp" $BUILD_SCRIPT
104+
fi
96105
fi
97-
98-
# Build and validate without optimization
99-
FC="${{ matrix.compiler }} $BASE_FLAGS" $BUILD_SCRIPT
100-
101-
# Build and validate with optimization
102-
FC="${{ matrix.compiler }} $OPT_FLAGS" $BUILD_SCRIPT

0 commit comments

Comments
 (0)