xref: /petsc/.gitlab-ci.yml (revision 3f3109e558dcee6a4bd03e311a2be6bb45076d8c)
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
16variables:
17  GIT_STRATEGY: fetch
18  GIT_CLEAN_FLAGS: -ffdxq
19  PETSC_OPTIONS: -checkstack
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-stage1
63  before_script:
64    - date
65    - hostname
66    - grep PRETTY_NAME /etc/os-release
67    - nproc
68    - lscpu
69    - ccache --zero-stats
70    - echo ${CONFIG_OPTS}
71  script:
72    - printf "PATH:$PATH\n"
73    - printf "PYTHONPATH:$PYTHONPATH\n"
74    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
75    - 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
76    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O3 -march=native' CXXOPTFLAGS='-O3 -march=native' FOPTFLAGS='-O3 -march=native' ${CONFIG_OPTS}
77    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}"
78    - make CFLAGS="${MAKE_TEST_CFLAGS}" CXXFLAGS="${MAKE_TEST_CXXFLAGS}" FFLAGS="${MAKE_TEST_FFLAGS}" allgtests-tap gmakesearch="${TEST_SEARCH}" TIMEOUT=${TIMEOUT}
79  variables:
80    PYTHON: python3
81    MAKE_CFLAGS: -Werror
82    MAKE_CXXFLAGS: -Werror -Wzero-as-null-pointer-constant
83    MAKE_FFLAGS: -Werror
84    MAKE_TEST_CFLAGS: -Werror
85    MAKE_TEST_CXXFLAGS: -Werror
86    MAKE_TEST_FFLAGS: -Werror
87  after_script:
88    - date
89    - ccache --show-stats
90  artifacts:
91    reports:
92      junit: arch-*/tests/testresults.xml
93    name: "$CI_JOB_NAME"
94    when: always
95    paths:
96    - arch-*/lib/petsc/conf/*.log
97    - arch-*/lib/pkgconfig/petsc.pc
98    - arch-*/tests/testresults.xml
99    - arch-*/tests/test_*_tap.log
100    - arch-*/tests/test_*_err.log
101    expire_in: 4 days
102
103#
104# The following tests run on the cloud as part of stage-1.
105#
106
107ompi-cuda:
108  extends: .stage-1
109  tags:
110  - cuda-stage1
111  variables:
112    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
113    TEST_SEARCH: snes_tutorials-ex19_cuda%
114    MAKE_CXXFLAGS: -Werror
115
116mpich-cxx-py3:
117  extends: .stage-1
118  variables:
119    CONFIG_OPTS: --with-clanguage=cxx --with-fc=0 CXXFLAGS=-std=c++11
120    TEST_SEARCH: snes_tutorials-ex48%
121
122uni-complex-float-int64:
123  extends: .stage-1
124  variables:
125    CONFIG_OPTS: --with-mpi=0 --with-scalar-type=complex --with-precision=single --with-64-bit-indices
126    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
127
128c99-mlib-static-py:
129  extends: .stage-1
130  variables:
131    CONFIG_OPTS: --with-single-library=0 --with-shared-libraries=0 CFLAGS=-std=c99
132    TEST_SEARCH: snes_tutorials-ex19% snes_tutorials-ex5f90t%
133    MAKE_TEST_FFLAGS: -Werror -std=f2008
134
135petsc4py-install:
136  extends: .stage-2
137  tags:
138    - gce-stage2
139  variables:
140    PYTHON: python3
141    T_PREFIX: petsc-install
142    T_DESTDIR: petsc-destdir
143    T_PETSC4PY: src/binding/petsc4py
144    T_VALIDATE_CMD: lib/petsc/bin/maint/validate-petsc4py.sh
145  script:
146    - printf "PATH:$PATH\n"
147    - mkdir hide
148    - 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
149    - ${PYTHON} ./configure --prefix="${PWD}/${T_PREFIX}" --with-petsc4py=1 --with-debugging=0
150    - make CFLAGS=-Werror CXXFLAGS="-Werror -Wzero-as-null-pointer-constant" FFLAGS=-Werror
151    - printf "====== Test A. Install into staging directory then into prefix directory (mimics distro package recipe) =====\n"
152    - make install DESTDIR="${PWD}/${T_DESTDIR}"
153    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -eq 0
154    - test "$(find ${PWD}/${T_DESTDIR} -mindepth 1 | wc -l)" -gt 0
155    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
156    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
157    - rm -r "${PWD}/${T_PREFIX}" "${PWD}/${T_DESTDIR}" && mkdir "${PWD}/${T_PREFIX}"
158    - printf "====== Test B. Install directly into prefix directory =====\n"
159    - make install
160    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -gt 0
161    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
162    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
163    - printf "====== Test C. Install manually with setuptools =====\n"
164    - export PETSC_DIR="${PWD}/${T_PREFIX}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py build)
165    - export PETSC_DIR="${PWD}/${T_PREFIX}" P="${PWD}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py install --install-lib="${P}/${T_PREFIX}/lib")
166    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
167    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
168    - printf "====== Test D. Install manually with setuptools with staging =====\n"
169    - 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")
170    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
171    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
172
173petsc4py-pip:
174  extends: .stage-2
175  tags:
176    - gce-stage2
177  variables:
178    PETSC_CONFIGURE_OPTIONS: --with-mpi=0 --with-fc=0
179    CFLAGS: -O0
180  script:
181    - python3 -m venv pip-builds
182    - source pip-builds/bin/activate
183    - python3 -m pip install --upgrade pip
184    - python3 -m pip install .
185    - python3 -m pip install src/binding/petsc4py
186    - python3 -m petsc4py
187
188checksource:
189  extends: .test-basic
190  stage: .pre
191  tags:
192    - gce-stage1
193  script:
194    - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
195    - vermin --version
196    - make vermin
197    - make checkbadSource SHELL=bash
198    - make -f gmakefile check_output SHELL=bash
199    - make check_petsc4py_rst
200
201pause-for-approval:
202  extends: .test
203  stage: .pre
204  tags:
205    - gce-stage1
206  only:
207    refs:
208      - merge_requests
209    variables:
210      - $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result"
211      - $CI_MERGE_REQUEST_EVENT_TYPE == "detached"
212  script:
213    - echo "pause-for-approval has no script to run"
214  variables:
215    GIT_STRATEGY: none
216  when: manual
217  allow_failure: false
218
219#
220# This provides the basic order of operations and options template for stage-2,3 tests.
221# Not all stage-2,3 need to follow this template, but most will.
222#
223.stage-23:
224  extends: .test
225  script:
226    - if [ -d ${HOME}/petsc-hash-pkgs/ ]; then find ${HOME}/petsc-hash-pkgs/ -maxdepth 1 -mindepth 1 -type d -mtime +25 -exec rm -rf {} \; ; fi
227    - printf "PATH:$PATH\n"
228    - printf "PYTHONPATH:$PYTHONPATH\n"
229    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
230    - 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
231    - printf "./config/examples/${TEST_ARCH}.py\n"
232    - cat ./config/examples/${TEST_ARCH}.py
233    - ./config/examples/${TEST_ARCH}.py
234    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}"
235    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" check
236    - make updatedatafiles
237    - 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
238    - if [ -z ${DISABLE_TESTS+x} ]; then make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" cleantest allgtests-tap TIMEOUT=${TIMEOUT}  ${TEST_OPTS}; fi
239    - if [ ! -z ${RUN_GCOV+x} ]; then make gcov; fi
240  artifacts:
241    reports:
242      junit: ${TEST_ARCH}/tests/testresults.xml
243    name: "$CI_JOB_NAME"
244    when: always
245    paths:
246    - ${TEST_ARCH}/lib/petsc/conf/*.log
247    - ${TEST_ARCH}/lib/pkgconfig/petsc.pc
248    - ${TEST_ARCH}/tests/testresults.xml
249    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
250    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
251    - ${TEST_ARCH}/gcov.tar.gz
252    expire_in: 4 days
253  variables:
254    OPENBLAS_NUM_THREADS: 1
255
256.stage-2:
257  extends: .stage-23
258  stage: stage-2
259
260.stage-3:
261  extends: .stage-23
262  stage: stage-3
263
264#
265# The following provide templates for various OSes for pre/post info
266#
267
268.linux_test_noflags:
269  before_script:
270    - date
271    - hostname
272    - grep PRETTY_NAME /etc/os-release
273    - nproc
274    - lscpu
275    - ccache --zero-stats
276    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
277    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; source ${INIT_SCRIPT}; fi
278  after_script:
279    - date
280    - ccache --show-stats
281
282.linux_test_nofflags:
283  extends: .linux_test_noflags
284  variables:
285    MAKE_CFLAGS: -Werror
286    MAKE_CXXFLAGS: -Werror
287
288.linux_test:
289  extends: .linux_test_noflags
290  variables:
291    MAKE_CFLAGS: -Werror
292    MAKE_CXXFLAGS: -Werror
293    MAKE_FFLAGS: -Werror
294
295.freebsd_test:
296  variables:
297    MAKE_CFLAGS: -Werror
298    MAKE_CXXFLAGS: -Werror
299    MAKE_FFLAGS: -Werror
300  before_script:
301    - date
302    - hostname
303    - freebsd-version
304    - echo $(sysctl -n hw.ncpu)
305    - ccache --zero-stats
306  after_script:
307    - date
308    - ccache --show-stats
309
310.osx_test:
311  variables:
312    MAKE_CFLAGS: -Werror
313    MAKE_CXXFLAGS: -Werror
314    MAKE_FFLAGS: -Werror
315  before_script:
316    - date
317    - hostname
318    - sw_vers -productVersion
319    - echo $(sysctl -n hw.ncpu)
320    - ccache --zero-stats
321    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; source ${INIT_SCRIPT}; fi
322  after_script:
323    - date
324    - ccache --show-stats
325
326.opensolaris_test:
327  before_script:
328    - date
329    - hostname
330    - uname -a
331    - nproc
332    - isainfo -x
333  after_script:
334    - date
335
336.mswin_test:
337  before_script:
338    - date
339    - hostname
340    - uname -a
341    - nproc
342  after_script:
343    - date
344
345#
346# The following tests run as part of stage-2.
347#
348# The tags variable used in the tests below connects the particular test with the runners
349# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
350# For example the test linux-sycl-double any runner that has the tags 'gce-nfs, linux-fast'
351# (in a blue box beneath it)
352#
353
354osx-m1:
355  extends:
356    - .stage-3
357    - .osx_test
358  tags:
359    - os:macos-m1
360  variables:
361    TEST_ARCH: arch-ci-osx-m1
362    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
363    INIT_SCRIPT: /Volumes/Scratch/svcpetsc/soft/py3venv/cython3setup.sh
364
365freebsd-cxx-cmplx-64idx-dbg:
366  extends:
367    - .stage-2
368    - .freebsd_test
369  tags:
370    - os:fbsd
371  variables:
372    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
373
374freebsd-c-single-opt:
375  extends:
376    - .stage-2
377    - .freebsd_test
378  tags:
379    - os:fbsd
380  variables:
381    TEST_ARCH: arch-ci-freebsd-c-single-opt
382
383linux-gcc-quad-64idx-dbg:
384  extends:
385    - .stage-2
386    - .linux_test
387  tags:
388    - gce-stage2
389  variables:
390    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
391
392linux-gcc-pkgs-opt:
393  extends:
394    - .stage-2
395    - .linux_test
396  tags:
397    - gce-stage2
398  variables:
399    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
400
401linux-gcc-complex-opt-32bit:
402  extends:
403    - .stage-2
404    - .linux_test
405  tags:
406    - gce-stage2
407  variables:
408    TEST_ARCH: arch-ci-linux-gcc-complex-opt-32bit
409
410#do not run checkstack on MSWIN-UNI
411mswin-uni:
412  extends:
413    - .stage-3
414    - .mswin_test
415  tags:
416    - win-stage2
417  variables:
418    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
419    TEST_ARCH: arch-ci-mswin-uni
420
421mswin-gnu:
422  extends:
423    - .stage-3
424    - .mswin_test
425  tags:
426    - win-stage2
427  variables:
428    TEST_ARCH: arch-ci-mswin-gnu
429    MAKE_CFLAGS: -Werror
430    MAKE_CXXFLAGS: -Werror
431    MAKE_FFLAGS: -Werror
432    DISABLE_TESTS: 1
433  artifacts:
434    reports:
435    paths:
436    - arch-*/lib/petsc/conf/*.log
437    expire_in: 4 days
438
439#
440# The following tests run as part of stage-3.
441#
442
443freebsd-cxx-cmplx-pkgs-dbg:
444  extends:
445    - .stage-3
446    - .freebsd_test
447  tags:
448    - os:fbsd
449  variables:
450    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-pkgs-dbg
451
452freebsd-cxx-pkgs-opt:
453  extends:
454    - .stage-3
455    - .freebsd_test
456  tags:
457    - os:fbsd
458  variables:
459    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false -checkstack
460    TEST_ARCH: arch-ci-freebsd-cxx-pkgs-opt
461
462freebsd-pkgs-opt:
463  extends:
464    - .stage-3
465    - .freebsd_test
466  tags:
467    - os:fbsd
468  variables:
469    TEST_ARCH: arch-ci-freebsd-pkgs-opt
470
471linux-hip-double:
472  extends:
473    - .stage-3
474    - .linux_test_noflags
475  tags:
476    - gpu:amd, os:linux
477  variables:
478    TEST_ARCH: arch-ci-linux-hip-double
479
480linux-sycl-double:
481  extends:
482    - .stage-3
483    - .linux_test_noflags
484  tags:
485    - gce-nfs, linux-fast
486  variables:
487    TEST_ARCH: arch-ci-linux-sycl-double
488    LOAD_MODULES: compiler/latest mpi/latest cmake/3.20.5-yjp2hz6
489    TEST_OPTS: query=requires queryval=kokkos_kernels
490
491linux-cuda-pkgs:
492  extends:
493    - .stage-3
494    - .linux_test
495  tags:
496    - cuda-stage3
497  variables:
498    TEST_ARCH: arch-ci-linux-cuda-pkgs
499    TEST_OPTS: -j3 query=requires queryval=cuda
500
501linux-cuda112-gcov:
502  extends:
503    - .stage-3
504    - .linux_test
505  tags:
506    - cuda-stage3
507  variables:
508    TEST_ARCH: arch-ci-linux-cuda112-gcov
509    LOAD_MODULES: cuda/11.2.2 gcc/9.4.0
510    RUN_GCOV: 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:isdp001
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:isdp001
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:isdp001
606  variables:
607    TEST_ARCH: arch-ci-linux-knl
608
609linux-intel-mkl-single:
610  extends:
611    - .stage-3
612    - .linux_test_nofflags
613  tags:
614    - name:isdp001
615  variables:
616    TEST_ARCH: arch-ci-linux-intel-mkl-single
617
618linux-cxx-cmplx-pkgs-64idx:
619  extends:
620    - .stage-3
621    - .linux_test
622  tags:
623    - gce-nfs
624  variables:
625    TEST_ARCH: arch-ci-linux-cxx-cmplx-pkgs-64idx
626    LOAD_MODULES: llvm/9.0.0-7fyffox gcc/8.3.0-fjpc5ys cmake/3.14.2-rl3q676
627
628# Set env vars for 'Kokkos + OpenMP' tests, so that they won't give warnings
629linux-pkgs-dbg-ftn-interfaces:
630  extends:
631    - .stage-3
632    - .linux_test
633  tags:
634    - gce-nfs
635  variables:
636    TEST_ARCH: arch-ci-linux-pkgs-dbg-ftn-interfaces
637    LOAD_MODULES: cmake/3.20.5-yjp2hz6
638    OMP_PROC_BIND: "false"
639    OMP_NUM_THREADS: 4
640
641linux-pkgs-cxx-mlib:
642  extends:
643    - .stage-3
644    - .linux_test
645  tags:
646    - gce-nfs
647  variables:
648    TEST_ARCH: arch-ci-linux-pkgs-cxx-mlib
649    LOAD_MODULES: gcc/11.1.0-5ikoznk cmake/3.20.5-yjp2hz6
650
651linux-pkgs-valgrind:
652  extends:
653    - .stage-3
654    - .linux_test
655  tags:
656    - gce-valgrind
657  variables:
658    TEST_ARCH: arch-ci-linux-pkgs-valgrind
659    TIMEOUT: 7200
660
661linux-pkgs-opt:
662  extends:
663    - .stage-3
664    - .linux_test
665  tags:
666    - gce-nfs, linux-fast
667  variables:
668    TEST_ARCH: arch-ci-linux-pkgs-opt
669    LOAD_MODULES: gcc/10.1.0-5hiqhdh
670
671linux-pkgs-gcov:
672  extends:
673    - .stage-3
674    - .linux_test
675  tags:
676    - gce-nfs, linux-gcov
677  variables:
678    TEST_ARCH: arch-ci-linux-pkgs-gcov
679    RUN_GCOV: 1
680
681linux-cmplx-gcov:
682  extends:
683    - .stage-3
684    - .linux_test
685  tags:
686    - gce-nfs, linux-gcov
687  variables:
688    PETSC_OPTIONS:  -vecscatter_mpi1 false -options_left false -checkstack
689    TEST_ARCH: arch-ci-linux-cmplx-gcov
690    LOAD_MODULES: gcc/8.3.0-fjpc5ys
691    RUN_GCOV: 1
692
693linux-matlab-ilp64-gcov:
694  extends:
695    - .stage-3
696    - .linux_test
697  tags:
698    - gce-nfs, linux-gcov
699  variables:
700    TEST_ARCH: arch-ci-linux-matlab-ilp64-gcov
701    LOAD_MODULES: matlab/R2018a
702    RUN_GCOV: 1
703  allow_failure: true
704
705linux-gcov:
706  extends:
707    - .stage-3
708    - .linux_test
709  tags:
710    - gce-nfs, linux-gcov
711  variables:
712    TEST_ARCH: arch-ci-linux-gcov
713    RUN_GCOV: 1
714
715linux-pgi:
716  extends:
717    - .stage-3
718    - .linux_test_noflags
719  tags:
720    - gce-nfs, linux-mcpu
721  variables:
722    TEST_ARCH: arch-ci-linux-pgi
723    LOAD_MODULES: hpc_sdk/20.9
724
725# If the Nag license server fails then ${PETSC_DIR}/naglicenseproblem is created and the job is marked as failed but allow_failure
726linux-nagfor:
727  extends:
728    - .stage-3
729    - .linux_test_nofflags
730  tags:
731    - gce-nfs, linux-mcpu
732  script:
733    - rm -f naglicenseproblem
734    - printf "PATH:$PATH\n"
735    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
736    - 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
737    - printf "./config/examples/${TEST_ARCH}.py\n"
738    - cat ./config/examples/${TEST_ARCH}.py
739    - ./config/examples/${TEST_ARCH}.py || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
740    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
741    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" check || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
742    - make updatedatafiles
743    - 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
744  variables:
745    LOAD_MODULES: nag/6.1
746    TEST_ARCH: arch-ci-linux-nagfor
747  allow_failure:
748    exit_codes: 126
749
750linux-intel-cmplx:
751  extends:
752    - .stage-3
753    - .linux_test_nofflags
754  tags:
755    - gce-nfs
756  variables:
757    TEST_ARCH: arch-ci-linux-intel-cmplx
758    LOAD_MODULES: intel-mkl/19.5 intel/19.0-nompilib cmake/3.20.5-yjp2hz6
759    ENABLE_PETSC4PY_LDPRELOAD: 1
760
761linux-xsdk-dbg:
762  extends:
763    - .stage-3
764    - .linux_test
765  tags:
766    - gce-nfs
767  variables:
768    TEST_ARCH: arch-ci-linux-xsdk-dbg
769    LOAD_MODULES: gcc/8.3.0-fjpc5ys
770
771linux-analyzer:
772  extends:
773    - .stage-2
774    - .linux_test
775  tags:
776    - gce-u22-stage2
777  script:
778    - printf "PATH:$PATH\n"
779    - printf "PYTHONPATH:$PYTHONPATH\n"
780    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
781    - 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
782    - printf "./config/examples/${TEST_ARCH}.py\n"
783    - cat ./config/examples/${TEST_ARCH}.py
784    - ./config/examples/${TEST_ARCH}.py
785    - make LINTER_OPTIONS="${LINTER_OPTIONS}" test-lint
786    - make LINTER_OPTIONS="${LINTER_OPTIONS}" lint
787  variables:
788    TEST_ARCH: arch-ci-linux-analyzer
789    LINTER_OPTIONS: "--PETSC_ARCH=${TEST_ARCH} --clang_lib=`llvm-config-14 --libdir`/libclang.so.1 --verbose --werror"
790  artifacts:
791    paths:
792    - ${TEST_ARCH}/lib/petsc/conf/*.log
793    - ./petscLintPatches/*.patch
794
795linux-intel:
796  extends:
797    - .stage-3
798    - .linux_test_nofflags
799  tags:
800    - gce-nfs
801  variables:
802    TEST_ARCH: arch-ci-linux-intel
803    LOAD_MODULES: intel-mkl/19.5 intel/19.0-nompilib
804
805linux-opt-misc:
806  extends:
807    - .stage-3
808    - .linux_test
809  tags:
810    - gce-nfs, linux-fast
811  variables:
812    TEST_ARCH: arch-ci-linux-opt-misc
813    LOAD_MODULES: gcc/6.5.0-57usejd
814
815linux-pkgs-64idx:
816  extends:
817    - .stage-3
818    - .linux_test
819  tags:
820    - gce-nfs, linux-mcpu
821  variables:
822    TEST_ARCH: arch-ci-linux-pkgs-64idx
823    LOAD_MODULES: cmake/3.20.5-yjp2hz6 intel-mkl/19.5
824
825linux-64idx-i8:
826  extends:
827    - .stage-3
828    - .linux_test
829  tags:
830    - gce-nfs
831  variables:
832    TEST_ARCH: arch-ci-linux-64idx-i8
833
834linux-gcc-ifc-cmplx:
835  extends:
836    - .stage-3
837    - .linux_test_nofflags
838  tags:
839    - gce-nfs
840  variables:
841    TEST_ARCH: arch-ci-linux-gcc-ifc-cmplx
842    LOAD_MODULES: intel/19.0-nompilib cmake/3.20.0-vov726r
843
844linux-opt-cxx-quad:
845  extends:
846    - .stage-3
847    - .linux_test
848  tags:
849    - gce-nfs
850  variables:
851    TEST_ARCH: arch-ci-linux-opt-cxx-quad
852
853linux-ILP64:
854  extends:
855    - .stage-3
856    - .linux_test
857  tags:
858    - gce-nfs
859  variables:
860    TEST_ARCH: arch-ci-linux-ILP64
861    LOAD_MODULES: mpich/2-1.5-gcc750
862
863linux-64idx-i8-uni:
864  extends:
865    - .stage-3
866    - .linux_test
867  tags:
868    - gce-nfs
869  variables:
870    TEST_ARCH: arch-ci-linux-64idx-i8-uni
871
872mswin-intel-cxx-cmplx:
873  extends:
874    - .stage-3
875    - .mswin_test
876  tags:
877    - os:win
878  variables:
879    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
880
881#mswin-intel:
882#  extends:
883#    - .stage-3
884#    - .mswin_test
885#  tags:
886#    - os:win
887#  variables:
888#    TEST_ARCH: arch-ci-mswin-intel
889
890#mswin-opt-impi:
891#  extends:
892#    - .stage-3
893#    - .mswin_test
894#  tags:
895#    - os:win
896#  variables:
897#    TEST_ARCH: arch-ci-mswin-opt-impi
898#    DISABLE_TESTS: 1
899
900opensolaris-pkgs-opt:
901  extends:
902    - .stage-3
903    - .opensolaris_test
904  tags:
905    - name:n-gage
906  variables:
907    TEST_ARCH: arch-ci-opensolaris-pkgs-opt
908
909opensolaris-cmplx-pkgs-dbg:
910  extends:
911    - .stage-3
912    - .opensolaris_test
913  tags:
914    - name:n-gage
915  variables:
916    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
917
918opensolaris-misc:
919  extends:
920    - .stage-3
921    - .opensolaris_test
922  tags:
923    - name:n-gage
924  variables:
925    TEST_ARCH: arch-ci-opensolaris-misc
926
927osx-cxx-cmplx-pkgs-dbg:
928  extends:
929    - .stage-3
930    - .osx_test
931  tags:
932    - os:macos
933  variables:
934    TEST_ARCH: arch-ci-osx-cxx-cmplx-pkgs-dbg
935
936osx-cxx-pkgs-opt:
937  extends:
938    - .stage-3
939    - .osx_test
940  tags:
941    - os:macos, opt
942  variables:
943    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false -checkstack
944    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
945    MAKE_CXXFLAGS: -Werror -Wno-pass-failed
946
947osx-dbg:
948  extends:
949    - .stage-3
950    - .osx_test
951  tags:
952    - os:macos
953  variables:
954    TEST_ARCH: arch-ci-osx-dbg
955
956osx-xsdk-opt:
957  extends:
958    - .stage-3
959    - .osx_test
960  tags:
961    - os:macos, opt
962  variables:
963    TEST_ARCH: arch-ci-osx-xsdk-opt
964
965# job for analyzing the final coverage results
966analyze-pipeline:
967  extends: .test
968  stage: .post
969  tags:
970    - gce-nfs-short
971  dependencies:
972    - linux-cuda112-gcov
973    - linux-pkgs-gcov
974    - linux-cmplx-gcov
975    - linux-matlab-ilp64-gcov
976    - linux-gcov
977  variables:
978    PETSC_ARCH: arch-ci-analyze-pipeline
979  before_script:
980    - date
981    - hostname
982  script:
983  - ./configure --with-mpi=0 --with-cxx=0 --with-c2html
984  - make srchtml
985  - make mergegcov
986  artifacts:
987    name: "$CI_JOB_NAME"
988    when: always
989    paths:
990    - arch-ci-analyze-pipeline/*
991    expire_in: 4 days
992
993
994#
995# Base job for a documentation build
996#
997.docs:
998  stage: stage-2
999  tags:
1000    - gce-stage2
1001  before_script:
1002    - VENV=venv-petsc-docs &&
1003      python3 -m venv $VENV &&
1004      . $VENV/bin/activate &&
1005      cd doc &&
1006      pip install -r requirements.txt
1007
1008#
1009# Build documentation and make available for review using GitLab pages
1010#
1011docs-review:
1012  extends:
1013    - .docs
1014    - .test-basic
1015  script:
1016    - (make html BUILDDIR="../public" SPHINXOPTS="-T -E -W --keep-going") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1017    - (make latexpdf SPHINXOPTS="-T -E -W --keep-going") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1018    - cp _build/latex/manual.pdf ../public/html/docs/manual/
1019  environment:
1020    name: review/$CI_COMMIT_REF_NAME
1021    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/html/index.html
1022  artifacts:
1023    paths:
1024      - public
1025  except:
1026    variables:
1027      - $PETSC_CI_SCHEDULED =~ /yes/
1028
1029#
1030# Deploy documentation using GitLab pages
1031#
1032pages:  # this job name has special meaning to GitLab
1033  extends: .docs
1034  interruptible: true
1035  script:
1036    - mkdir -p ../public/ && cp public/* ../public/
1037    - git fetch --unshallow --no-tags origin +release:remotes/origin/release +main:remotes/origin/main
1038    - git checkout origin/main && pip install -r requirements.txt && make website-deploy BUILDDIR="../public/main" && make latexpdf && mkdir -p ../public/main/docs/manual && cp _build/latex/manual.pdf ../public/main/docs/manual/
1039    - make clean BUILDDIR="../public/release"
1040    - git checkout origin/release && pip install -r requirements.txt && make website-deploy BUILDDIR="../public/release" && make latexpdf && mkdir -p ../public/release/docs/manual && cp _build/latex/manual.pdf ../public/release/docs/manual/
1041  only:
1042    variables:
1043      - $PETSC_CI_SCHEDULED == "yes"
1044  artifacts:
1045    paths:
1046      - public
1047
1048#
1049#
1050# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
1051# that fail produce a warning, but do not block execution of a pipeline.
1052#
1053
1054.test-experimental:
1055  extends: .test
1056  allow_failure: true
1057
1058