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