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