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