xref: /petsc/.gitlab-ci.yml (revision ae51ba108530e1a8d2aeb8bc3771a24c2fcd801e)
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  PETSC_OPTIONS:  -checkfunctionlist
21  TIMEOUT: 450
22
23#
24# The most basic template that most tests will expand upon
25#
26
27.test-basic:
28  interruptible: true
29  only:
30    refs:
31#     Set with CI/CD Shedules - New Schedule
32      - schedules
33      - api
34#     Set with CI/CD Pipelines - Run Pipeline
35      - web
36      - merge_requests
37  dependencies: []
38
39.test:
40  extends: .test-basic
41  except:
42    variables:
43      # Skip if the docs-only label is attached to a merge request
44      - $CI_MERGE_REQUEST_LABELS =~ /(^|,)docs-only($|,)/
45      - $PETSC_CI_SCHEDULED =~ /yes/
46
47check-ci-settings:
48  extends: .test-basic
49  stage: .pre
50  tags:
51    - gce-stage1
52  script:
53    - lib/petsc/bin/maint/check-ci-settings.sh
54#
55#  This provides the basic order of operations and options template for cloud based stage 1 tests.
56#  Not all test-short need to follow this template but most will.
57#
58
59.stage-1:
60  extends: .test
61  stage: stage-1
62  tags:
63    - gce-u22-stage1
64  before_script:
65    - date
66    - hostname
67    - grep PRETTY_NAME /etc/os-release
68    - nproc
69    - lscpu
70    - ccache --zero-stats
71  script:
72    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
73    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; source ${INIT_SCRIPT}; fi
74    - printf "PATH:$PATH\n"
75    - printf "PYTHONPATH:$PYTHONPATH\n"
76    - printf "CONFIG_OPTS:${CONFIG_OPTS}\n"
77    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
78    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
79    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O -march=native' CXXOPTFLAGS='-O -march=native' FOPTFLAGS='-O -march=native' ${CONFIG_OPTS}
80    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}"
81    - if [ ! -z ${ENABLE_CHECK+x} ]; then make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" check; fi
82    - make CFLAGS="${MAKE_TEST_CFLAGS}" CXXFLAGS="${MAKE_TEST_CXXFLAGS}" FFLAGS="${MAKE_TEST_FFLAGS}" allgtests-tap gmakesearch="${TEST_SEARCH}" TIMEOUT=${TIMEOUT}
83  variables:
84    PYTHON: python3
85    MAKE_CFLAGS: -Werror
86    MAKE_CXXFLAGS: -Werror -Wzero-as-null-pointer-constant
87    MAKE_FFLAGS: -Werror
88    MAKE_TEST_CFLAGS: -Werror
89    MAKE_TEST_CXXFLAGS: -Werror
90    MAKE_TEST_FFLAGS: -Werror
91  after_script:
92    - date
93    - ccache --show-stats
94  artifacts:
95    reports:
96      junit: arch-*/tests/testresults.xml
97    name: "$CI_JOB_NAME"
98    when: always
99    paths:
100    - arch-*/lib/petsc/conf/*.log
101    - arch-*/lib/pkgconfig/petsc.pc
102    - arch-*/tests/testresults.xml
103    - arch-*/tests/test_*_tap.log
104    - arch-*/tests/test_*_err.log
105    expire_in: 4 days
106
107#
108# The following tests run on the cloud as part of stage-1.
109#
110
111ompi-cuda:
112  extends: .stage-1
113  tags:
114  - cuda-stage1
115  variables:
116    CONFIG_OPTS: --with-mpi-dir=/nfs/gce/software/custom/linux-ubuntu22.04-x86_64/spack/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.3.0/openmpi-4.1.3-qrpnszy --with-cuda=1 --with-fc=0
117    TEST_SEARCH: snes_tutorials-ex19_cuda%
118    ENABLE_CHECK: 1
119    MAKE_CXXFLAGS: -Werror
120
121mpich-cxx-py3:
122  extends: .stage-1
123  variables:
124    CONFIG_OPTS: --with-clanguage=cxx --with-fc=0 CXXFLAGS=-std=c++11 --with-strict-petscerrorcode
125    TEST_SEARCH: snes_tutorials-ex48%
126    LOAD_MODULES: gcc/12.1.0 mpich/4.1a1-gcc-12.1.0
127
128uni-complex-float-int64:
129  extends: .stage-1
130  variables:
131    CONFIG_OPTS: --with-mpi=0 --with-scalar-type=complex --with-precision=single --with-64-bit-indices
132    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
133    LOAD_MODULES: gcc/12.1.0 mpich/4.1a1-gcc-12.1.0
134
135c99-mlib-static-py:
136  extends: .stage-1
137  variables:
138    CONFIG_OPTS: --with-single-library=0 --with-shared-libraries=0 --with-strict-petscerrorcode CFLAGS=-std=c99 FFLAGS= CXXFLAGS=
139    ENABLE_CHECK: 1
140    TEST_SEARCH: snes_tutorials-ex19% snes_tutorials-ex5f90t%
141    MAKE_TEST_FFLAGS: -Werror -std=f2008
142    LOAD_MODULES: gcc/12.1.0 mpich/4.1a1-gcc-12.1.0
143
144petsc4py-install:
145  extends: .stage-2
146  tags:
147    - gce-stage2
148  variables:
149    PYTHON: python3
150    T_PREFIX: petsc-install
151    T_DESTDIR: petsc-destdir
152    T_PETSC4PY: src/binding/petsc4py
153    T_VALIDATE_CMD: lib/petsc/bin/maint/validate-petsc4py.sh
154  script:
155    - printf "PATH:$PATH\n"
156    - mkdir hide
157    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
158    - ${PYTHON} ./configure --prefix="${PWD}/${T_PREFIX}" --with-petsc4py=1 --with-debugging=0
159    - make CFLAGS=-Werror CXXFLAGS="-Werror -Wzero-as-null-pointer-constant" FFLAGS=-Werror
160    - printf "====== Test A. Install into staging directory then into prefix directory (mimics distro package recipe) =====\n"
161    - make install DESTDIR="${PWD}/${T_DESTDIR}"
162    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -eq 0
163    - test "$(find ${PWD}/${T_DESTDIR} -mindepth 1 | wc -l)" -gt 0
164    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
165    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
166    - rm -r "${PWD}/${T_PREFIX}" "${PWD}/${T_DESTDIR}" && mkdir "${PWD}/${T_PREFIX}"
167    - printf "====== Test B. Install directly into prefix directory =====\n"
168    - make install
169    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -gt 0
170    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
171    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
172    - printf "====== Test C. Install manually with setuptools =====\n"
173    - export PETSC_DIR="${PWD}/${T_PREFIX}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py build)
174    - export PETSC_DIR="${PWD}/${T_PREFIX}" P="${PWD}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py install --install-lib="${P}/${T_PREFIX}/lib")
175    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
176    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
177    - printf "====== Test D. Install manually with setuptools with staging =====\n"
178    - export PETSC_DIR="${PWD}/${T_PREFIX}" P="${PWD}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py install --root="${P}/${T_DESTDIR}" --install-lib="${P}/${T_PREFIX}/lib")
179    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
180    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
181
182petsc4py-pip:
183  extends: .stage-2
184  tags:
185    - gce-stage2
186  variables:
187    PETSC_CONFIGURE_OPTIONS: --with-mpi=0 --with-fc=0
188    CFLAGS: -O0
189  script:
190    - python3 -m venv pip-builds
191    - source pip-builds/bin/activate
192    - python3 -m pip install --upgrade pip
193    - python3 -m pip install .
194    - python3 -m pip install src/binding/petsc4py
195    - python3 -m petsc4py
196
197checksource:
198  extends: .test-basic
199  stage: .pre
200  tags:
201    - gce-u22-stage1
202  script:
203    - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
204    - vermin --version
205    - make vermin
206    - PATH=/nfs/gce/projects/petsc/soft/u22.04/spack/opt/spack/linux-ubuntu22.04-ivybridge/gcc-11.2.0/llvm-15.0.0-m7mrrtynenjytkmiib2moeqk6kfcifmv/bin:$PATH make checkclangformat SHELL=bash
207    - make checkbadSource SHELL=bash
208    - make checkbadFileChange SHELL=bash
209    - make -f gmakefile check_output SHELL=bash
210    - make check_petsc4py_rst
211  artifacts:
212    name: "$CI_JOB_NAME"
213    when: always
214    paths:
215    - arch-*/lib/petsc/conf/*.patch
216    - arch-*/lib/petsc/conf/*.log
217    expire_in: 4 days
218
219pause-for-approval:
220  extends: .test
221  stage: .pre
222  tags:
223    - gce-stage1
224  only:
225    refs:
226      - merge_requests
227    variables:
228      - $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result"
229      - $CI_MERGE_REQUEST_EVENT_TYPE == "detached"
230  script:
231    - echo "pause-for-approval has no script to run"
232  variables:
233    GIT_STRATEGY: none
234  when: manual
235  allow_failure: false
236
237#
238# This provides the basic order of operations and options template for stage-2,3 tests.
239# Not all stage-2,3 need to follow this template, but most will.
240#
241.stage-23:
242  extends: .test
243  script:
244    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
245    - if [ ! -z ${GCOV_MODULES+x} ]; then module --trace load ${GCOV_MODULES}; module list; fi
246    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; source ${INIT_SCRIPT}; fi
247    - if [ ! -z ${RUN_GCOV+x} ]; then gcovr --version; fi
248    - if [ -d ${HOME}/petsc-hash-pkgs/ ]; then find ${HOME}/petsc-hash-pkgs/ -maxdepth 1 -mindepth 1 -type d -mtime +25 -exec rm -rf {} \; ; fi
249    - printf "PATH:$PATH\n"
250    - printf "PYTHONPATH:$PYTHONPATH\n"
251    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
252    - 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
253    - printf "./config/examples/${TEST_ARCH}.py\n"
254    - cat ./config/examples/${TEST_ARCH}.py
255    - ./config/examples/${TEST_ARCH}.py || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
256    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
257    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" check || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
258    - make updatedatafiles
259    - 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
260    - 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
261    - if [ ! -z ${RUN_GCOV_OPTIONS+x} ]; then printf "RUN_GCOV_OPTIONS:$RUN_GCOV_OPTIONS\n"; fi
262    - if [ ! -z ${RUN_GCOV+x} ]; then make gcov PETSC_GCOV_OPTIONS="${RUN_GCOV_OPTIONS}"; fi
263  artifacts:
264    reports:
265      junit: ${TEST_ARCH}/tests/testresults.xml
266    name: "$CI_JOB_NAME"
267    when: always
268    paths:
269    - ${TEST_ARCH}/lib/petsc/conf/*.log
270    - ${TEST_ARCH}/lib/pkgconfig/petsc.pc
271    - ${TEST_ARCH}/tests/testresults.xml
272    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
273    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
274    - ${TEST_ARCH}/${TEST_ARCH}-gcovr-report.json.tar.gz
275    expire_in: 4 days
276  variables:
277    OPENBLAS_NUM_THREADS: 1
278
279.stage-2:
280  extends: .stage-23
281  stage: stage-2
282
283.stage-3:
284  extends: .stage-23
285  stage: stage-3
286
287#
288# The following provide templates for various OSes for pre/post info
289#
290
291.linux_test_noflags:
292  before_script:
293    - date
294    - hostname
295    - grep PRETTY_NAME /etc/os-release
296    - nproc
297    - lscpu
298    - ccache --zero-stats
299  after_script:
300    - date
301    - ccache --show-stats
302
303.linux_test_nofflags:
304  extends: .linux_test_noflags
305  variables:
306    MAKE_CFLAGS: -Werror
307    MAKE_CXXFLAGS: -Werror
308
309.linux_test:
310  extends: .linux_test_noflags
311  variables:
312    MAKE_CFLAGS: -Werror
313    MAKE_CXXFLAGS: -Werror
314    MAKE_FFLAGS: -Werror
315
316.coverage-generate:
317  variables:
318    RUN_GCOV: 1
319    RUN_GCOV_OPTIONS: --decisions
320
321.coverage-generate-u18:
322  extends: .coverage-generate
323  variables:
324    GCOV_MODULES: py-gcovr-5.2-gcc-7.5.0-o7fu4xq python-3.9.13-gcc-7.5.0-fq67pdh
325
326.coverage-generate-u22:
327  extends: .coverage-generate
328  variables:
329    GCOV_MODULES: py-gcovr-5.2-gcc-11.2.0-wcsmyet
330
331.freebsd_test:
332  variables:
333    MAKE_CFLAGS: -Werror
334    MAKE_CXXFLAGS: -Werror
335    MAKE_FFLAGS: -Werror
336  before_script:
337    - date
338    - hostname
339    - freebsd-version
340    - echo $(sysctl -n hw.ncpu)
341    - ccache --zero-stats
342  after_script:
343    - date
344    - ccache --show-stats
345
346.osx_test:
347  variables:
348    MAKE_CFLAGS: -Werror
349    MAKE_CXXFLAGS: -Werror
350    MAKE_FFLAGS: -Werror
351  before_script:
352    - date
353    - hostname
354    - sw_vers -productVersion
355    - echo $(sysctl -n hw.ncpu)
356    - ccache --zero-stats
357  after_script:
358    - date
359    - ccache --show-stats
360
361.opensolaris_test:
362  before_script:
363    - date
364    - hostname
365    - uname -a
366    - nproc
367    - isainfo -x
368  after_script:
369    - date
370
371.mswin_test:
372  before_script:
373    - date
374    - hostname
375    - uname -a
376    - nproc
377  after_script:
378    - date
379
380#
381# The following tests run as part of stage-2.
382#
383# The tags variable used in the tests below connects the particular test with the runners
384# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
385# For example the test linux-sycl-double any runner that has the tags 'gce-nfs, linux-fast'
386# (in a blue box beneath it)
387#
388
389osx-m1:
390  extends:
391    - .stage-3
392    - .osx_test
393  tags:
394    - os:macos-m1
395  variables:
396    TEST_ARCH: arch-ci-osx-m1
397    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
398    INIT_SCRIPT: /Volumes/Scratch/svcpetsc/soft/py3venv/cython3setup.sh
399
400freebsd-cxx-cmplx-64idx-dbg:
401  extends:
402    - .stage-2
403    - .freebsd_test
404  tags:
405    - os:fbsd
406  variables:
407    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
408
409freebsd-c-single-opt:
410  extends:
411    - .stage-2
412    - .freebsd_test
413  tags:
414    - os:fbsd
415  variables:
416    TEST_ARCH: arch-ci-freebsd-c-single-opt
417
418mswin-opt-impi:
419  extends:
420    - .stage-3
421    - .mswin_test
422  tags:
423    - mswin-stage3
424  variables:
425    TEST_ARCH: arch-ci-mswin-opt-impi
426    TEST_OPTS: search='ksp_ksp_tests*'
427
428linux-gcc-quad-64idx-dbg:
429  extends:
430    - .stage-2
431    - .linux_test
432  tags:
433    - gce-stage2
434  variables:
435    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
436
437linux-gcc-pkgs-opt:
438  extends:
439    - .stage-2
440    - .linux_test
441  tags:
442    - gce-stage2
443  variables:
444    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
445
446linux-gcc-complex-opt-32bit:
447  extends:
448    - .stage-2
449    - .linux_test
450  tags:
451    - gce-stage2
452  variables:
453    TEST_ARCH: arch-ci-linux-gcc-complex-opt-32bit
454
455linux-emcc:
456  extends:
457    - .stage-2
458    - .linux_test
459  tags:
460    - gce-stage2
461  variables:
462    TEST_ARCH: arch-ci-linux-emcc
463    INIT_SCRIPT: /nfs/gce/projects/petsc/soft/u22.04/emsdk/emsdk_env.sh
464    DISABLE_TESTS: 1
465
466#
467# The following tests run as part of stage-3.
468#
469
470freebsd-cxx-cmplx-pkgs-dbg:
471  extends:
472    - .stage-3
473    - .freebsd_test
474  tags:
475    - os:fbsd
476  variables:
477    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-pkgs-dbg
478
479freebsd-cxx-pkgs-opt:
480  extends:
481    - .stage-3
482    - .freebsd_test
483  tags:
484    - os:fbsd
485  variables:
486    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false -checkfunctionlist
487    TEST_ARCH: arch-ci-freebsd-cxx-pkgs-opt
488
489freebsd-pkgs-opt:
490  extends:
491    - .stage-3
492    - .freebsd_test
493  tags:
494    - os:fbsd
495  variables:
496    TEST_ARCH: arch-ci-freebsd-pkgs-opt
497
498linux-hip-double:
499  extends:
500    - .stage-3
501    - .linux_test_noflags
502  tags:
503    - gpu:amd, os:linux
504  variables:
505    TEST_ARCH: arch-ci-linux-hip-double
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    - ${TEST_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  artifacts:
930    reports:
931    paths:
932    - arch-*/lib/petsc/conf/*.log
933    expire_in: 4 days
934
935#mswin-intel:
936#  extends:
937#    - .stage-3
938#    - .mswin_test
939#  tags:
940#    - os:win
941#  variables:
942#    TEST_ARCH: arch-ci-mswin-intel
943
944opensolaris-pkgs-opt:
945  extends:
946    - .stage-3
947    - .opensolaris_test
948  tags:
949    - name:n-gage
950  variables:
951    TEST_ARCH: arch-ci-opensolaris-pkgs-opt
952
953opensolaris-cmplx-pkgs-dbg:
954  extends:
955    - .stage-3
956    - .opensolaris_test
957  tags:
958    - name:n-gage
959  variables:
960    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
961
962opensolaris-misc:
963  extends:
964    - .stage-3
965    - .opensolaris_test
966  tags:
967    - name:n-gage
968  variables:
969    TEST_ARCH: arch-ci-opensolaris-misc
970
971osx-cxx-cmplx-pkgs-dbg:
972  extends:
973    - .stage-3
974    - .osx_test
975  tags:
976    - os:macos
977  variables:
978    TEST_ARCH: arch-ci-osx-cxx-cmplx-pkgs-dbg
979    INIT_SCRIPT: /Users/glci/bin/py3.sh
980
981osx-cxx-pkgs-opt:
982  extends:
983    - .stage-3
984    - .osx_test
985  tags:
986    - os:macos, opt
987  variables:
988    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false -checkfunctionlist
989    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
990    MAKE_CXXFLAGS: -Werror -Wno-pass-failed
991
992osx-dbg:
993  extends:
994    - .stage-3
995    - .osx_test
996  tags:
997    - os:macos
998  variables:
999    TEST_ARCH: arch-ci-osx-dbg
1000
1001osx-xsdk-opt:
1002  extends:
1003    - .stage-3
1004    - .osx_test
1005  tags:
1006    - os:macos, opt
1007  variables:
1008    TEST_ARCH: arch-ci-osx-xsdk-opt
1009
1010# job for analyzing the coverage results and generating the various reports
1011analyze-coverage:
1012  extends: .test
1013  stage: stage-4
1014  tags:
1015    - gce-nfs-short
1016  dependencies:
1017    - linux-pkgs-gcov
1018    - linux-matlab-ilp64-gcov
1019    - linux-cuda-pkgs-gcov
1020    - linux-cxx-cmplx-pkgs-64idx-gcov
1021  variables:
1022    PYTHON: python3
1023    PETSC_ARCH: arch-ci-analyze-pipeline
1024    LOAD_MODULES: python-3.9.13-gcc-7.5.0-fq67pdh py-gcovr-5.2-gcc-7.5.0-o7fu4xq
1025  before_script:
1026    - date
1027    - hostname
1028  script:
1029    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
1030    - ${PYTHON} --version
1031    - gcovr --version
1032    - printf "PATH:$PATH\n"
1033    - printf "PYTHONPATH:$PYTHONPATH\n"
1034    - 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
1035    - ${PYTHON} ./configure --with-mpi=0 --with-cxx=0 --download-sowing --with-fortran-bindings
1036    - make mergegcov PETSC_GCOV_OPTIONS='--ci-mode --verbose'
1037  coverage: /^\s*lines:\s*\d+.\d+\%/
1038  artifacts:
1039    name: "$CI_JOB_NAME"
1040    when: always
1041    paths:
1042    - arch-ci-analyze-pipeline/gcovr/*
1043    - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1044    expire_in: 4 days
1045    reports:
1046      coverage_report:
1047        coverage_format: cobertura
1048        path: arch-ci-analyze-pipeline/gcovr/xml/*.xml
1049
1050# template for the coverage review jobs, these must be separate jobs as you cannot deploy multiple
1051# environments from one job...
1052.coverage-review:
1053  extends: .test
1054  stage: .post
1055  tags:
1056    - gce-nfs-short
1057  dependencies:
1058    - analyze-coverage
1059  script:
1060    - date
1061    - hostname
1062  artifacts:
1063    name: "$CI_JOB_NAME"
1064    when: always
1065    paths:
1066    - arch-ci-analyze-pipeline/gcovr/*
1067    - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1068    expire_in: 4 days
1069
1070coverage-total-review:
1071  extends: .coverage-review
1072  environment:
1073    name: coverage/all/$CI_COMMIT_REF_SLUG
1074    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/arch-ci-analyze-pipeline/gcovr/html/report.html
1075    auto_stop_in: one week
1076    deployment_tier: testing
1077
1078coverage-untested-review:
1079  extends: .coverage-review
1080  environment:
1081    name: coverage/untested/$CI_COMMIT_REF_SLUG
1082    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
1083    auto_stop_in: one week
1084    deployment_tier: testing
1085
1086analyze-pipeline:
1087  extends: .coverage-review
1088  script:
1089    - date
1090    - hostname
1091    # This file is created by lib/petsc/bin/maint/gcov.py. If it exists then the CI
1092    # pipeline should fail
1093    - if [ -f ./arch-ci-analyze-pipeline/gcovr/.CI_FAIL ]; then
1094        cat ./arch-ci-analyze-pipeline/gcovr/merge_gcov_errors.log;
1095        exit 1;
1096      fi
1097
1098#
1099# Base job for a documentation build
1100#
1101.docs:
1102  stage: stage-3
1103  tags:
1104    - gce-stage2
1105  before_script:
1106    - VENV=venv-petsc-docs &&
1107      python3 -m venv $VENV &&
1108      . $VENV/bin/activate &&
1109      cd doc &&
1110      pip install -r requirements.txt
1111
1112#
1113# Build documentation and make available for review using GitLab pages
1114#
1115docs-review:
1116  extends:
1117    - .docs
1118    - .test-basic
1119  script:
1120    - (make html BUILDDIR="../public" SPHINXOPTS="-T -E -W --keep-going -j 1") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1121    - (make latexpdf SPHINXOPTS="-T -E -W --keep-going") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1122    - cp _build/latex/manual.pdf ../public/html/docs/manual/
1123  environment:
1124    name: review/$CI_COMMIT_REF_NAME
1125    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/html/index.html
1126  artifacts:
1127    paths:
1128      - public
1129    expire_in: 4 days
1130  except:
1131    variables:
1132      - $PETSC_CI_SCHEDULED =~ /yes/
1133
1134#
1135# Deploy documentation using GitLab pages
1136#
1137pages:  # this job name has special meaning to GitLab
1138  extends: .docs
1139  interruptible: true
1140  script:
1141    - mkdir -p ../public/ && cp public/* ../public/
1142    - git fetch --unshallow --no-tags origin +release:remotes/origin/release +main:remotes/origin/main
1143    - 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/
1144    - make clean BUILDDIR="../public/release"
1145    - 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/
1146    - rm -rf ../public/*/.doctrees
1147  only:
1148    variables:
1149      - $PETSC_CI_SCHEDULED == "yes"
1150  artifacts:
1151    paths:
1152      - public
1153    expire_in: 4 days
1154
1155#
1156#
1157# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
1158# that fail produce a warning, but do not block execution of a pipeline.
1159#
1160
1161.test-experimental:
1162  extends: .test
1163  allow_failure: true
1164
1165