Repository navigation
Expand file tree
/
Copy pathfobos
More file actions
418 lines (347 loc) · 12.6 KB
/
Copy pathfobos
File metadata and controls
418 lines (347 loc) · 12.6 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
[project]
name = FUNDAL
version = VERSION
summary = Fortran UNified Device Acceleration Library
repository = https://github.com/szaghi/FUNDAL
website = https://szaghi.github.io/FUNDAL
email = stefano.zaghi@gmail.it
authors = Stefano Zaghi
# user-tunable variables (FoBiS fobos variables)
[common-variables]
# AMD GPU target architecture(s) for amdflang OpenMP offload.
# Set to match your GPU, e.g. gfx90a, gfx942, gfx1100, or a comma-separated list.
# This is the default value; it can be completely overwritten from the CLI by
# selecting one of the [varset:*] sections below, e.g.
# FoBiS.py build -mode fundal-test-omp-amd --varset gfx1100
$GPU_ARCH = gfx942
# CLI-selectable GPU architecture overrides.
# Each varset fully replaces $GPU_ARCH (last-write-wins); pick one with --varset.
[varset:gfx906]
$GPU_ARCH = gfx906
[varset:gfx908]
$GPU_ARCH = gfx908
[varset:gfx90a]
$GPU_ARCH = gfx90a
[varset:gfx940]
$GPU_ARCH = gfx940
[varset:gfx942]
$GPU_ARCH = gfx942
[varset:gfx950]
$GPU_ARCH = gfx950
[varset:gfx1030]
$GPU_ARCH = gfx1030
[varset:gfx1100]
$GPU_ARCH = gfx1100
[modes]
# the first mode is the default (`fobis build`, scripts/install.sh): a library build that any gfortran can do
modes = fundal-lib-gnu
fundal-test-nvf
fundal-test-oac-nvf
fundal-test-oac-nvf-debug
fundal-test-oac-mpi-nvf
fundal-test-oac-mpi-nvf-debug
fundal-test-gnu
fundal-test-oac-gnu
fundal-test-oac-mpi-gnu
fundal-test-amd
fundal-test-omp-amd
fundal-test-omp-mpi-amd
fundal-test-ifx
fundal-test-omp-ifx
fundal-test-omp-mpi-ifx
fundal-void-nvf
fundal-void-oac-nvf
fundal-void-gnu
fundal-void-oac-gnu
fundal-void-amd
fundal-void-omp-amd
fundal-void-ifx
fundal-void-omp-ifx
# modes to build library and tests
[fundal-lib-gnu]
help = Build the FUNDAL static library with GNU, compile-time CPU mode (default mode)
template = template-gnu
src = ./src/lib/
target = fundal.F90
mklib = static
output = libfundal.a
build_dir = ./build/fobis-lib-gnu/
[fundal-test-nvf]
help = Build FUNDAL tests with NVF
template = template-nvf
src = ./src/
exclude_dirs = ./src/tests/mpi/
[fundal-test-oac-nvf]
help = Build FUNDAL tests with OpenACC-NVF
template = template-oac-nvf
src = ./src/
exclude_dirs = ./src/tests/mpi/
[fundal-test-oac-nvf-debug]
help = Build FUNDAL tests with OpenACC-NVF in debug mode
template = template-oac-nvf-debug
src = ./src/
exclude_dirs = ./src/tests/mpi/
[fundal-test-oac-mpi-nvf]
help = Build FUNDAL tests with OpenACC-MPI-NVF
template = template-oac-nvf
mpi = True
src = ./src/
[fundal-test-oac-mpi-nvf-debug]
help = Build FUNDAL tests with OpenACC-MPI-NVF in debug mode
template = template-oac-nvf-debug
mpi = True
src = ./src/
[fundal-test-gnu]
help = Build FUNDAL tests with GNU
template = template-gnu
src = ./src/
exclude_dirs = ./src/tests/mpi/
[fundal-test-oac-gnu]
help = Build FUNDAL tests with OpenACC-GNU
template = template-oac-gnu
src = ./src/
exclude_dirs = ./src/tests/mpi/ ./src/tests/laplace/ ./src/tests/precision/
[fundal-test-oac-mpi-gnu]
help = Build FUNDAL tests with OpenACC-MPI-GNU
template = template-oac-gnu
mpi = True
src = ./src/
[fundal-test-amd]
help = Build FUNDAL tests with AMD Flang
template = template-amd
src = ./src/
exclude_dirs = ./src/tests/mpi/
[fundal-test-omp-amd]
help = Build FUNDAL tests with OpenMP-AMD Flang
template = template-omp-amd
src = ./src/
exclude_dirs = ./src/tests/mpi/
[fundal-test-omp-mpi-amd]
help = Build FUNDAL tests with OpenMP-MPI-AMD Flang
template = template-omp-amd
mpi = True
src = ./src/
[fundal-test-ifx]
help = Build FUNDAL tests with IFX
template = template-ifx
src = ./src/
exclude_dirs = ./src/tests/mpi/
[fundal-test-omp-ifx]
help = Build FUNDAL tests with OpenMP-IFX
template = template-omp-ifx
src = ./src/
exclude_dirs = ./src/tests/mpi/
[fundal-test-omp-mpi-ifx]
help = Build FUNDAL tests with OpenMP-MPI-IFX
template = template-omp-ifx
mpi = True
src = ./src/
# void modes to build a specified target/src (-t/-src must be passed by CLI)
[fundal-void-nvf]
help = Build a specified target/src with NVF (no pragmas)
template = template-nvf
[fundal-void-oac-nvf]
help = Build a specified target/src with OpenACC-NVF
template = template-oac-nvf
[fundal-void-gnu]
help = Build a specified target/src with GNU (no pragmas)
template = template-gnu
[fundal-void-oac-gnu]
help = Build a specified target/src with OpenACC-GNU
template = template-oac-gnu
[fundal-void-amd]
help = Build a specified target/src with AMD Flang (no pragmas)
template = template-amd
[fundal-void-omp-amd]
help = Build a specified target/src with OpenMP-AMD Flang
template = template-omp-amd
[fundal-void-ifx]
help = Build a specified target/src with IFX (no pragmas)
template = template-ifx
[fundal-void-omp-ifx]
help = Build a specified target/src with OpenMP-IFX
template = template-omp-ifx
# templates
[template-base]
mod_dir = ./mod/
obj_dir = ./obj/
build_dir = ./exe/
colors = True
quiet = False
log = True
jobs = 4
[template-nvf]
template = template-base
compiler = nvfortran
preproc = -DCOMPILER_NVF
cflags = -cpp -c -fast -Minfo=all
lflags = -Minfo=all
[template-oac-nvf]
template = template-base
compiler = nvfortran
preproc = -DCOMPILER_NVF -DDEV_OAC
cflags = -cpp -c -acc -gpu=cc89 -fast -Minfo=all
lflags = -acc -gpu=cc89 -fast -Minfo=all
[template-oac-nvf-debug]
template = template-oac-nvf
cflags = -cpp -c -acc -gpu=cc89 -Minfo=all -C -g
lflags = -acc -gpu=cc89 -Minfo=all -C -g
[template-gnu]
template = template-base
compiler = gnu
preproc = -DCOMPILER_GNU
cflags = -cpp -c
lflags = -cpp
[template-oac-gnu]
template = template-base
compiler = gnu
preproc = -DCOMPILER_GNU -DDEV_OAC
cflags = -cpp -c -fopenacc
lflags = -fopenacc
[template-oac-gnu-debug]
template = template-oac-gnu
cflags = -cpp -c -fopenacc -g -fcheck=all -fbacktrace
lflags = -fopenacc -g -fcheck=all -fbacktrace
[template-amd]
template = template-base
compiler = amd
cflags = -c -cpp
lflags = -cpp
openmp = True
[template-omp-amd]
# DEV_HIP enables the HIP-->Fortran interfaces (device memory status, etc.) and
# links the HIP runtime (libamdhip64). It is set ONLY for AMD builds: the same
# OpenMP-offload backend (DEV_OMP) is also used by Intel IFX, which must NOT link
# HIP libraries (they are not available outside the AMD/ROCm stack).
# NOTE: the HIP runtime is found through the shell environment (LIBRARY_PATH at
# link time, LD_LIBRARY_PATH at run time), which a sourced ROCm environment
# populates from $ROCM_PATH. FoBiS runs the compiler with shell=False and does
# not expand environment variables in flags, so no path is hardcoded here; make
# sure $ROCM_PATH (and the ROCm lib dir) are in your environment before building.
template = template-base
compiler = amd
preproc = -DDEV_OMP -DDEV_HIP
cflags = -c -cpp --offload-arch=$GPU_ARCH
lflags = -cpp --offload-arch=$GPU_ARCH -lamdhip64
openmp = True
[template-ifx]
template = template-base
compiler = intel_nextgen
cflags = -c -cpp
lflags = -cpp
openmp = True
[template-omp-ifx]
template = template-base
compiler = intel_nextgen
preproc = -DDEV_OMP
cflags = -c -cpp
lflags = -cpp
openmp = True
openmp_offload = True
# aux rules
[rule-run-tests]
help = Run all tests
rule_1 = scripts/run_tests.sh
[rule-build-run-tests-oac-nvf]
help = Build and Run all tests with OpenACC-NVF
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-test-oac-nvf
rule_3 = fobis rule --ex run-tests
[rule-build-run-tests-omp-ifx]
help = Build and Run all tests with OpenMP-IFX
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-test-omp-ifx
rule_3 = fobis rule --ex run-tests
[rule-build-run-tests-oac-gnu]
help = Build and Run all tests with OpenACC-GNU
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-test-oac-gnu
rule_3 = fobis rule --ex run-tests
[rule-build-run-tests-omp-amd]
help = Build and Run all tests with OpenMP-AMD Flang
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-test-omp-amd
rule_3 = fobis rule --ex run-tests
[rule-build-laplace-baseline-nvf]
help = Build laplace test with NVF (without pragmas)
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-nvf --target src/tests/laplace/fundal_laplace_baseline.F90 --src src/
[rule-build-laplace-oac-nvf]
help = Build laplace test with OpenACC-NVF
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-oac-nvf --target src/tests/laplace/fundal_laplace_dev_inline.F90 --src src/
rule_4 = fobis build --mode fundal-void-oac-nvf --target src/tests/laplace/fundal_laplace_dev_routine.F90 --src src/
[rule-build-laplace-baseline-ifx]
help = Build laplace test with IFX (without pragmas)
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-ifx --target src/tests/laplace/fundal_laplace_baseline.F90 --src src/
[rule-build-laplace-omp-ifx]
help = Build laplace test with OpenMP-ifx
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-omp-ifx --target src/tests/laplace/fundal_laplace_dev_inline.F90 --src src/
rule_4 = fobis build --mode fundal-void-omp-ifx --target src/tests/laplace/fundal_laplace_dev_routine.F90 --src src/
[rule-build-laplace-baseline-gnu]
help = Build laplace test with GNU (without pragmas)
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-gnu --target src/tests/laplace/fundal_laplace_baseline.F90 --src src/
[rule-build-laplace-oac-gnu]
help = Build laplace test with OpenACC-GNU
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-oac-gnu --target src/tests/laplace/fundal_laplace_dev_inline.F90 --src src/
rule_3 = fobis build --mode fundal-void-oac-gnu --target src/tests/laplace/fundal_laplace_dev_routine.F90 --src src/
[rule-build-laplace-baseline-amd]
help = Build laplace test with AMD Flang (without pragmas)
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-amd --target src/tests/laplace/fundal_laplace_baseline.F90 --src src/
[rule-build-laplace-omp-amd]
help = Build laplace test with OpenMP-AMD Flang
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-omp-amd --target src/tests/laplace/fundal_laplace_dev_inline.F90 --src src/
rule_4 = fobis build --mode fundal-void-omp-amd --target src/tests/laplace/fundal_laplace_dev_routine.F90 --src src/
[rule-build-assign-lb-oac-nvf]
help = Build assign with lower-bounds-passed test with OpenACC-NVF
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-oac-nvf --target src/tests/fundal_assign_lb_test.F90 --src src/
[rule-build-memcpy-tra-oac-nvf]
help = Build memcpy transposed test with OpenACC-NVF
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-oac-nvf --target src/tests/fundal_memcpy_transposed_test.F90 --src src/
[rule-build-compilers-proofs-oac-nvf]
help = Build compilers proofs test with OpenACC-NVF
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-oac-nvf --target ./compilers_proofs/oac/test_deviceptr.f90
rule_3 = fobis build --mode fundal-void-oac-nvf --target ./compilers_proofs/oac/test_present.f90
[rule-build-compilers-proofs-oac-gnu]
help = Build compilers proofs test with OpenACC-GNU
rule_1 = fobis clean
rule_2 = fobis build --mode fundal-void-oac-gnu --target ./compilers_proofs/oac/test_deviceptr.f90
rule_3 = fobis build --mode fundal-void-oac-gnu --target ./compilers_proofs/oac/test_present.f90
[rule-makedoc]
help = Build documentation with formal + VitePress
rule_1 = formal generate --mirror-sources --diagrams --project docs/ford.md --output docs/api
rule_2 = cd docs && npm install && npm run docs:build
[rule-deldoc]
help = Delete documentation build artifacts
rule = rm -rf docs/.vitepress/dist/ docs/.vitepress/cache/ docs/api/
[rule-delexe]
help = Delete exes
rule = rm -rf exe/
[rule-clean]
help = Clean the project tree
rule_1 = fobis rule --ex deldoc
rule_2 = fobis rule --ex delexe
rule_3 = rm -f *.gcov
[rule-maketar]
help = Make tar archive of the project
rule = tar --xform="s%^%FUNDAL/%" -czf FUNDAL.tar.gz *
[rule-makecoverage]
help = Perform coverage analysis
rule_1 = fobis rule --ex delexe
rule_2 = fobis build --mode fundal-test-oac-gnu --coverage
rule_3 = fobis rule --ex run-tests
rule_4 = ./scripts/compute-coverage.sh
[rule-makecoverage-analysis]
help = Perform coverage analysis and saving reports in markdown
rule_1 = fobis rule --ex makecoverage
rule_2 = fobis rule --gcov-analyzer docs/guide/ --gcov-analyzer coverage-analysis
rule_3 = rm -f *.gcov