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