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