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