forked from libprima/prima
-
Notifications
You must be signed in to change notification settings - Fork 0
190 lines (162 loc) · 6.84 KB
/
stress_test_fortran.yml
File metadata and controls
190 lines (162 loc) · 6.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Stress test on large problems, Fortran
on:
# Trigger the workflow on push or pull request
#push:
#pull_request: # DANGEROUS! MUST be disabled for self-hosted runners!
# Trigger the workflow by cron. The default time zone of GitHub Actions is UTC.
schedule:
- cron: '0 18 2-31/2 * *'
# Trigger the workflow manually
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
# Show the git ref in the workflow name if it is invoked manually.
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0}', inputs.git-ref) || '' }}
jobs:
test:
name: Stress test of PRIMA on large problems
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-15-intel]
compiler: [g, v, s, f, x, d, m, r]
solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa]
testdim: [large]
exclude:
- compiler: s # BOBYQA fails stest for unknown reason
solver: bobyqa
# Do not test r (ATfL) on ubuntu-latest, as it is available only on ubuntu arm.
- os: ubuntu-latest
compiler: r
# Test only g, v, f, r on ubuntu arm, as other compilers are not available
- os: ubuntu-24.04-arm
compiler: s
- os: ubuntu-24.04-arm
compiler: x
- os: ubuntu-24.04-arm
compiler: d
- os: ubuntu-24.04-arm
compiler: m
# Test only g and f on macOS, as other compilers are not available
- os: macos-latest
compiler: v
- os: macos-latest
compiler: s
- os: macos-latest
compiler: x
- os: macos-latest
compiler: d
- os: macos-latest
compiler: m
- os: macos-latest
compiler: r
- os: macos-15-intel
compiler: v
- os: macos-15-intel
compiler: s
- os: macos-15-intel
compiler: x
- os: macos-15-intel
compiler: d
- os: macos-15-intel
compiler: m
- os: macos-15-intel
compiler: r
steps:
- name: Run `sudo apt update`
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt update || true # Otherwise, free-disk-space or other actions relying on `apt` may fail
- name: Free disk space
if: startsWith(matrix.os, 'ubuntu')
uses: jlumbroso/free-disk-space@main
with:
# all of these default to true, but feel free to set to "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: false # Important, or the runner may be shut down due to memory starvation.
- name: Clone Repository (Latest)
uses: actions/checkout@v6.0.2
if: github.event.inputs.git-ref == ''
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS
submodules: recursive
- name: Clone Repository (Custom Ref)
uses: actions/checkout@v6.0.2
if: github.event.inputs.git-ref != ''
with:
ref: ${{ github.event.inputs.git-ref }}
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS
submodules: recursive
- name: Miscellaneous setup
run: bash .github/scripts/misc_setup
- name: Install AOCC
if: ${{ matrix.compiler == 'd' }}
run: bash .github/scripts/install_aocc
- name: Install AOMP
if: ${{ matrix.compiler == 'm' }}
# Retry in case of failure due to transient network issues. If the installation still fails
# after all retries, we let it fail silently and continue with the test. This is fine since
# there are many tests with other compilers, and since the AOMP compiler is tested in
# test_aflang.html. If we try too many times, there may not be enough time left for the test
# to run anyway!
run: bash .github/scripts/install_aomp 3 1800 || true
- name: Install Arm Toolchain for Linux
if: ${{ matrix.compiler == 'r' }}
run: bash .github/scripts/install_atfl
- name: Install gfortran
if: ${{ matrix.compiler == 'g' }}
uses: fortran-lang/setup-fortran@main
id: setup-fortran
with:
compiler: gcc
- name: Install Intel oneAPI on Linux
if: ${{ startsWith(matrix.os, 'ubuntu') && (matrix.compiler == 'i' || matrix.compiler == 'x') }}
run: bash .github/scripts/install_oneapi_linux.sh
- name: Install Intel oneAPI on macOS
if: ${{ startsWith(matrix.os, 'macos') && (matrix.compiler == 'i' || matrix.compiler == 'x') }}
run: bash .github/scripts/install_oneapi_macos.sh
- name: Install nvfortran
if: ${{ matrix.compiler == 'v' }}
run: bash .github/scripts/install_nvfortran
- name: Install Oracle sunf95
if: ${{ matrix.compiler == 's' }}
run: bash .github/scripts/install_sunf95
# Install Flang after AOCC, to make sure that flang is this one, while AOCC flang will be
# known as aoccflang.
- name: Install Flang
if: ${{ matrix.compiler == 'f' }}
run: bash .github/scripts/install_llvm
- name: Conduct the test; treat timeout as SUCCESS (exit 0)
uses: equipez/run-bash-command@v2
with:
timelimit: 320m
command: |
cd "$ROOT_DIR"/fortran/tests
export TESTDIM=${{ matrix.testdim }}
RK=$((2**($(date +%-d) % 3 + 2)))
if [[ $RK==16 && dfrv == *${{ matrix.compiler }}* ]] ; then
echo "r16 test is skipped for compiler " ${{ matrix.compiler }}
echo "Test r8 instead"
RK=8
fi
echo "RK = " $RK
if [[ ${{ matrix.compiler }} == m ]] && ! type amdflang ; then
echo "WARNING!!! amdflang does not work after AOMP installation, which probably failed!!!" 2>&1
echo "WARNING!!! mtest is skipped because amdflang is not available!!!" 2>& 1
fi
make ${{ matrix.compiler }}test_i2_r${RK}_d1_tst.${{ matrix.solver }}
- name: Store artifacts
uses: actions/upload-artifact@v7
if: always() # Always run even if the workflow is canceled manually or due to overtime.
with:
name: ${{ matrix.os }}-${{ matrix.solver }}-${{ matrix.compiler }}-${{ matrix.testdim }}
path: ${{ env.TEST_DIR }}/prima/fortran/tests/test.${{ matrix.solver }}/log/*.log
- name: Remove the test data
if: always() # Always run even if the workflow is canceled manually or due to overtime.
run: rm -rf ${{ env.TEST_DIR }}