xref: /petsc/.gitlab-ci.yml (revision c77c71ff2d9eaa2c74538bf9bf94eff01b512dbf)
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}"; if [ -f ${HOME}/${INIT_SCRIPT} ]; then source ${HOME}/${INIT_SCRIPT}; else source ${INIT_SCRIPT}; fi; 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-u22-stage1
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-u22-stage1
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==23.0.1
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/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/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}"; if [ -f ${HOME}/${INIT_SCRIPT} ]; then source ${HOME}/${INIT_SCRIPT}; else source ${INIT_SCRIPT}; fi; 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.mswin_test:
367  extends:
368    - .coverage-disable
369  before_script:
370    - date
371    - hostname
372    - uname -a
373    - nproc
374  after_script:
375    - date
376
377#
378# The following tests run as part of stage-2.
379#
380# The tags variable used in the tests below connects the particular test with the runners
381# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
382# For example the test 'linux-sycl-double' any runner that has the tags 'gce-u22-stage3, linux-fast'
383# (in a blue box beneath it)
384#
385
386osx-m1:
387  extends:
388    - .stage-3
389    - .osx_test
390    - .coverage-disable
391  tags:
392    - os:macos-m1
393  variables:
394    TEST_ARCH: arch-ci-osx-m1
395    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
396    INIT_SCRIPT: /Volumes/Scratch/svcpetsc/soft/py3venv/cython3setup.sh
397
398freebsd-cxx-cmplx-64idx-dbg:
399  extends:
400    - .stage-2
401    - .freebsd_test
402  tags:
403    - os:fbsd
404  variables:
405    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
406
407freebsd-c-single-opt:
408  extends:
409    - .stage-2
410    - .freebsd_test
411  tags:
412    - os:fbsd
413  variables:
414    TEST_ARCH: arch-ci-freebsd-c-single-opt
415
416mswin-opt-impi:
417  extends:
418    - .stage-3
419    - .mswin_test
420  tags:
421    - mswin-stage3
422  variables:
423    TEST_ARCH: arch-ci-mswin-opt-impi
424    TEST_OPTS: search='ksp_ksp_tests*'
425
426linux-gcc-quad-64idx-dbg:
427  extends:
428    - .stage-2
429    - .linux_test
430  tags:
431    - gce-stage2
432  variables:
433    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
434
435linux-gcc-pkgs-opt:
436  extends:
437    - .stage-2
438    - .linux_test
439  tags:
440    - gce-stage2
441  variables:
442    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
443
444linux-gcc-complex-opt-32bit:
445  extends:
446    - .stage-2
447    - .linux_test
448  tags:
449    - gce-stage2
450  variables:
451    TEST_ARCH: arch-ci-linux-gcc-complex-opt-32bit
452
453linux-emcc:
454  extends:
455    - .stage-2
456    - .linux_test
457    - .coverage-disable
458  tags:
459    - gce-stage2
460  variables:
461    TEST_ARCH: arch-ci-linux-emcc
462    INIT_SCRIPT: /nfs/gce/projects/petsc/soft/u22.04/emsdk/emsdk_env.sh
463    DISABLE_TESTS: 1
464
465#
466# The following tests run as part of stage-3.
467#
468
469freebsd-cxx-cmplx-pkgs-dbg:
470  extends:
471    - .stage-3
472    - .freebsd_test
473  tags:
474    - os:fbsd
475  variables:
476    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-pkgs-dbg
477
478freebsd-cxx-pkgs-opt:
479  extends:
480    - .stage-3
481    - .freebsd_test
482  tags:
483    - os:fbsd
484  variables:
485    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false
486    TEST_ARCH: arch-ci-freebsd-cxx-pkgs-opt
487
488freebsd-pkgs-opt:
489  extends:
490    - .stage-3
491    - .freebsd_test
492  tags:
493    - os:fbsd
494  variables:
495    TEST_ARCH: arch-ci-freebsd-pkgs-opt
496    MAKE_CFLAGS: -DPETSC_SKIP_COMPLEX -Werror
497
498linux-hip-double:
499  extends:
500    - .stage-3
501    - .linux_test_noflags
502    - .coverage-disable
503  tags:
504    - gpu:amd, os:linux
505  variables:
506    TEST_ARCH: arch-ci-linux-hip-double
507    INIT_SCRIPT: /home/users/balay/bin/instinct-mod-init.sh
508
509linux-sycl-double:
510  extends:
511    - .stage-3
512    - .linux_test_nofflags
513    - .coverage-disable
514  tags:
515    - gce-u22-stage3, linux-fast
516  variables:
517    TEST_ARCH: arch-ci-linux-sycl-double
518    LOAD_MODULES: intel-oneapi-compilers/2022.2.1 intel-oneapi-mpi/2021.5.1
519    TEST_OPTS: query=requires queryval=kokkos_kernels
520    MAKE_CFLAGS: -Wno-expected-file-type -Werror
521
522linux-cuda-pkgs:
523  extends:
524    - .stage-3
525    - .linux_test
526  tags:
527    - cuda-stage3
528  variables:
529    TEST_ARCH: arch-ci-linux-cuda-pkgs
530    # run all tests that:
531    # 1. require cuda, OR
532    # 2. require device, OR
533    # 3. require kokkos[_kernels], AND lives in the vec subdirectory
534    #
535    # need to use the alternate OR spelling since '|' is interpreted as a pipe by the
536    # shell, and I could not manage to escape it enough times...
537    TEST_OPTS: -j3 queryval='cuda,device,kokkos*,vec*' query='requires,requires,requires%OR%name'
538    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
539
540linux-cuda112-omp:
541  extends:
542    - .stage-3
543    - .linux_test
544    - .coverage-disable
545  tags:
546    - cuda-stage3
547  variables:
548    TEST_ARCH: arch-ci-linux-cuda112-omp
549    TEST_OPTS: -j4 query=requires queryval=kokkos_kernels
550    LOAD_MODULES: cuda/11.2.2 u-gcc-9/9.4.0
551    OMP_PROC_BIND: "false"
552    OMP_NUM_THREADS: 1
553    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
554
555linux-cuda-cmplx:
556  extends:
557    - .stage-3
558    - .linux_test
559  tags:
560    - cuda-stage3
561  variables:
562    TEST_ARCH: arch-ci-linux-cuda-cmplx
563    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
564
565linux-cuda-double-64idx:
566  extends:
567    - .stage-3
568    - .linux_test
569  tags:
570    - cuda12
571  variables:
572    TEST_ARCH: arch-ci-linux-cuda-double-64idx
573    TEST_OPTS: -j3 query=requires queryval=cuda
574    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
575
576linux-cuda-single-cxx:
577  extends:
578    - .stage-3
579    - .linux_test_noflags
580    - .coverage-disable
581  tags:
582    - cuda-stage3
583  variables:
584    TEST_ARCH: arch-ci-linux-cuda-single-cxx
585    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2023-02-02/share/spack/modules/linux-ubuntu22.04-ivybridge
586    LOAD_MODULES: nvhpc-22.11-gcc-11.3.0-vmvmbrx
587    TEST_OPTS: -j15 query=requires queryval=cuda
588
589linux-cuda-uni-pkgs:
590  extends:
591    - .stage-3
592    - .linux_test
593  tags:
594    - cuda-stage3
595  variables:
596    TEST_ARCH: arch-ci-linux-cuda-uni-pkgs
597    TEST_OPTS: -j20 query=requires queryval=cuda
598    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
599
600linux-clang-cuda:
601  extends:
602    - .stage-3
603    - .linux_test
604    - .coverage-disable
605  tags:
606    - cuda-stage3
607  variables:
608    TEST_ARCH: arch-ci-linux-clang-cuda
609    TEST_OPTS: -j 1  queryval='cuda*,snes*' query='requires%OR%name'
610    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2023-02-02/share/spack/modules/linux-ubuntu22.04-ivybridge
611    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
612    MAKE_CUDAFLAGS: -Wno-pass-failed -Werror
613
614linux-viennacl:
615  extends:
616    - .stage-3
617    - .linux_test
618  tags:
619    - cuda-stage3
620  variables:
621    TEST_ARCH: arch-ci-linux-viennacl
622    MAKE_CXXFLAGS: -Werror -Wno-ignored-attributes
623    TEST_OPTS: -j20 query=requires queryval=viennacl
624
625linux-without-fc:
626  extends:
627    - .stage-3
628    - .linux_test
629  tags:
630    - gce-u22-stage3
631  variables:
632    TEST_ARCH: arch-ci-linux-without-fc
633
634linux-cmplx-single:
635  extends:
636    - .stage-3
637    - .linux_test
638    - .coverage-disable
639  tags:
640    - name:si
641  variables:
642    FLEXIBLAS: netlib
643    TEST_ARCH: arch-ci-linux-cmplx-single
644
645linux-gcc-cxx-avx2:
646  extends:
647    - .stage-3
648    - .linux_test
649  tags:
650    - name:petsc-knl-01
651  variables:
652    TEST_ARCH: arch-ci-linux-gcc-cxx-avx2
653
654linux-clang-avx:
655  extends:
656    - .stage-3
657    - .linux_test
658  tags:
659    - name:petsc-knl-01
660  variables:
661    TEST_ARCH: arch-ci-linux-clang-avx
662
663linux-knl:
664  extends:
665    - .stage-3
666    - .linux_test
667    - .coverage-disable
668  tags:
669    - name:petsc-knl-01
670  variables:
671    MAKE_FFLAGS: -warn errors
672    TEST_ARCH: arch-ci-linux-knl
673    LOAD_MODULES: intel-oneapi-compilers/2022.0.2 intel-oneapi-mkl/2022.0.2 intel-oneapi-mpi/2021.5.1
674
675linux-intel-mkl-single:
676  extends:
677    - .stage-3
678    - .linux_test_nofflags
679    - .coverage-disable
680  tags:
681    - name:petsc-knl-01
682  variables:
683    TEST_ARCH: arch-ci-linux-intel-mkl-single
684    LOAD_MODULES: intel-oneapi-compilers/2022.0.2 intel-oneapi-mkl/2022.0.2 intel-oneapi-mpi/2021.5.1
685
686linux-cxx-cmplx-pkgs-64idx:
687  extends:
688    - .stage-3
689    - .linux_test
690  tags:
691    - gce-u22-stage3
692  variables:
693    TEST_ARCH: arch-ci-linux-cxx-cmplx-pkgs-64idx
694
695# Set env vars for 'Kokkos + OpenMP' tests, so that they won't give warnings
696linux-pkgs-dbg-ftn-interfaces:
697  extends:
698    - .stage-3
699    - .linux_test
700    - .coverage-disable
701  tags:
702    - gce-u22-stage3
703  variables:
704    TEST_ARCH: arch-ci-linux-pkgs-dbg-ftn-interfaces
705    OMP_PROC_BIND: "false"
706    OMP_NUM_THREADS: 4
707
708linux-pkgs-cxx-mlib:
709  extends:
710    - .stage-3
711    - .linux_test
712  tags:
713    - gce-u22-stage3
714  variables:
715    TEST_ARCH: arch-ci-linux-pkgs-cxx-mlib
716  except:
717    variables:
718      - $PETSC_CI_SCHEDULED =~ /yes/
719
720linux-pkgs-valgrind:
721  extends:
722    - .stage-3
723    - .linux_test
724  tags:
725    - gce-valgrind
726  variables:
727    TEST_ARCH: arch-ci-linux-pkgs-valgrind
728    TIMEOUT: 7200
729
730linux-pkgs-opt:
731  extends:
732    - .stage-3
733    - .linux_test
734    - .coverage-disable
735  tags:
736    - gce-u22-stage3, linux-fast
737  variables:
738    TEST_ARCH: arch-ci-linux-pkgs-opt
739    LOAD_MODULES: gcc/12.1.0
740    MAKE_CXXFLAGS: -Wno-deprecated-declarations -Werror
741
742linux-pkgs-dbg:
743  extends:
744    - .stage-3
745    - .linux_test
746  tags:
747    - gce-u22-stage3, linux-gcov
748  variables:
749    TEST_ARCH: arch-ci-linux-pkgs-dbg
750
751linux-matlab-ilp64:
752  extends:
753    - .stage-3
754    - .linux_test
755  tags:
756    - gce-u22-stage3, linux-gcov
757  variables:
758    TEST_ARCH: arch-ci-linux-matlab-ilp64
759    LOAD_MODULES: gcc/9.4.0 matlab/R2022a
760  allow_failure: true
761
762linux-pgi:
763  extends:
764    - .stage-3
765    - .linux_test_noflags
766    - .coverage-disable
767  tags:
768    - gce-u22-stage3, linux-mcpu
769  variables:
770    TEST_ARCH: arch-ci-linux-pgi
771    LOAD_MODULES: nvhpc/22.3
772
773# If the Nag license server fails then ${PETSC_DIR}/naglicenseproblem is created and the job is marked as failed but allow_failure
774linux-nagfor:
775  extends:
776    - .stage-3
777    - .linux_test_nofflags
778  tags:
779    - gce-stage2, linux-mcpu
780  variables:
781    LOAD_MODULES: nag/6.1
782    TEST_ARCH: arch-ci-linux-nagfor
783  allow_failure:
784    exit_codes: 126
785
786linux-intel-cmplx:
787  extends:
788    - .stage-3
789    - .linux_test_nofflags
790    - .coverage-disable
791  tags:
792    - gce-u22-stage3
793  variables:
794    TEST_ARCH: arch-ci-linux-intel-cmplx
795    LOAD_MODULES: intel-oneapi-compilers/2023.0.0 intel-oneapi-mkl/2022.0.2
796
797linux-xsdk-dbg:
798  extends:
799    - .stage-3
800    - .linux_test
801  tags:
802    - gce-u22-stage3
803  variables:
804    TEST_ARCH: arch-ci-linux-xsdk-dbg
805    LOAD_MODULES: gcc/12.1.0
806
807linux-analyzer:
808  extends:
809    - .stage-3
810    - .linux_test
811    - .coverage-disable
812  tags:
813    - gce-u22-stage2
814  script:
815    - printf "PATH:$PATH\n"
816    - printf "PYTHONPATH:$PYTHONPATH\n"
817    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
818    - 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
819    - printf "./config/examples/${TEST_ARCH}.py\n"
820    - cat ./config/examples/${TEST_ARCH}.py
821    - ./config/examples/${TEST_ARCH}.py
822    - make LINTER_OPTIONS="${LINTER_OPTIONS}" test-lint
823    - make LINTER_OPTIONS="${LINTER_OPTIONS} -fdoc-* no" lint
824  variables:
825    TEST_ARCH: arch-ci-linux-analyzer
826    LINTER_OPTIONS: "--PETSC_ARCH=${TEST_ARCH} --clang_lib=`llvm-config-14 --libdir`/libclang.so.1 --verbose --werror"
827  artifacts:
828    paths:
829    - arch-*/lib/petsc/conf/*.log
830    - ./petscLintPatches/*.patch
831    expire_in: 4 days
832  except:
833    variables:
834      - $PETSC_CI_SCHEDULED =~ /yes/
835
836linux-intel:
837  extends:
838    - .stage-3
839    - .linux_test_nofflags
840    - .coverage-disable
841  tags:
842    - gce-u22-stage3
843  variables:
844    TEST_ARCH: arch-ci-linux-intel
845    LOAD_MODULES: intel-oneapi-compilers/2023.0.0 intel-oneapi-mkl/2022.0.2
846
847linux-opt-misc:
848  extends:
849    - .stage-3
850    - .linux_test
851  tags:
852    - gce-u22-stage3, linux-fast
853  variables:
854    TEST_ARCH: arch-ci-linux-opt-misc
855    LOAD_MODULES: gcc/8.5.0
856
857linux-pkgs-64idx:
858  extends:
859    - .stage-3
860    - .linux_test
861  tags:
862    - gce-u22-stage3, linux-mcpu
863  variables:
864    TEST_ARCH: arch-ci-linux-pkgs-64idx
865    LOAD_MODULES: intel-oneapi-mkl/2022.0.2
866
867linux-64idx-i8:
868  extends:
869    - .stage-3
870    - .linux_test
871  tags:
872    - gce-u22-stage3, linux-mcpu
873  variables:
874    TEST_ARCH: arch-ci-linux-64idx-i8
875
876linux-gcc-ifc-cmplx:
877  extends:
878    - .stage-3
879    - .linux_test_nofflags
880  tags:
881    - gce-u22-stage3
882  variables:
883    TEST_ARCH: arch-ci-linux-gcc-ifc-cmplx
884    LOAD_MODULES: intel-oneapi-compilers/2022.2.1
885
886linux-opt-cxx-quad:
887  extends:
888    - .stage-3
889    - .linux_test
890  tags:
891    - gce-u22-stage3
892  variables:
893    TEST_ARCH: arch-ci-linux-opt-cxx-quad
894
895linux-ILP64:
896  extends:
897    - .stage-3
898    - .linux_test
899  tags:
900    - gce-u22-stage3
901  variables:
902    TEST_ARCH: arch-ci-linux-ILP64
903    LOAD_MODULES: gcc/8.5.0 mpich/2-1.5-gcc-8.5.0
904    MAKE_CFLAGS: -Wno-discarded-qualifiers -Werror
905
906linux-64idx-i8-uni:
907  extends:
908    - .stage-3
909    - .linux_test
910  tags:
911    - gce-u22-stage3, linux-mcpu
912  variables:
913    TEST_ARCH: arch-ci-linux-64idx-i8-uni
914
915linux-misc-32bit:
916  extends:
917    - .stage-3
918    - .linux_test
919  tags:
920    - gce-u22-stage3
921  variables:
922    TEST_ARCH: arch-ci-linux-misc-32bit
923
924mswin-intel-cxx-cmplx:
925  extends:
926    - .stage-3
927    - .mswin_test
928  tags:
929    - mswin-stage3
930  variables:
931    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
932
933mswin-uni:
934  extends:
935    - .stage-3
936    - .mswin_test
937  tags:
938    - mswin-stage3
939  variables:
940    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
941    TEST_ARCH: arch-ci-mswin-uni
942
943mswin-gnu:
944  extends:
945    - .stage-3
946    - .mswin_test
947  tags:
948    - mswin-stage3
949  variables:
950    TEST_ARCH: arch-ci-mswin-gnu
951    MAKE_CFLAGS: -Werror
952    MAKE_CXXFLAGS: -Werror
953    MAKE_FFLAGS: -Werror
954    DISABLE_TESTS: 1
955
956#mswin-intel:
957#  extends:
958#    - .stage-3
959#    - .mswin_test
960#  tags:
961#    - os:win
962#  variables:
963#    TEST_ARCH: arch-ci-mswin-intel
964
965osx-cxx-cmplx-pkgs-dbg:
966  extends:
967    - .stage-3
968    - .osx_test
969    - .coverage-disable
970  tags:
971    - os:macos-x64
972  variables:
973    TEST_ARCH: arch-ci-osx-cxx-cmplx-pkgs-dbg
974    INIT_SCRIPT: .zprofile
975
976osx-cxx-pkgs-opt:
977  extends:
978    - .stage-3
979    - .osx_test
980  tags:
981    - os:macos-x64
982  variables:
983    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false
984    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
985    MAKE_CXXFLAGS: -Werror -Wno-pass-failed
986    INIT_SCRIPT: .zprofile
987
988osx-dbg:
989  extends:
990    - .stage-3
991    - .osx_test
992    - .coverage-disable
993  tags:
994    - os:macos-x64
995  variables:
996    TEST_ARCH: arch-ci-osx-dbg
997    ASAN_OPTIONS: log_path=stdout
998    INIT_SCRIPT: .zprofile
999
1000osx-xsdk-opt:
1001  extends:
1002    - .stage-3
1003    - .osx_test
1004    - .coverage-disable
1005  tags:
1006    - os:macos-x64
1007  variables:
1008    TEST_ARCH: arch-ci-osx-xsdk-opt
1009    INIT_SCRIPT: .zprofile
1010
1011# job for analyzing the coverage results and generating the various reports
1012coverage-analyze:
1013  extends: .test
1014  stage: stage-4
1015  tags:
1016    - gce-u22-short
1017  dependencies:
1018    # stage-2
1019    - linux-gcc-quad-64idx-dbg
1020    - linux-gcc-pkgs-opt
1021    - linux-gcc-complex-opt-32bit
1022    # stage-3
1023    - linux-pkgs-dbg
1024    - linux-matlab-ilp64
1025    - linux-cuda-pkgs
1026    - linux-cxx-cmplx-pkgs-64idx
1027    - linux-cuda-cmplx
1028    - linux-cuda-double-64idx
1029    - linux-cuda-uni-pkgs
1030    - linux-viennacl
1031    - linux-without-fc
1032    - linux-gcc-cxx-avx2
1033    - linux-clang-avx
1034    - linux-pkgs-cxx-mlib
1035    - linux-pkgs-valgrind
1036    - linux-nagfor
1037    - linux-xsdk-dbg
1038    - linux-opt-misc
1039    - linux-pkgs-64idx
1040    - linux-64idx-i8
1041    - linux-gcc-ifc-cmplx
1042    - linux-opt-cxx-quad
1043    - linux-ILP64
1044    - linux-64idx-i8-uni
1045    - osx-cxx-pkgs-opt
1046  variables:
1047    PYTHON: python3
1048    PETSC_ARCH: arch-ci-analyze-pipeline
1049  before_script:
1050    - date
1051    - hostname
1052  script:
1053    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
1054    - ${PYTHON} --version
1055    - gcovr --version
1056    - printf "PATH:$PATH\n"
1057    - printf "PYTHONPATH:$PYTHONPATH\n"
1058    - 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
1059    - ${PYTHON} ./configure --with-mpi=0 --with-cxx=0 --download-sowing --with-fortran-bindings
1060    - make mergegcov PETSC_GCOV_OPTIONS='--ci-mode --verbose'
1061  coverage: /^\s*lines:\s*\d+.\d+\%/
1062  artifacts:
1063    name: "$CI_JOB_NAME"
1064    when: always
1065    paths:
1066    - arch-ci-analyze-pipeline/gcovr/*
1067    - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1068    expire_in: 4 days
1069    reports:
1070      coverage_report:
1071        coverage_format: cobertura
1072        path: arch-ci-analyze-pipeline/gcovr/xml/*.xml
1073
1074# template for the coverage review jobs, these must be separate jobs as you cannot deploy multiple
1075# environments from one job...
1076.coverage-review:
1077  extends: .test
1078  stage: .post
1079  tags:
1080    - gce-u22-short
1081  dependencies:
1082    - coverage-analyze
1083  script:
1084    - date
1085    - hostname
1086  artifacts:
1087    name: "$CI_JOB_NAME"
1088    when: always
1089    paths:
1090    - arch-ci-analyze-pipeline/gcovr/*
1091    - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1092    expire_in: 4 days
1093
1094coverage-total-review:
1095  extends: .coverage-review
1096  environment:
1097    name: coverage/all/$CI_COMMIT_REF_SLUG
1098    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/arch-ci-analyze-pipeline/gcovr/html/report.html
1099    auto_stop_in: one week
1100    deployment_tier: testing
1101
1102coverage-untested-review:
1103  extends: .coverage-review
1104  environment:
1105    name: coverage/untested/$CI_COMMIT_REF_SLUG
1106    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
1107    auto_stop_in: one week
1108    deployment_tier: testing
1109
1110analyze-pipeline:
1111  extends: .coverage-review
1112  script:
1113    - date
1114    - hostname
1115    # This file is created by lib/petsc/bin/maint/gcov.py. If it exists then the CI
1116    # pipeline should fail
1117    - if [ -f ./arch-ci-analyze-pipeline/gcovr/.CI_FAIL ]; then
1118        cat ./arch-ci-analyze-pipeline/gcovr/merge_gcov_errors.log;
1119        exit 1;
1120      fi
1121  allow_failure: true
1122
1123#
1124# Base job for a documentation build (runs in venv to allow installing additional packages without root)
1125#
1126.docs:
1127  stage: stage-3
1128  tags:
1129    - linux-docs
1130  before_script:
1131    - git fetch --unshallow --no-tags origin +release:remotes/origin/release +main:remotes/origin/main
1132    - printf "PATH:$PATH\n"
1133    - printf "PYTHONPATH:$PYTHONPATH\n"
1134    - VENV=venv-petsc-docs &&
1135      python3 -m venv $VENV &&
1136      . $VENV/bin/activate &&
1137      cd doc &&
1138      python3 -m pip install -r requirements.txt
1139
1140#
1141# Build documentation and make available for review using GitLab pages
1142#
1143docs-review:
1144  extends:
1145    - .docs
1146    - .test-basic
1147  script:
1148    - (make html BUILDDIR="../public" SPHINXOPTS="-T -E -W --keep-going -j 1") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1149    - (make latexpdf SPHINXOPTS="-T -E -W --keep-going") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1150    - cp _build/latex/manual.pdf ../public/html/manual/
1151  environment:
1152    name: review/$CI_COMMIT_REF_NAME
1153    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/html/index.html
1154    auto_stop_in: one week
1155    deployment_tier: development
1156  artifacts:
1157    paths:
1158      - public
1159    expire_in: 4 days
1160  except:
1161    variables:
1162      - $PETSC_CI_SCHEDULED =~ /yes/
1163
1164#
1165# Deploy documentation using GitLab pages
1166#
1167pages:  # this job name has special meaning to GitLab
1168  extends: .docs
1169  interruptible: true
1170  script:
1171    - mkdir -p ../public/ && cp public/* ../public/
1172    - (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/) || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1173    - git clean -fdxq && rm -rf images ../arch-classic-docs
1174    - (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/) || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1175    - rm -rf ../public/*/.doctrees
1176  only:
1177    variables:
1178      - $PETSC_CI_SCHEDULED == "yes"
1179  artifacts:
1180    paths:
1181      - public
1182    expire_in: 4 days
1183
1184#
1185#
1186# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
1187# that fail produce a warning, but do not block execution of a pipeline.
1188#
1189
1190.test-experimental:
1191  extends: .test
1192  allow_failure: true
1193
1194