-
Notifications
You must be signed in to change notification settings - Fork 183
Expand file tree
/
Copy pathtest_cpp_memcheck.sh
More file actions
executable file
·76 lines (58 loc) · 2.06 KB
/
test_cpp_memcheck.sh
File metadata and controls
executable file
·76 lines (58 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if [[ "$(date +%A)" != "Friday" ]]; then
echo "Not Friday, exiting early."
exit 0
fi
set -euo pipefail
# shellcheck source=ci/utils/cuopt_coredumps.sh
source "$(dirname "${BASH_SOURCE[0]}")/utils/cuopt_coredumps.sh"
cuopt_coredumps_ci_setup
. /opt/conda/etc/profile.d/conda.sh
rapids-logger "Configuring conda strict channel priority"
conda config --set channel_priority strict
RAPIDS_VERSION="$(rapids-version)"
rapids-logger "Generate C++ testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file-key test_cpp \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" | tee env.yaml
rapids-mamba-retry env create --yes -f env.yaml -n test
# Temporarily allow unbound variables for conda activation.
set +u
conda activate test
set -u
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
rapids-print-env
rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
"libcuopt=${RAPIDS_VERSION}" \
"libcuopt-tests=${RAPIDS_VERSION}"
rapids-logger "Check GPU usage"
nvidia-smi
rapids-logger "Download datasets"
RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)"
export RAPIDS_DATASET_ROOT_DIR
pushd "${RAPIDS_DATASET_ROOT_DIR}"
./get_test_data.sh
popd
EXITCODE=0
trap "EXITCODE=1" ERR
set +e
rapids-logger "Run gtests with compute sanitizer"
checkers=( "memcheck" "synccheck" "racecheck" )
tests=( "ROUTING_TEST" "ROUTING_GES_TEST" )
for j in "${tests[@]}" ; do
for i in "${checkers[@]}" ; do
gt="$CONDA_PREFIX"/bin/gtests/libcuopt/"$j"
test_name=$(basename "${gt}")
echo "Running gtest with compute sanitizer --tool $i $test_name"
COMPUTE_SANITIZER_CMD="compute-sanitizer --tool ${i}"
${COMPUTE_SANITIZER_CMD} "${gt}" --gtest_output=xml:"${RAPIDS_TESTS_DIR}${test_name}${i}.xml"
done
done
rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}