xref: /petsc/.gitlab-ci.yml (revision eae3dc7d82c4e75c6efc83af6cf84b0783a1b49f)
1#
2# stage-1 take only a few minutes; they do not run the full test suite or external packages.
3#
4# stage-2 runs on MCS systems and may take 10 to 15 minutes. They run the full test suite but with limited mixture of external packages
5#
6# stage-3 runs on MCS systems and may take an hour or more. They run the full test suite and heavily test external packages, utilize valgrind etc
7#
8# The stage-(n) tests are only started if all of the stage-(n-1) tests run without error
9#   You can limit the testing by using the variable STAGE with value 1 or 2
10#
11
12stages:
13  - stage-1
14  - stage-2
15  - stage-3
16  - stage-4
17variables:
18  GIT_STRATEGY: fetch
19  GIT_CLEAN_FLAGS: -ffdxq
20  TIMEOUT: 450
21
22#
23# The most basic template that most tests will expand upon
24#
25
26.test-basic:
27  interruptible: true
28  only:
29    refs:
30#     Set with CI/CD Shedules - New Schedule
31      - schedules
32      - api
33#     Set with CI/CD Pipelines - Run Pipeline
34      - web
35      - merge_requests
36  dependencies: []
37
38.test:
39  extends: .test-basic
40  except:
41    variables:
42      # Skip if the docs-only label is attached to a merge request
43      - $CI_MERGE_REQUEST_LABELS =~ /(^|,)docs-only($|,)/
44      - $PETSC_CI_SCHEDULED =~ /yes/
45
46check-ci-settings:
47  extends: .test-basic
48  stage: .pre
49  tags:
50    - gce-stage1
51  script:
52    - lib/petsc/bin/maint/check-ci-settings.sh
53
54#
55#  This provides the basic order of operations and options template for cloud based stage 1 tests.
56#  Not all test-short need to follow this template but most will.
57#
58
59.stage-1:
60  extends: .test
61  stage: stage-1
62  tags:
63    - gce-u22-stage1
64  before_script:
65    - date
66    - hostname
67    - grep PRETTY_NAME /etc/os-release
68    - nproc
69    - lscpu
70    - ccache --zero-stats
71  script:
72    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
73    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; source ${INIT_SCRIPT}; fi
74    - printf "PATH:$PATH\n"
75    - printf "PYTHONPATH:$PYTHONPATH\n"
76    - printf "CONFIG_OPTS:${CONFIG_OPTS}\n"
77    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
78    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
79    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O3 -march=native' CXXOPTFLAGS='-O3 -march=native' FOPTFLAGS='-O3 -march=native' ${CONFIG_OPTS}
80    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}"
81    - if [ ! -z ${ENABLE_CHECK+x} ]; then make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" check; fi
82    - make CFLAGS="${MAKE_TEST_CFLAGS}" CXXFLAGS="${MAKE_TEST_CXXFLAGS}" FFLAGS="${MAKE_TEST_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" allgtests-tap gmakesearch="${TEST_SEARCH}" TIMEOUT=${TIMEOUT}
83  variables:
84    PYTHON: python3
85    MAKE_CFLAGS: -Werror
86    MAKE_CXXFLAGS: -Werror -Wzero-as-null-pointer-constant
87    MAKE_FFLAGS: -Werror
88    MAKE_TEST_CFLAGS: -Werror
89    MAKE_TEST_CXXFLAGS: -Werror
90    MAKE_TEST_FFLAGS: -Werror
91  after_script:
92    - date
93    - ccache --show-stats
94  artifacts:
95    reports:
96      junit: arch-*/tests/testresults.xml
97    name: "$CI_JOB_NAME"
98    when: always
99    paths:
100    - arch-*/lib/petsc/conf/*.log
101    - arch-*/lib/pkgconfig/petsc.pc
102    - arch-*/tests/testresults.xml
103    - arch-*/tests/test_*_tap.log
104    - arch-*/tests/test_*_err.log
105    expire_in: 4 days
106
107#
108# The following tests run on the cloud as part of stage-1.
109#
110
111ompi-cuda:
112  extends: .stage-1
113  tags:
114  - cuda-stage1
115  variables:
116    CONFIG_OPTS: --with-mpi-dir=/nfs/gce/software/custom/linux-ubuntu22.04-x86_64/spack/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.3.0/openmpi-4.1.3-qrpnszy --with-cuda=1 --with-fc=0
117    TEST_SEARCH: snes_tutorials-ex19_cuda%
118    ENABLE_CHECK: 1
119    MAKE_CXXFLAGS: -Werror
120
121mpich-cxx-py3:
122  extends: .stage-1
123  variables:
124    CONFIG_OPTS: --with-clanguage=cxx --with-fc=0 CXXFLAGS=-std=c++11 --with-strict-petscerrorcode
125    TEST_SEARCH: snes_tutorials-ex48%
126    LOAD_MODULES: gcc/12.1.0 mpich/4.1-gcc-12.1.0
127
128uni-complex-float-int64:
129  extends: .stage-1
130  variables:
131    CONFIG_OPTS: --with-mpi=0 --with-scalar-type=complex --with-precision=single --with-64-bit-indices
132    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
133    LOAD_MODULES: gcc/12.1.0 mpich/4.1-gcc-12.1.0
134
135c99-mlib-static-py:
136  extends: .stage-1
137  variables:
138    CONFIG_OPTS: --with-single-library=0 --with-shared-libraries=0 --with-strict-petscerrorcode CFLAGS=-std=c99 FFLAGS= CXXFLAGS=
139    ENABLE_CHECK: 1
140    TEST_SEARCH: snes_tutorials-ex19% snes_tutorials-ex5f90t%
141    MAKE_TEST_FFLAGS: -Werror -std=f2008
142    LOAD_MODULES: gcc/12.1.0 mpich/4.1-gcc-12.1.0
143
144petsc4py-install:
145  extends: .stage-2
146  tags:
147    - gce-stage2
148  variables:
149    PYTHON: python3
150    T_PREFIX: petsc-install
151    T_DESTDIR: petsc-destdir
152    T_PETSC4PY: src/binding/petsc4py
153    T_VALIDATE_CMD: lib/petsc/bin/maint/validate-petsc4py.sh
154  script:
155    - printf "PATH:$PATH\n"
156    - mkdir hide
157    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
158    - ${PYTHON} ./configure --prefix="${PWD}/${T_PREFIX}" --with-petsc4py=1 --with-debugging=0
159    - make CFLAGS=-Werror CXXFLAGS="-Werror -Wzero-as-null-pointer-constant" FFLAGS=-Werror
160    - printf "====== Test A. Install into staging directory then into prefix directory (mimics distro package recipe) =====\n"
161    - make install DESTDIR="${PWD}/${T_DESTDIR}"
162    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -eq 0
163    - test "$(find ${PWD}/${T_DESTDIR} -mindepth 1 | wc -l)" -gt 0
164    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
165    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
166    - rm -r "${PWD}/${T_PREFIX}" "${PWD}/${T_DESTDIR}" && mkdir "${PWD}/${T_PREFIX}"
167    - printf "====== Test B. Install directly into prefix directory =====\n"
168    - make install
169    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -gt 0
170    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
171    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
172    - printf "====== Test C. Install manually with setuptools =====\n"
173    - export PETSC_DIR="${PWD}/${T_PREFIX}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py build)
174    - export PETSC_DIR="${PWD}/${T_PREFIX}" P="${PWD}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py install --install-lib="${P}/${T_PREFIX}/lib")
175    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
176    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
177    - printf "====== Test D. Install manually with setuptools with staging =====\n"
178    - export PETSC_DIR="${PWD}/${T_PREFIX}" P="${PWD}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py install --root="${P}/${T_DESTDIR}" --install-lib="${P}/${T_PREFIX}/lib")
179    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
180    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
181
182petsc4py-pip:
183  extends: .stage-2
184  tags:
185    - gce-stage2
186  variables:
187    PETSC_CONFIGURE_OPTIONS: --with-mpi=0 --with-fc=0
188    CFLAGS: -O0
189  script:
190    - python3 -m venv pip-builds
191    - source pip-builds/bin/activate
192    - python3 -m pip install --upgrade pip
193    - python3 -m pip install .
194    - python3 -m pip install src/binding/petsc4py
195    - python3 -m petsc4py
196
197checksource:
198  extends: .test-basic
199  stage: .pre
200  tags:
201    - gce-u22-stage1
202  script:
203    - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
204    - vermin --version
205    - make vermin
206    - PATH=/nfs/gce/projects/petsc/soft/u22.04/spack/opt/spack/linux-ubuntu22.04-ivybridge/gcc-11.2.0/llvm-15.0.0-m7mrrtynenjytkmiib2moeqk6kfcifmv/bin:$PATH make checkclangformat SHELL=bash
207    - make checkbadSource SHELL=bash
208    - make checkbadFileChange SHELL=bash
209    - make -f gmakefile check_output SHELL=bash
210    - make check_petsc4py_rst
211  artifacts:
212    name: "$CI_JOB_NAME"
213    when: always
214    paths:
215    - arch-*/lib/petsc/conf/*.patch
216    - arch-*/lib/petsc/conf/*.log
217    expire_in: 4 days
218
219pause-for-approval:
220  extends: .test
221  stage: .pre
222  tags:
223    - gce-stage1
224  only:
225    refs:
226      - merge_requests
227    variables:
228      - $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result"
229      - $CI_MERGE_REQUEST_EVENT_TYPE == "detached"
230  script:
231    - echo "pause-for-approval has no script to run"
232  variables:
233    GIT_STRATEGY: none
234  when: manual
235  allow_failure: false
236
237#
238# Basic template for code coverage generation. Tests should additionally inherit from the more
239# specialized OS-specific versions instead of this one.
240#
241
242.coverage-generate:
243  variables:
244    RUN_GCOV: 1
245    RUN_GCOV_OPTIONS: --decisions
246
247.coverage-disable:
248  variables:
249    RUN_GCOV: 0
250
251#
252# This provides the basic order of operations and options template for stage-2,3 tests.
253# Not all stage-2,3 need to follow this template, but most will.
254#
255.stage-23:
256  extends:
257    - .test
258    - .coverage-generate
259  script:
260    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
261    - if [ ! -z ${GCOV_MODULES+x} ]; then module --trace load ${GCOV_MODULES}; module list; fi
262    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; source ${INIT_SCRIPT}; fi
263    - if [ "${RUN_GCOV}" == 1 ]; then
264        printf "RUN_GCOV_OPTIONS:$RUN_GCOV_OPTIONS\n";
265        gcovr --version;
266      fi
267    - if [ -d ${HOME}/petsc-hash-pkgs/ ]; then find ${HOME}/petsc-hash-pkgs/ -maxdepth 1 -mindepth 1 -type d -mtime +25 -exec rm -rf {} \; ; fi
268    - printf "PATH:$PATH\n"
269    - printf "PYTHONPATH:$PYTHONPATH\n"
270    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
271    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
272    - printf "./config/examples/${TEST_ARCH}.py\n"
273    - cat ./config/examples/${TEST_ARCH}.py
274    - ./config/examples/${TEST_ARCH}.py || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
275    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
276    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" check || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
277    - make updatedatafiles
278    - if [ -z ${DISABLE_PETSC4PY_TESTS+x} ]; then if [ -z ${ENABLE_PETSC4PY_LDPRELOAD+x} ]; then echo "NOT using LD_PRELOAD"; make petsc4pytest; else echo "using LD_PRELOAD"; LD_PRELOAD=${PWD}/${TEST_ARCH}/lib/libpetsc.so make petsc4pytest; fi; fi
279    - if [ -z ${DISABLE_TESTS+x} ]; then make cleantest && make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" allgtests-tap TIMEOUT=${TIMEOUT}  ${TEST_OPTS} || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi; fi
280    - if [ "${RUN_GCOV}" == 1 ]; then make gcov PETSC_GCOV_OPTIONS="${RUN_GCOV_OPTIONS}"; fi
281  artifacts:
282    reports:
283      junit: arch-*/tests/testresults.xml
284    name: "$CI_JOB_NAME"
285    when: always
286    paths:
287    - arch-*/lib/petsc/conf/*.log
288    - arch-*/lib/pkgconfig/petsc.pc
289    - arch-*/tests/testresults.xml
290    - arch-*/tests/test_arch-*_tap.log
291    - arch-*/tests/test_arch-*_err.log
292    - arch-*/arch-*-gcovr-report.json.tar.bz2
293    expire_in: 4 days
294  variables:
295    OPENBLAS_NUM_THREADS: 1
296
297.stage-2:
298  extends: .stage-23
299  stage: stage-2
300
301.stage-3:
302  extends: .stage-23
303  stage: stage-3
304
305#
306# The following provide templates for various OSes for pre/post info
307#
308
309.linux_test_noflags:
310  before_script:
311    - date
312    - hostname
313    - grep PRETTY_NAME /etc/os-release
314    - nproc
315    - lscpu
316    - ccache --zero-stats
317  after_script:
318    - date
319    - ccache --show-stats
320
321.linux_test_nofflags:
322  extends: .linux_test_noflags
323  variables:
324    MAKE_CFLAGS: -Werror
325    MAKE_CXXFLAGS: -Werror
326
327.linux_test:
328  extends: .linux_test_noflags
329  variables:
330    MAKE_CFLAGS: -Werror
331    MAKE_CXXFLAGS: -Werror
332    MAKE_FFLAGS: -Werror
333
334.freebsd_test:
335  extends:
336    - .coverage-disable
337  variables:
338    MAKE_CFLAGS: -Werror
339    MAKE_CXXFLAGS: -Werror
340    MAKE_FFLAGS: -Werror
341  before_script:
342    - date
343    - hostname
344    - freebsd-version
345    - echo $(sysctl -n hw.ncpu)
346    - ccache --zero-stats
347  after_script:
348    - date
349    - ccache --show-stats
350
351.osx_test:
352  variables:
353    MAKE_CFLAGS: -Werror
354    MAKE_CXXFLAGS: -Werror
355    MAKE_FFLAGS: -Werror
356  before_script:
357    - date
358    - hostname
359    - sw_vers -productVersion
360    - echo $(sysctl -n hw.ncpu)
361    - ccache --zero-stats
362  after_script:
363    - date
364    - ccache --show-stats
365
366.opensolaris_test:
367  extends:
368    - .coverage-disable
369  before_script:
370    - date
371    - hostname
372    - uname -a
373    - nproc
374    - isainfo -x
375  after_script:
376    - date
377
378.mswin_test:
379  extends:
380    - .coverage-disable
381  before_script:
382    - date
383    - hostname
384    - uname -a
385    - nproc
386  after_script:
387    - date
388
389#
390# The following tests run as part of stage-2.
391#
392# The tags variable used in the tests below connects the particular test with the runners
393# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
394# For example the test 'linux-sycl-double' any runner that has the tags 'gce-u22-stage3, linux-fast'
395# (in a blue box beneath it)
396#
397
398osx-m1:
399  extends:
400    - .stage-3
401    - .osx_test
402    - .coverage-disable
403  tags:
404    - os:macos-m1
405  variables:
406    TEST_ARCH: arch-ci-osx-m1
407    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
408    INIT_SCRIPT: /Volumes/Scratch/svcpetsc/soft/py3venv/cython3setup.sh
409
410freebsd-cxx-cmplx-64idx-dbg:
411  extends:
412    - .stage-2
413    - .freebsd_test
414  tags:
415    - os:fbsd
416  variables:
417    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
418
419freebsd-c-single-opt:
420  extends:
421    - .stage-2
422    - .freebsd_test
423  tags:
424    - os:fbsd
425  variables:
426    TEST_ARCH: arch-ci-freebsd-c-single-opt
427
428mswin-opt-impi:
429  extends:
430    - .stage-3
431    - .mswin_test
432  tags:
433    - mswin-stage3
434  variables:
435    TEST_ARCH: arch-ci-mswin-opt-impi
436    TEST_OPTS: search='ksp_ksp_tests*'
437
438linux-gcc-quad-64idx-dbg:
439  extends:
440    - .stage-2
441    - .linux_test
442  tags:
443    - gce-stage2
444  variables:
445    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
446
447linux-gcc-pkgs-opt:
448  extends:
449    - .stage-2
450    - .linux_test
451  tags:
452    - gce-stage2
453  variables:
454    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
455
456linux-gcc-complex-opt-32bit:
457  extends:
458    - .stage-2
459    - .linux_test
460  tags:
461    - gce-stage2
462  variables:
463    TEST_ARCH: arch-ci-linux-gcc-complex-opt-32bit
464
465linux-emcc:
466  extends:
467    - .stage-2
468    - .linux_test
469    - .coverage-disable
470  tags:
471    - gce-stage2
472  variables:
473    TEST_ARCH: arch-ci-linux-emcc
474    INIT_SCRIPT: /nfs/gce/projects/petsc/soft/u22.04/emsdk/emsdk_env.sh
475    DISABLE_TESTS: 1
476
477#
478# The following tests run as part of stage-3.
479#
480
481freebsd-cxx-cmplx-pkgs-dbg:
482  extends:
483    - .stage-3
484    - .freebsd_test
485  tags:
486    - os:fbsd
487  variables:
488    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-pkgs-dbg
489
490freebsd-cxx-pkgs-opt:
491  extends:
492    - .stage-3
493    - .freebsd_test
494  tags:
495    - os:fbsd
496  variables:
497    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false
498    TEST_ARCH: arch-ci-freebsd-cxx-pkgs-opt
499
500freebsd-pkgs-opt:
501  extends:
502    - .stage-3
503    - .freebsd_test
504  tags:
505    - os:fbsd
506  variables:
507    TEST_ARCH: arch-ci-freebsd-pkgs-opt
508
509linux-hip-double:
510  extends:
511    - .stage-3
512    - .linux_test_noflags
513    - .coverage-disable
514  tags:
515    - gpu:amd, os:linux
516  variables:
517    TEST_ARCH: arch-ci-linux-hip-double
518    INIT_SCRIPT: /home/users/balay/bin/instinct-mod-init.sh
519
520linux-sycl-double:
521  extends:
522    - .stage-3
523    - .linux_test_nofflags
524    - .coverage-disable
525  tags:
526    - gce-u22-stage3, linux-fast
527  variables:
528    TEST_ARCH: arch-ci-linux-sycl-double
529    LOAD_MODULES: intel-oneapi-compilers/2022.2.1 intel-oneapi-mpi/2021.5.1
530    TEST_OPTS: query=requires queryval=kokkos_kernels
531    MAKE_CFLAGS: -Wno-expected-file-type -Werror
532
533linux-cuda-pkgs:
534  extends:
535    - .stage-3
536    - .linux_test
537  tags:
538    - cuda-stage3
539  variables:
540    TEST_ARCH: arch-ci-linux-cuda-pkgs
541    # run all tests that:
542    # 1. require cuda, OR
543    # 2. require device, OR
544    # 3. require kokkos[_kernels], AND lives in the vec subdirectory
545    #
546    # need to use the alternate OR spelling since '|' is interpreted as a pipe by the
547    # shell, and I could not manage to escape it enough times...
548    TEST_OPTS: -j3 queryval='cuda,device,kokkos*,vec*' query='requires,requires,requires%OR%name'
549
550linux-cuda112-omp:
551  extends:
552    - .stage-3
553    - .linux_test
554    - .coverage-disable
555  tags:
556    - cuda-stage3
557  variables:
558    TEST_ARCH: arch-ci-linux-cuda112-omp
559    TEST_OPTS: -j4 query=requires queryval=kokkos_kernels
560    LOAD_MODULES: cuda/11.2.2 u-gcc-9/9.4.0
561    OMP_PROC_BIND: "false"
562    OMP_NUM_THREADS: 1
563
564linux-cuda-cmplx:
565  extends:
566    - .stage-3
567    - .linux_test
568  tags:
569    - cuda-stage3
570  variables:
571    TEST_ARCH: arch-ci-linux-cuda-cmplx
572
573linux-cuda-double-64idx:
574  extends:
575    - .stage-3
576    - .linux_test
577  tags:
578    - cuda-stage3
579  variables:
580    TEST_ARCH: arch-ci-linux-cuda-double-64idx
581    TEST_OPTS: -j15 query=requires queryval=cuda
582    MAKE_CUDAFLAGS: --compiler-options -Wall,-Wunused-parameter,-Wno-deprecated-declarations,-Werror
583
584linux-cuda-single-cxx:
585  extends:
586    - .stage-3
587    - .linux_test_noflags
588    - .coverage-disable
589  tags:
590    - cuda-stage3
591  variables:
592    TEST_ARCH: arch-ci-linux-cuda-single-cxx
593    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2023-02-02/share/spack/modules/linux-ubuntu22.04-ivybridge
594    LOAD_MODULES: nvhpc-22.11-gcc-11.3.0-vmvmbrx
595    TEST_OPTS: -j15 query=requires queryval=cuda
596
597linux-cuda-uni-pkgs:
598  extends:
599    - .stage-3
600    - .linux_test
601  tags:
602    - cuda-stage3
603  variables:
604    TEST_ARCH: arch-ci-linux-cuda-uni-pkgs
605    TEST_OPTS: -j20 query=requires queryval=cuda
606
607linux-clang-cuda:
608  extends:
609    - .stage-3
610    - .linux_test
611    - .coverage-disable
612  tags:
613    - cuda-stage3
614  variables:
615    TEST_ARCH: arch-ci-linux-clang-cuda
616    TEST_OPTS: -j 1  queryval='cuda*,snes*' query='requires%OR%name'
617    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2023-02-02/share/spack/modules/linux-ubuntu22.04-ivybridge
618    LOAD_MODULES: llvm-15.0.7-gcc-11.3.0-pjldtxf cuda-11.5.2-gcc-11.3.0-jkoottx gcc-11.3.0-gcc-11.3.0-pgrvke5
619
620linux-viennacl:
621  extends:
622    - .stage-3
623    - .linux_test
624  tags:
625    - cuda-stage3
626  variables:
627    TEST_ARCH: arch-ci-linux-viennacl
628    MAKE_CXXFLAGS: -Werror -Wno-ignored-attributes
629    TEST_OPTS: -j20 query=requires queryval=viennacl
630
631linux-without-fc:
632  extends:
633    - .stage-3
634    - .linux_test
635  tags:
636    - gce-u22-stage3
637  variables:
638    TEST_ARCH: arch-ci-linux-without-fc
639
640linux-cmplx-single:
641  extends:
642    - .stage-3
643    - .linux_test
644    - .coverage-disable
645  tags:
646    - name:si
647  variables:
648    FLEXIBLAS: netlib
649    TEST_ARCH: arch-ci-linux-cmplx-single
650
651linux-gcc-cxx-avx2:
652  extends:
653    - .stage-3
654    - .linux_test
655  tags:
656    - name:petsc-knl-01
657  variables:
658    TEST_ARCH: arch-ci-linux-gcc-cxx-avx2
659
660linux-clang-avx:
661  extends:
662    - .stage-3
663    - .linux_test
664  tags:
665    - name:petsc-knl-01
666  variables:
667    TEST_ARCH: arch-ci-linux-clang-avx
668
669linux-knl:
670  extends:
671    - .stage-3
672    - .linux_test
673    - .coverage-disable
674  tags:
675    - name:petsc-knl-01
676  variables:
677    MAKE_FFLAGS: -warn errors
678    TEST_ARCH: arch-ci-linux-knl
679    LOAD_MODULES: intel-oneapi-compilers/2022.0.2 intel-oneapi-mkl/2022.0.2 intel-oneapi-mpi/2021.5.1
680
681linux-intel-mkl-single:
682  extends:
683    - .stage-3
684    - .linux_test_nofflags
685    - .coverage-disable
686  tags:
687    - name:petsc-knl-01
688  variables:
689    TEST_ARCH: arch-ci-linux-intel-mkl-single
690    LOAD_MODULES: intel-oneapi-compilers/2022.0.2 intel-oneapi-mkl/2022.0.2 intel-oneapi-mpi/2021.5.1
691
692linux-cxx-cmplx-pkgs-64idx:
693  extends:
694    - .stage-3
695    - .linux_test
696  tags:
697    - gce-u22-stage3
698  variables:
699    TEST_ARCH: arch-ci-linux-cxx-cmplx-pkgs-64idx
700
701# Set env vars for 'Kokkos + OpenMP' tests, so that they won't give warnings
702linux-pkgs-dbg-ftn-interfaces:
703  extends:
704    - .stage-3
705    - .linux_test
706    - .coverage-disable
707  tags:
708    - gce-u22-stage3
709  variables:
710    TEST_ARCH: arch-ci-linux-pkgs-dbg-ftn-interfaces
711    OMP_PROC_BIND: "false"
712    OMP_NUM_THREADS: 4
713
714linux-pkgs-cxx-mlib:
715  extends:
716    - .stage-3
717    - .linux_test
718  tags:
719    - gce-u22-stage3
720  variables:
721    TEST_ARCH: arch-ci-linux-pkgs-cxx-mlib
722  except:
723    variables:
724      - $PETSC_CI_SCHEDULED =~ /yes/
725
726linux-pkgs-valgrind:
727  extends:
728    - .stage-3
729    - .linux_test
730  tags:
731    - gce-valgrind
732  variables:
733    TEST_ARCH: arch-ci-linux-pkgs-valgrind
734    TIMEOUT: 7200
735
736linux-pkgs-opt:
737  extends:
738    - .stage-3
739    - .linux_test
740    - .coverage-disable
741  tags:
742    - gce-u22-stage3, linux-fast
743  variables:
744    TEST_ARCH: arch-ci-linux-pkgs-opt
745    LOAD_MODULES: gcc/12.1.0
746    MAKE_CXXFLAGS: -Wno-deprecated-declarations -Werror
747
748linux-pkgs-dbg:
749  extends:
750    - .stage-3
751    - .linux_test
752  tags:
753    - gce-u22-stage3, linux-gcov
754  variables:
755    TEST_ARCH: arch-ci-linux-pkgs-dbg
756
757linux-matlab-ilp64:
758  extends:
759    - .stage-3
760    - .linux_test
761  tags:
762    - gce-u22-stage3, linux-gcov
763  variables:
764    TEST_ARCH: arch-ci-linux-matlab-ilp64
765    LOAD_MODULES: gcc/9.4.0 matlab/R2022a
766  allow_failure: true
767
768linux-pgi:
769  extends:
770    - .stage-3
771    - .linux_test_noflags
772    - .coverage-disable
773  tags:
774    - gce-u22-stage3, linux-mcpu
775  variables:
776    TEST_ARCH: arch-ci-linux-pgi
777    LOAD_MODULES: nvhpc/22.3
778
779# If the Nag license server fails then ${PETSC_DIR}/naglicenseproblem is created and the job is marked as failed but allow_failure
780linux-nagfor:
781  extends:
782    - .stage-3
783    - .linux_test_nofflags
784  tags:
785    - gce-stage2, linux-mcpu
786  variables:
787    LOAD_MODULES: nag/6.1
788    TEST_ARCH: arch-ci-linux-nagfor
789  allow_failure:
790    exit_codes: 126
791
792linux-intel-cmplx:
793  extends:
794    - .stage-3
795    - .linux_test_nofflags
796    - .coverage-disable
797  tags:
798    - gce-u22-stage3
799  variables:
800    TEST_ARCH: arch-ci-linux-intel-cmplx
801    LOAD_MODULES: intel-oneapi-compilers/2023.0.0 intel-oneapi-mkl/2022.0.2
802
803linux-xsdk-dbg:
804  extends:
805    - .stage-3
806    - .linux_test
807  tags:
808    - gce-u22-stage3
809  variables:
810    TEST_ARCH: arch-ci-linux-xsdk-dbg
811    LOAD_MODULES: gcc/12.1.0
812
813linux-analyzer:
814  extends:
815    - .stage-3
816    - .linux_test
817    - .coverage-disable
818  tags:
819    - gce-u22-stage2
820  script:
821    - printf "PATH:$PATH\n"
822    - printf "PYTHONPATH:$PYTHONPATH\n"
823    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
824    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
825    - printf "./config/examples/${TEST_ARCH}.py\n"
826    - cat ./config/examples/${TEST_ARCH}.py
827    - ./config/examples/${TEST_ARCH}.py
828    - make LINTER_OPTIONS="${LINTER_OPTIONS}" test-lint
829    - make LINTER_OPTIONS="${LINTER_OPTIONS} -fdoc-* no" lint
830  variables:
831    TEST_ARCH: arch-ci-linux-analyzer
832    LINTER_OPTIONS: "--PETSC_ARCH=${TEST_ARCH} --clang_lib=`llvm-config-14 --libdir`/libclang.so.1 --verbose --werror"
833  artifacts:
834    paths:
835    - arch-*/lib/petsc/conf/*.log
836    - ./petscLintPatches/*.patch
837    expire_in: 4 days
838  except:
839    variables:
840      - $PETSC_CI_SCHEDULED =~ /yes/
841
842linux-intel:
843  extends:
844    - .stage-3
845    - .linux_test_nofflags
846    - .coverage-disable
847  tags:
848    - gce-u22-stage3
849  variables:
850    TEST_ARCH: arch-ci-linux-intel
851    LOAD_MODULES: intel-oneapi-compilers/2023.0.0 intel-oneapi-mkl/2022.0.2
852
853linux-opt-misc:
854  extends:
855    - .stage-3
856    - .linux_test
857  tags:
858    - gce-u22-stage3, linux-fast
859  variables:
860    TEST_ARCH: arch-ci-linux-opt-misc
861    LOAD_MODULES: gcc/8.5.0
862
863linux-pkgs-64idx:
864  extends:
865    - .stage-3
866    - .linux_test
867  tags:
868    - gce-u22-stage3, linux-mcpu
869  variables:
870    TEST_ARCH: arch-ci-linux-pkgs-64idx
871    LOAD_MODULES: intel-oneapi-mkl/2022.0.2
872
873linux-64idx-i8:
874  extends:
875    - .stage-3
876    - .linux_test
877  tags:
878    - gce-u22-stage3, linux-mcpu
879  variables:
880    TEST_ARCH: arch-ci-linux-64idx-i8
881
882linux-gcc-ifc-cmplx:
883  extends:
884    - .stage-3
885    - .linux_test_nofflags
886  tags:
887    - gce-u22-stage3
888  variables:
889    TEST_ARCH: arch-ci-linux-gcc-ifc-cmplx
890    LOAD_MODULES: intel-oneapi-compilers/2022.2.1
891
892linux-opt-cxx-quad:
893  extends:
894    - .stage-3
895    - .linux_test
896  tags:
897    - gce-u22-stage3
898  variables:
899    TEST_ARCH: arch-ci-linux-opt-cxx-quad
900
901linux-ILP64:
902  extends:
903    - .stage-3
904    - .linux_test
905  tags:
906    - gce-u22-stage3
907  variables:
908    TEST_ARCH: arch-ci-linux-ILP64
909    LOAD_MODULES: gcc/8.5.0 mpich/2-1.5-gcc-8.5.0
910    MAKE_CFLAGS: -Wno-discarded-qualifiers -Werror
911
912linux-64idx-i8-uni:
913  extends:
914    - .stage-3
915    - .linux_test
916  tags:
917    - gce-u22-stage3, linux-mcpu
918  variables:
919    TEST_ARCH: arch-ci-linux-64idx-i8-uni
920
921mswin-intel-cxx-cmplx:
922  extends:
923    - .stage-3
924    - .mswin_test
925  tags:
926    - mswin-stage3
927  variables:
928    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
929
930mswin-uni:
931  extends:
932    - .stage-3
933    - .mswin_test
934  tags:
935    - mswin-stage3
936  variables:
937    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
938    TEST_ARCH: arch-ci-mswin-uni
939
940mswin-gnu:
941  extends:
942    - .stage-3
943    - .mswin_test
944  tags:
945    - mswin-stage3
946  variables:
947    TEST_ARCH: arch-ci-mswin-gnu
948    MAKE_CFLAGS: -Werror
949    MAKE_CXXFLAGS: -Werror
950    MAKE_FFLAGS: -Werror
951    DISABLE_TESTS: 1
952
953#mswin-intel:
954#  extends:
955#    - .stage-3
956#    - .mswin_test
957#  tags:
958#    - os:win
959#  variables:
960#    TEST_ARCH: arch-ci-mswin-intel
961
962opensolaris-pkgs-opt:
963  extends:
964    - .stage-3
965    - .opensolaris_test
966  tags:
967    - name:n-gage
968  variables:
969    TEST_ARCH: arch-ci-opensolaris-pkgs-opt
970
971opensolaris-cmplx-pkgs-dbg:
972  extends:
973    - .stage-3
974    - .opensolaris_test
975  tags:
976    - name:n-gage
977  variables:
978    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
979
980opensolaris-misc:
981  extends:
982    - .stage-3
983    - .opensolaris_test
984  tags:
985    - name:n-gage
986  variables:
987    TEST_ARCH: arch-ci-opensolaris-misc
988
989osx-cxx-cmplx-pkgs-dbg:
990  extends:
991    - .stage-3
992    - .osx_test
993    - .coverage-disable
994  tags:
995    - os:macos
996  variables:
997    TEST_ARCH: arch-ci-osx-cxx-cmplx-pkgs-dbg
998    INIT_SCRIPT: /Users/glci/bin/py3.sh
999
1000osx-cxx-pkgs-opt:
1001  extends:
1002    - .stage-3
1003    - .osx_test
1004  tags:
1005    - os:macos, opt
1006  variables:
1007    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false
1008    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
1009    MAKE_CXXFLAGS: -Werror -Wno-pass-failed
1010
1011osx-dbg:
1012  extends:
1013    - .stage-3
1014    - .osx_test
1015    - .coverage-disable
1016  tags:
1017    - os:macos
1018  variables:
1019    TEST_ARCH: arch-ci-osx-dbg
1020
1021osx-xsdk-opt:
1022  extends:
1023    - .stage-3
1024    - .osx_test
1025    - .coverage-disable
1026  tags:
1027    - os:macos, opt
1028  variables:
1029    TEST_ARCH: arch-ci-osx-xsdk-opt
1030
1031# job for analyzing the coverage results and generating the various reports
1032coverage-analyze:
1033  extends: .test
1034  stage: stage-4
1035  tags:
1036    - gce-u22-short
1037  dependencies:
1038    # stage-2
1039    - linux-gcc-quad-64idx-dbg
1040    - linux-gcc-pkgs-opt
1041    - linux-gcc-complex-opt-32bit
1042    # stage-3
1043    - linux-pkgs-dbg
1044    - linux-matlab-ilp64
1045    - linux-cuda-pkgs
1046    - linux-cxx-cmplx-pkgs-64idx
1047    - linux-cuda-cmplx
1048    - linux-cuda-double-64idx
1049    - linux-cuda-uni-pkgs
1050    - linux-viennacl
1051    - linux-without-fc
1052    - linux-gcc-cxx-avx2
1053    - linux-clang-avx
1054    - linux-pkgs-cxx-mlib
1055    - linux-pkgs-valgrind
1056    - linux-nagfor
1057    - linux-xsdk-dbg
1058    - linux-opt-misc
1059    - linux-pkgs-64idx
1060    - linux-64idx-i8
1061    - linux-gcc-ifc-cmplx
1062    - linux-opt-cxx-quad
1063    - linux-ILP64
1064    - linux-64idx-i8-uni
1065    - osx-cxx-pkgs-opt
1066  variables:
1067    PYTHON: python3
1068    PETSC_ARCH: arch-ci-analyze-pipeline
1069  before_script:
1070    - date
1071    - hostname
1072  script:
1073    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
1074    - ${PYTHON} --version
1075    - gcovr --version
1076    - printf "PATH:$PATH\n"
1077    - printf "PYTHONPATH:$PYTHONPATH\n"
1078    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
1079    - ${PYTHON} ./configure --with-mpi=0 --with-cxx=0 --download-sowing --with-fortran-bindings
1080    - make mergegcov PETSC_GCOV_OPTIONS='--ci-mode --verbose'
1081  coverage: /^\s*lines:\s*\d+.\d+\%/
1082  artifacts:
1083    name: "$CI_JOB_NAME"
1084    when: always
1085    paths:
1086    - arch-ci-analyze-pipeline/gcovr/*
1087    - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1088    expire_in: 4 days
1089    reports:
1090      coverage_report:
1091        coverage_format: cobertura
1092        path: arch-ci-analyze-pipeline/gcovr/xml/*.xml
1093
1094# template for the coverage review jobs, these must be separate jobs as you cannot deploy multiple
1095# environments from one job...
1096.coverage-review:
1097  extends: .test
1098  stage: .post
1099  tags:
1100    - gce-u22-short
1101  dependencies:
1102    - coverage-analyze
1103  script:
1104    - date
1105    - hostname
1106  artifacts:
1107    name: "$CI_JOB_NAME"
1108    when: always
1109    paths:
1110    - arch-ci-analyze-pipeline/gcovr/*
1111    - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1112    expire_in: 4 days
1113
1114coverage-total-review:
1115  extends: .coverage-review
1116  environment:
1117    name: coverage/all/$CI_COMMIT_REF_SLUG
1118    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/arch-ci-analyze-pipeline/gcovr/html/report.html
1119    auto_stop_in: one week
1120    deployment_tier: testing
1121
1122coverage-untested-review:
1123  extends: .coverage-review
1124  environment:
1125    name: coverage/untested/$CI_COMMIT_REF_SLUG
1126    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/arch-ci-analyze-pipeline/gcovr/html_untested/report_untested.html
1127    auto_stop_in: one week
1128    deployment_tier: testing
1129
1130analyze-pipeline:
1131  extends: .coverage-review
1132  script:
1133    - date
1134    - hostname
1135    # This file is created by lib/petsc/bin/maint/gcov.py. If it exists then the CI
1136    # pipeline should fail
1137    - if [ -f ./arch-ci-analyze-pipeline/gcovr/.CI_FAIL ]; then
1138        cat ./arch-ci-analyze-pipeline/gcovr/merge_gcov_errors.log;
1139        exit 1;
1140      fi
1141
1142#
1143# Base job for a documentation build (runs in venv to allow installing additional packages without root)
1144#
1145.docs:
1146  stage: stage-3
1147  tags:
1148    - gce-stage2
1149  before_script:
1150    - printf "PATH:$PATH\n"
1151    - printf "PYTHONPATH:$PYTHONPATH\n"
1152    - VENV=venv-petsc-docs &&
1153      python3 -m venv $VENV &&
1154      . $VENV/bin/activate &&
1155      cd doc &&
1156      python3 -m pip install -r requirements.txt
1157
1158#
1159# Build documentation and make available for review using GitLab pages
1160#
1161docs-review:
1162  extends:
1163    - .docs
1164    - .test-basic
1165  script:
1166    - (make html BUILDDIR="../public" SPHINXOPTS="-T -E -W --keep-going -j 1") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1167    - (make latexpdf SPHINXOPTS="-T -E -W --keep-going") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1168    - cp _build/latex/manual.pdf ../public/html/manual/
1169  environment:
1170    name: review/$CI_COMMIT_REF_NAME
1171    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/html/index.html
1172    auto_stop_in: one week
1173    deployment_tier: development
1174  artifacts:
1175    paths:
1176      - public
1177    expire_in: 4 days
1178  except:
1179    variables:
1180      - $PETSC_CI_SCHEDULED =~ /yes/
1181
1182#
1183# Deploy documentation using GitLab pages
1184#
1185pages:  # this job name has special meaning to GitLab
1186  extends: .docs
1187  interruptible: true
1188  script:
1189    - mkdir -p ../public/ && cp public/* ../public/
1190    - git fetch --unshallow --no-tags origin +release:remotes/origin/release +main:remotes/origin/main
1191    - git checkout origin/main && pip install -r requirements.txt && make website-deploy SPHINXOPTS="-j 1" BUILDDIR="../public/main" && make latexpdf && mkdir -p ../public/main/docs/manual && cp _build/latex/manual.pdf ../public/main/manual/
1192    - make clean BUILDDIR="../public/release"
1193    - git clean -fdxq && rm -rf images
1194    - git checkout origin/release && pip install -r requirements.txt && make website-deploy SPHINXOPTS="-j 1"  BUILDDIR="../public/release" && make latexpdf && mkdir -p ../public/release/docs/manual && cp _build/latex/manual.pdf ../public/release/docs/manual/
1195    - rm -rf ../public/*/.doctrees
1196  only:
1197    variables:
1198      - $PETSC_CI_SCHEDULED == "yes"
1199  artifacts:
1200    paths:
1201      - public
1202    expire_in: 4 days
1203
1204#
1205#
1206# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
1207# that fail produce a warning, but do not block execution of a pipeline.
1208#
1209
1210.test-experimental:
1211  extends: .test
1212  allow_failure: true
1213
1214