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