From c18949b3c3c4dc0caafa23c398f000152f752388 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Tue, 20 Feb 2024 09:53:39 +0100 Subject: [PATCH] Add thread sanitizer CI pipeline --- ci/.gitlab-ci.yml | 35 ++++++++++++++++++----------------- ci/common-ci.yml | 2 +- ci/cpu/tsan.yml | 35 +++++++++++++++++++++++++++++++++++ ci/ctest_to_gitlab.sh | 6 +++--- ci/docker/tsan.yaml | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 21 deletions(-) create mode 100644 ci/cpu/tsan.yml create mode 100644 ci/docker/tsan.yaml diff --git a/ci/.gitlab-ci.yml b/ci/.gitlab-ci.yml index 0204a001ee..2f58bf3fed 100644 --- a/ci/.gitlab-ci.yml +++ b/ci/.gitlab-ci.yml @@ -1,19 +1,20 @@ include: - local: 'ci/cpu/asan_ubsan_lsan.yml' - - local: 'ci/cpu/clang15_release_cxx20.yml' - - local: 'ci/cpu/clang15_release_stdexec.yml' - - local: 'ci/cpu/clang15_release.yml' - - local: 'ci/cpu/clang16_release.yml' - - local: 'ci/cpu/clang18_release.yml' - - local: 'ci/cpu/gcc11_release_stdexec.yml' - - local: 'ci/cpu/gcc11_debug_stdexec.yml' - - local: 'ci/cpu/gcc12_release_cxx20.yml' - - local: 'ci/cpu/gcc13_codecov.yml' - - local: 'ci/cpu/gcc13_release.yml' - - local: 'ci/cuda/gcc11_release.yml' - - local: 'ci/cuda/gcc11_release_scalapack.yml' - - local: 'ci/cuda/gcc11_codecov.yml' - - local: 'ci/cuda/gcc11_debug_scalapack.yml' - - local: 'ci/cuda/gcc13_release_stdexec.yml' - - local: 'ci/rocm/clang14_release.yml' - - local: 'ci/rocm/clang14_release_stdexec.yml' + - local: 'ci/cpu/tsan.yml' + # - local: 'ci/cpu/clang15_release_cxx20.yml' + # - local: 'ci/cpu/clang15_release_stdexec.yml' + # - local: 'ci/cpu/clang15_release.yml' + # - local: 'ci/cpu/clang16_release.yml' + # - local: 'ci/cpu/clang18_release.yml' + # - local: 'ci/cpu/gcc11_release_stdexec.yml' + # - local: 'ci/cpu/gcc11_debug_stdexec.yml' + # - local: 'ci/cpu/gcc12_release_cxx20.yml' + # - local: 'ci/cpu/gcc13_codecov.yml' + # - local: 'ci/cpu/gcc13_release.yml' + # - local: 'ci/cuda/gcc11_release.yml' + # - local: 'ci/cuda/gcc11_release_scalapack.yml' + # - local: 'ci/cuda/gcc11_codecov.yml' + # - local: 'ci/cuda/gcc11_debug_scalapack.yml' + # - local: 'ci/cuda/gcc13_release_stdexec.yml' + # - local: 'ci/rocm/clang14_release.yml' + # - local: 'ci/rocm/clang14_release_stdexec.yml' diff --git a/ci/common-ci.yml b/ci/common-ci.yml index f2fb06f07c..f070765240 100644 --- a/ci/common-ci.yml +++ b/ci/common-ci.yml @@ -34,7 +34,7 @@ stages: reports: dotenv: build.env variables: - SPACK_SHA: 0905edf592752742eb4ddab3a528d3aee8f92930 + SPACK_SHA: develop-2024-10-06 SPACK_DLAF_REPO: ./spack DOCKER_BUILD_ARGS: '[ "BASE_IMAGE", diff --git a/ci/cpu/tsan.yml b/ci/cpu/tsan.yml new file mode 100644 index 0000000000..b02b298b89 --- /dev/null +++ b/ci/cpu/tsan.yml @@ -0,0 +1,35 @@ +include: + - local: 'ci/common-ci.yml' + +cpu tsan deps: + extends: .build_deps_common + variables: + EXTRA_APTGET: "clang-18 libclang-rt-18-dev libomp-18-dev" + COMPILER: clang@18 + SPACK_ENVIRONMENT: ci/docker/tsan.yaml + USE_MKL: "ON" + DEPS_IMAGE: $CSCS_REGISTRY_PATH/cpu-tsan/deps + +cpu tsan build: + extends: + - .build_common + - .build_for_daint-mc + needs: + - cpu tsan deps + variables: + DLAF_IMAGE: $CSCS_REGISTRY_PATH/cpu-tsan/dlaf:$CI_COMMIT_SHA + +cpu tsan test: + extends: .run_common + needs: + - cpu tsan build + variables: + TSAN_OPTIONS: "ignore_noninstrumented_modules=1:halt_on_error=1:history_size=0" + PIKA_SMALL_STACK_SIZE: "0x100000" + PIKA_MEDIUM_STACK_SIZE: "0x100000" + # Override use of libSegFault, not necessary with sanitizers + LD_PRELOAD: "" + trigger: + include: + - artifact: pipeline.yml + job: cpu tsan build diff --git a/ci/ctest_to_gitlab.sh b/ci/ctest_to_gitlab.sh index cedf894f80..b4e78190fd 100755 --- a/ci/ctest_to_gitlab.sh +++ b/ci/ctest_to_gitlab.sh @@ -61,7 +61,7 @@ JOB_TEMPLATE=" USE_MPI: 'YES' DISABLE_AFTER_SCRIPT: 'YES' DLAF_HDF5_TEST_OUTPUT_PATH: \$CI_PROJECT_DIR - script: mpi-ctest -L {{LABEL}} + script: mpi-ctest --timeout 420 -E eigensolver -L {{LABEL}} artifacts: paths: - codecov-reports/" @@ -93,14 +93,14 @@ JOB_TEMPLATE=" variables: SLURM_CPUS_PER_TASK: {{CPUS_PER_TASK}} SLURM_NTASKS: {{NTASKS}} - SLURM_TIMELIMIT: '20:00' + SLURM_TIMELIMIT: '2:00:00' SLURM_UNBUFFEREDIO: 1 SLURM_WAIT: 0 PULL_IMAGE: 'YES' USE_MPI: 'YES' DISABLE_AFTER_SCRIPT: 'YES' DLAF_HDF5_TEST_OUTPUT_PATH: \$CI_PROJECT_DIR - script: mpi-ctest -L {{LABEL}}" + script: mpi-ctest --timeout 420 -E eigensolver -L {{LABEL}}" fi JOBS="" diff --git a/ci/docker/tsan.yaml b/ci/docker/tsan.yaml new file mode 100644 index 0000000000..2fc56ccdc4 --- /dev/null +++ b/ci/docker/tsan.yaml @@ -0,0 +1,34 @@ +# +# Distributed Linear Algebra with Future (DLAF) +# +# Copyright (c) 2018-2024, ETH Zurich +# All rights reserved. +# +# Please, refer to the LICENSE file in the root directory. +# SPDX-License-Identifier: BSD-3-Clause +# + +spack: + include: + - /spack_environment/common.yaml + + view: false + concretizer: + unify: + true + + specs: + - dla-future@master build_type=Debug cxxflags="-fsanitize=thread -fno-omit-frame-pointer" ldflags="-fsanitize=thread" +miniapps +ci-test + + packages: + all: + variants: + - 'build_type=RelWithDebInfo' + pika: + require: + - 'build_type=Debug' + - 'malloc=system' + - '+sanitizers' + - '+stdexec' + - 'cxxflags="-fsanitize=thread -fno-omit-frame-pointer"' + - 'ldflags="-fsanitize=thread"'