Skip to content

Commit 2af95e2

Browse files
committed
fix shellcheck lint
1 parent 0b2e136 commit 2af95e2

85 files changed

Lines changed: 637 additions & 453 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/cccl-entrypoint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
set -e;
66

77
if ! test -n "${DISABLE_SCCACHE:+x}" && test -n "${DEVCONTAINER_UTILS_ENABLE_SCCACHE_DIST:+x}" && ! test -n "${SCCACHE_DIST_URL:+x}"; then
8-
export SCCACHE_DIST_URL="https://$(dpkg --print-architecture).$(uname -s | tr '[:upper:]' '[:lower:]').sccache.rapids.nvidia.com";
8+
SCCACHE_DIST_URL="https://$(uname -m | sed -e 's/x86_/amd/' -e 's/aarch/arm/').linux.sccache.rapids.nvidia.com";
9+
export SCCACHE_DIST_URL;
910
echo "export SCCACHE_DIST_URL=$SCCACHE_DIST_URL" >> ~/.bashrc;
1011
fi
1112

.devcontainer/docker-entrypoint.sh

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
: "${NEW_UID:=}";
99
: "${NEW_GID:=}";
1010

11-
eval "$(sed -n "s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/OLD_UID=\1;OLD_GID=\2;HOME_FOLDER=\3/p" /etc/passwd)";
12-
eval "$(sed -n "s/\([^:]*\):[^:]*:${NEW_UID}:.*/EXISTING_USER=\1/p" /etc/passwd)";
13-
eval "$(sed -n "s/\([^:]*\):[^:]*:${NEW_GID}:.*/EXISTING_GROUP=\1/p" /etc/group)";
11+
OLD_UID="$(sed -n "s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/\1/p" /etc/passwd)";
12+
OLD_GID="$(sed -n "s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/\2/p" /etc/passwd)";
13+
HOME_FOLDER="$(sed -n "s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/\3/p" /etc/passwd)";
14+
EXISTING_USER="$(sed -n "s/\([^:]*\):[^:]*:${NEW_UID}:.*/\1/p" /etc/passwd)";
15+
EXISTING_GROUP="$(sed -n "s/\([^:]*\):[^:]*:${NEW_GID}:.*/\1/p" /etc/group)";
1416

15-
if [ -z "$OLD_UID" ]; then
17+
if [[ -z "$OLD_UID" ]]; then
1618
echo "Remote user not found in /etc/passwd ($REMOTE_USER).";
1719
exec "$(pwd)/.devcontainer/cccl-entrypoint.sh" "$@";
18-
elif [ "$OLD_UID" = "$NEW_UID" ] && [ "$OLD_GID" = "$NEW_GID" ]; then
20+
elif [[ "$OLD_UID" = "$NEW_UID" ]] && [[ "$OLD_GID" = "$NEW_GID" ]]; then
1921
echo "UIDs and GIDs are the same ($NEW_UID:$NEW_GID).";
2022
# Even when IDs match, ensure we execute as the non-root REMOTE_USER so
2123
# gh and sccache use the mapped HOME (/home/coder) where ~/.aws is bind-mounted.
@@ -27,17 +29,17 @@ elif [ "$OLD_UID" = "$NEW_UID" ] && [ "$OLD_GID" = "$NEW_GID" ]; then
2729
export XDG_STATE_HOME="$HOME_FOLDER/.local/state";
2830
export PYTHONHISTFILE="$HOME_FOLDER/.local/state/.python_history";
2931
exec su -p "$REMOTE_USER" -- "$(pwd)/.devcontainer/cccl-entrypoint.sh" "$@";
30-
elif [ "$OLD_UID" != "$NEW_UID" ] && [ -n "$EXISTING_USER" ]; then
32+
elif [[ "$OLD_UID" != "$NEW_UID" ]] && [[ -n "$EXISTING_USER" ]]; then
3133
echo "User with UID exists ($EXISTING_USER=$NEW_UID).";
3234
exec "$(pwd)/.devcontainer/cccl-entrypoint.sh" "$@";
3335
else
34-
if [ "$OLD_GID" != "$NEW_GID" ] && [ -n "$EXISTING_GROUP" ]; then
36+
if [[ "$OLD_GID" != "$NEW_GID" ]] && [[ -n "$EXISTING_GROUP" ]]; then
3537
echo "Group with GID exists ($EXISTING_GROUP=$NEW_GID).";
3638
NEW_GID="$OLD_GID";
3739
fi
3840
echo "Updating UID:GID from $OLD_UID:$OLD_GID to $NEW_UID:$NEW_GID.";
3941
sed -i -e "s/\(${REMOTE_USER}:[^:]*:\)[^:]*:[^:]*/\1${NEW_UID}:${NEW_GID}/" /etc/passwd;
40-
if [ "$OLD_GID" != "$NEW_GID" ]; then
42+
if [[ "$OLD_GID" != "$NEW_GID" ]]; then
4143
sed -i -e "s/\([^:]*:[^:]*:\)${OLD_GID}:/\1${NEW_GID}:/" /etc/group;
4244
fi
4345

@@ -57,19 +59,5 @@ else
5759
export XDG_STATE_HOME="$HOME_FOLDER/.local/state";
5860
export PYTHONHISTFILE="$HOME_FOLDER/.local/state/.python_history";
5961

60-
if command -V module 2>&1 | grep -q function; then
61-
# "deactivate" lmod so it will be reactivated as the non-root user
62-
export LMOD_CMD=
63-
export LMOD_DEFAULT_MODULEPATH=
64-
export LMOD_DIR=
65-
export LMOD_PKG=
66-
export LOADEDMODULES=
67-
export MANPATH=
68-
export MODULEPATH_ROOT=
69-
export MODULEPATH=
70-
export MODULESHOME=
71-
export -fn module
72-
fi
73-
7462
exec su -p "$REMOTE_USER" -- "$(pwd)/.devcontainer/cccl-entrypoint.sh" "$@";
7563
fi

.devcontainer/launch.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ print_help() {
3030
_upvar() {
3131
if unset -v "$1"; then
3232
if (( $# == 2 )); then
33-
eval $1=\"\$2\";
33+
eval "$1"=\"\$2\";
3434
else
35-
eval $1=\(\"\${@:2}\"\);
35+
# shellcheck disable=SC1083
36+
eval "$1"=\(\"\${@:2}\"\);
3637
fi;
3738
fi
3839
}
@@ -47,7 +48,7 @@ parse_options() {
4748
# implementations of getopt(1), and this version if the environment variable
4849
# GETOPT_COMPATIBLE is set, will return '--' and error status 0.
4950
set +e
50-
getopt -T 2>&1 > /dev/null
51+
getopt -T >/dev/null 2>&1
5152
getopt_ret=$?
5253
set -e
5354

@@ -135,13 +136,15 @@ launch_docker() {
135136
# Introduces the `DOCKER_IMAGE`, `ENTRYPOINTS`, `ENV_VARS`, `GPU_REQUEST`,
136137
# `INITIALIZE_COMMANDS`, `MOUNTS`, `REMOTE_USER`, `RUN_ARGS`, and
137138
# `WORKSPACE_FOLDER` variables
139+
# shellcheck disable=SC2312,SC1090
138140
source <(python3 .devcontainer/launch.py "${path}/devcontainer.json")
139141

140142
###
141143
# Run the initialize command(s) before starting the container
142144
###
143145

144146
local init_cmd;
147+
# shellcheck disable=SC2154
145148
for init_cmd in "${INITIALIZE_COMMANDS[@]}"; do
146149
eval "${init_cmd}"
147150
done
@@ -163,6 +166,7 @@ launch_docker() {
163166
RUN_ARGS+=(--gpus "${gpu_request}")
164167
else
165168
# Otherwise read and infer from hostRequirements.gpu
169+
# shellcheck disable=SC2154,SC2153
166170
RUN_ARGS+=("${GPU_REQUEST[@]}")
167171
fi
168172

@@ -176,6 +180,7 @@ launch_docker() {
176180
ENV_VARS+=(--env NEW_UID="$(id -u)")
177181
ENV_VARS+=(--env NEW_GID="$(id -g)")
178182
ENV_VARS+=(--env REMOTE_USER="$REMOTE_USER")
183+
# shellcheck disable=SC2154
179184
ENTRYPOINTS+=("${WORKSPACE_FOLDER}/.devcontainer/docker-entrypoint.sh")
180185
;;
181186
esac
@@ -201,6 +206,7 @@ launch_docker() {
201206
echo "::group::Docker run command"
202207
set -x
203208
fi
209+
# shellcheck disable=SC2154
204210
exec docker run \
205211
"${RUN_ARGS[@]}" \
206212
"${ENV_VARS[@]}" \
@@ -225,14 +231,17 @@ launch_vscode() {
225231
# and compiler environment into this temporary directory, adjusting paths to ensure the
226232
# correct workspace is loaded. A special URL is then generated to instruct VSCode to
227233
# launch the development container using this temporary configuration.
228-
local workspace="$(basename "$(pwd)")"
229-
local tmpdir="$(mktemp -d)/${workspace}"
234+
local workspace
235+
workspace="$(basename "$(pwd)")"
236+
local tmpdir
237+
tmpdir="$(mktemp -d)/${workspace}"
230238
mkdir -p "${tmpdir}"
231239
mkdir -p "${tmpdir}/.devcontainer"
232240
cp -arL "${path}/devcontainer.json" "${tmpdir}/.devcontainer"
233241
sed -i "s@\${localWorkspaceFolder}@$(pwd)@g" "${tmpdir}/.devcontainer/devcontainer.json"
234242
local path="${tmpdir}"
235-
local hash="$(echo -n "${path}" | xxd -pu - | tr -d '[:space:]')"
243+
local hash
244+
hash="$(echo -n "${path}" | xxd -pu - | tr -d '[:space:]')"
236245
local url="vscode://vscode-remote/dev-container+${hash}/home/coder/cccl"
237246

238247
local launch=""
@@ -242,7 +251,7 @@ launch_vscode() {
242251
launch="xdg-open"
243252
fi
244253

245-
if [ -n "${launch}" ]; then
254+
if [[ -n "${launch}" ]]; then
246255
echo "Launching VSCode Dev Container URL: ${url}"
247256
code --new-window "${tmpdir}"
248257
exec "${launch}" "${url}" >/dev/null 2>&1

.devcontainer/make_devcontainers.sh

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ update_devcontainer() {
3939

4040
# NVHPC SDK comes with its own bundled toolkit
4141
local toolkit_name="-cuda${cuda_version}${cuda_suffix}"
42-
if [ $compiler_name == "nvhpc" ]; then
42+
if [[ "$compiler_name" == "nvhpc" ]]; then
4343
toolkit_name=""
4444
fi
4545

4646
local IMAGE_ROOT="rapidsai/devcontainers:${devcontainer_version}-cpp-"
4747
local INTERNAL_ROOT="gitlab-master.nvidia.com:5005/cccl/cccl-devcontainers:cpp-"
4848

4949
img=$IMAGE_ROOT
50-
if [ "$internal" == "true" ]; then
50+
if [[ "$internal" == "true" ]]; then
5151
img=$INTERNAL_ROOT
5252
fi;
5353

@@ -111,43 +111,55 @@ MATRIX_FILE="../ci/matrix.yaml"
111111
COMPUTE_MATRIX="../.github/actions/workflow-build/build-workflow.py"
112112

113113
# Enable verbose mode if requested
114-
if [ "$VERBOSE" = true ]; then
114+
if [[ "$VERBOSE" = true ]]; then
115115
set -x
116-
cat ${MATRIX_FILE}
116+
cat "${MATRIX_FILE}"
117117
fi
118118

119119
# Read matrix.yaml and convert it to json
120-
matrix_json=$(python3 ${COMPUTE_MATRIX} ${MATRIX_FILE} --devcontainer-info)
120+
matrix_json=$(python3 "${COMPUTE_MATRIX}" "${MATRIX_FILE}" --devcontainer-info)
121121

122-
if [ "$VERBOSE" = true ]; then
122+
if [[ "$VERBOSE" = true ]]; then
123123
echo "$matrix_json"
124124
fi
125125

126126
# Get the devcontainer image version and define image tag root
127-
readonly DEVCONTAINER_VERSION=$(echo "$matrix_json" | jq -r '.devcontainer_version')
127+
DEVCONTAINER_VERSION=$(echo "$matrix_json" | jq -r '.devcontainer_version')
128+
readonly DEVCONTAINER_VERSION
128129

129130
# Internal image compiler versions:
130-
readonly CUDA99_GCC_VERSION=$( echo "$matrix_json" | jq -r '.cuda99_gcc_version')
131-
readonly CUDA99_LLVM_VERSION=$(echo "$matrix_json" | jq -r '.cuda99_clang_version')
131+
CUDA99_GCC_VERSION=$( echo "$matrix_json" | jq -r '.cuda99_gcc_version')
132+
readonly CUDA99_GCC_VERSION
133+
CUDA99_LLVM_VERSION=$(echo "$matrix_json" | jq -r '.cuda99_clang_version')
134+
readonly CUDA99_LLVM_VERSION
132135

133136
# Get unique combinations of cuda version, compiler name/version, and Ubuntu version
134-
readonly combinations=$(echo "$matrix_json" | jq -c '.combinations[]')
137+
combinations=$(echo "$matrix_json" | jq -c '.combinations[]')
138+
readonly combinations
135139

136140
# Update the base devcontainer with the default values
137141
# The root devcontainer.json file is used as the default container as well as a template for all
138142
# other devcontainer.json files by replacing the `image:` field with the appropriate image name
139143
readonly base_devcontainer_file="./devcontainer.json"
140-
readonly NEWEST_GCC_CUDA_ENTRY=$(echo "$combinations" | jq -rs '[.[] | select(.compiler_name == "gcc")] | sort_by((.cuda | tonumber), (.compiler_version | tonumber)) | .[-1]')
141-
readonly NEWEST_LLVM_CUDA_ENTRY=$(echo "$combinations" | jq -rs '[.[] | select(.compiler_name == "llvm")] | sort_by((.cuda | tonumber), (.compiler_version | tonumber)) | .[-1]')
142-
readonly DEFAULT_CUDA=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.cuda')
144+
NEWEST_GCC_CUDA_ENTRY=$(echo "$combinations" | jq -rs '[.[] | select(.compiler_name == "gcc")] | sort_by((.cuda | tonumber), (.compiler_version | tonumber)) | .[-1]')
145+
readonly NEWEST_GCC_CUDA_ENTRY
146+
NEWEST_LLVM_CUDA_ENTRY=$(echo "$combinations" | jq -rs '[.[] | select(.compiler_name == "llvm")] | sort_by((.cuda | tonumber), (.compiler_version | tonumber)) | .[-1]')
147+
# shellcheck disable=SC2034
148+
readonly NEWEST_LLVM_CUDA_ENTRY
149+
DEFAULT_CUDA=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.cuda')
150+
readonly DEFAULT_CUDA
143151
readonly DEFAULT_CUDA_EXT=false
144-
readonly DEFAULT_COMPILER_NAME=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.compiler_name')
145-
readonly DEFAULT_COMPILER_EXE=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.compiler_exe')
146-
readonly DEFAULT_COMPILER_VERSION=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.compiler_version')
147-
readonly DEFAULT_NAME=$(make_name "$DEFAULT_CUDA" "$DEFAULT_CUDA_EXT" "$DEFAULT_COMPILER_NAME" "$DEFAULT_COMPILER_VERSION")
148-
149-
update_devcontainer ${base_devcontainer_file} "./temp_devcontainer.json" "$DEFAULT_NAME" "$DEFAULT_CUDA" "$DEFAULT_CUDA_EXT" "$DEFAULT_COMPILER_NAME" "$DEFAULT_COMPILER_EXE" "$DEFAULT_COMPILER_VERSION" "$DEVCONTAINER_VERSION" "false"
150-
mv "./temp_devcontainer.json" ${base_devcontainer_file}
152+
DEFAULT_COMPILER_NAME=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.compiler_name')
153+
readonly DEFAULT_COMPILER_NAME
154+
DEFAULT_COMPILER_EXE=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.compiler_exe')
155+
readonly DEFAULT_COMPILER_EXE
156+
DEFAULT_COMPILER_VERSION=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.compiler_version')
157+
readonly DEFAULT_COMPILER_VERSION
158+
DEFAULT_NAME=$(make_name "$DEFAULT_CUDA" "$DEFAULT_CUDA_EXT" "$DEFAULT_COMPILER_NAME" "$DEFAULT_COMPILER_VERSION")
159+
readonly DEFAULT_NAME
160+
161+
update_devcontainer "${base_devcontainer_file}" "./temp_devcontainer.json" "$DEFAULT_NAME" "$DEFAULT_CUDA" "$DEFAULT_CUDA_EXT" "$DEFAULT_COMPILER_NAME" "$DEFAULT_COMPILER_EXE" "$DEFAULT_COMPILER_VERSION" "$DEVCONTAINER_VERSION" "false"
162+
mv "./temp_devcontainer.json" "${base_devcontainer_file}"
151163

152164
# Create an array to keep track of valid subdirectory names
153165
valid_subdirs=()
@@ -178,10 +190,14 @@ make_compiler_entry() {
178190
}" | jq -c '.'
179191
}
180192

181-
readonly cuda99_8_gcc=$( make_compiler_entry "gcc" "$CUDA99_GCC_VERSION" "gcc" "99.8" "false" "true")
182-
readonly cuda99_9_gcc=$( make_compiler_entry "gcc" "$CUDA99_GCC_VERSION" "gcc" "99.9" "false" "true")
183-
readonly cuda99_8_llvm=$(make_compiler_entry "llvm" "$CUDA99_LLVM_VERSION" "clang" "99.8" "false" "true")
184-
readonly cuda99_9_llvm=$(make_compiler_entry "llvm" "$CUDA99_LLVM_VERSION" "clang" "99.9" "false" "true")
193+
cuda99_8_gcc=$( make_compiler_entry "gcc" "$CUDA99_GCC_VERSION" "gcc" "99.8" "false" "true")
194+
readonly cuda99_8_gcc
195+
cuda99_9_gcc=$( make_compiler_entry "gcc" "$CUDA99_GCC_VERSION" "gcc" "99.9" "false" "true")
196+
readonly cuda99_9_gcc
197+
cuda99_8_llvm=$(make_compiler_entry "llvm" "$CUDA99_LLVM_VERSION" "clang" "99.8" "false" "true")
198+
readonly cuda99_8_llvm
199+
cuda99_9_llvm=$(make_compiler_entry "llvm" "$CUDA99_LLVM_VERSION" "clang" "99.9" "false" "true")
200+
readonly cuda99_9_llvm
185201

186202
readonly all_comb="$combinations $cuda99_9_gcc $cuda99_8_gcc $cuda99_9_llvm $cuda99_8_llvm"
187203
# For each unique combination
@@ -205,9 +221,9 @@ for combination in $all_comb; do
205221
done
206222

207223
# Clean up stale subdirectories and devcontainer.json files
208-
if [ "$CLEAN" = true ]; then
224+
if [[ "$CLEAN" = true ]]; then
209225
for subdir in ./*; do
210-
if [ -d "$subdir" ] && [[ ! " ${valid_subdirs[@]} " =~ " ${subdir#./} " ]]; then
226+
if [[ -d "$subdir" ]] && [[ " ${valid_subdirs[*]} " != *" ${subdir#./} "* ]]; then
211227
echo "Removing stale subdirectory: $subdir"
212228
rm -r "$subdir"
213229
fi

.devcontainer/verify_devcontainer.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ check_envvars() {
1919
}
2020

2121
check_host_compiler_version() {
22-
local version_output=$($CXX --version)
22+
local version_output
23+
# shellcheck disable=SC2154
24+
version_output=$("$CXX" --version)
2325

2426
if [[ "$CXX" == "g++" ]]; then
25-
local actual_version=$(echo "$version_output" | head -n 1 | cut -d ' ' -f 4 | cut -d '.' -f 1)
27+
local actual_version
28+
actual_version=$(echo "$version_output" | head -n 1 | cut -d ' ' -f 4 | cut -d '.' -f 1)
2629
local expected_compiler="gcc"
2730
elif [[ "$CXX" == "clang++" ]]; then
2831
if [[ $version_output =~ clang\ version\ ([0-9]+) ]]; then
@@ -33,20 +36,23 @@ check_host_compiler_version() {
3336
fi
3437
expected_compiler="llvm"
3538
elif [[ "$CXX" == "icpc" ]]; then
36-
local actual_version=$(echo "$version_output" | head -n 1 | cut -d ' ' -f 3 )
39+
local actual_version
40+
actual_version=$(echo "$version_output" | head -n 1 | cut -d ' ' -f 3 )
3741
# The icpc compiler version of oneAPI release 2023.2.0 is 2021.10.0
3842
if [[ "$actual_version" == "2021.10.0" ]]; then
3943
actual_version="2023.2.0"
4044
fi
4145
expected_compiler="oneapi"
42-
elif [[ "$CXX" =~ "nvc++" ]]; then
43-
local actual_version=$(echo "$version_output" | head -n 2 | cut -d ' ' -f 2 | cut -d '-' -f 1 | tail -n 1)
46+
elif [[ "$CXX" =~ nvc++ ]]; then
47+
local actual_version
48+
actual_version=$(echo "$version_output" | head -n 2 | cut -d ' ' -f 2 | cut -d '-' -f 1 | tail -n 1)
4449
local expected_compiler="nvhpc"
4550
else
4651
echo "::error:: Unexpected CXX value ($CXX)."
4752
exit 1
4853
fi
4954

55+
# shellcheck disable=SC2154
5056
if [[ "$expected_compiler" != "${CCCL_HOST_COMPILER}" || "$actual_version" != "$CCCL_HOST_COMPILER_VERSION" ]]; then
5157
echo "::error:: CXX ($CXX) version ($actual_version) does not match the expected compiler (${CCCL_HOST_COMPILER}) and version (${CCCL_HOST_COMPILER_VERSION})."
5258
exit 1
@@ -56,14 +62,16 @@ check_host_compiler_version() {
5662
}
5763

5864
check_cuda_version() {
59-
local cuda_version_output=$(nvcc --version)
65+
local cuda_version_output
66+
cuda_version_output=$(nvcc --version)
6067
if [[ $cuda_version_output =~ release\ ([0-9]+\.[0-9]+) ]]; then
6168
local actual_cuda_version=${BASH_REMATCH[1]}
6269
else
6370
echo "::error:: Unable to determine CUDA version from nvcc."
6471
exit 1
6572
fi
6673

74+
# shellcheck disable=SC2154
6775
if [[ "$actual_cuda_version" != "$CCCL_CUDA_VERSION" ]]; then
6876
echo "::error:: CUDA version ($actual_cuda_version) does not match the expected CUDA version ($CCCL_CUDA_VERSION)."
6977
exit 1

benchmarks/scripts/submit_benchmark_job.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobtime="4:00:00"
99
benchmark_preset="benchmark"
1010

1111
batch_script=$scratch/batch.sh
12-
cat << BATCH_SCRIPT > $batch_script
12+
cat << BATCH_SCRIPT > "$batch_script"
1313
#!/bin/bash
1414
1515
pip install --break-system-packages fpzip pandas scipy
@@ -37,11 +37,11 @@ export PYTHONPATH=../benchmarks/scripts/
3737
3838
echo "Benchmark done. Results in $scratch/\$host/cccl/build_perf/cccl_meta_bench.db"
3939
BATCH_SCRIPT
40-
chmod +x $batch_script
40+
chmod +x "$batch_script"
4141

4242
# schedule SLURM job
4343
echo "Scheduling script $batch_script"
4444
echo "#################################################################################"
45-
cat $batch_script
45+
cat "$batch_script"
4646
echo "#################################################################################"
47-
crun -q "$node_selector" -ex -t $jobtime -img $container_image -b $batch_script
47+
crun -q "$node_selector" -ex -t "$jobtime" -img "$container_image" -b "$batch_script"

ci/build_cccl_c_parallel.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
set -euo pipefail
44

5+
# shellcheck source=ci/build_common.sh
56
source "$(dirname "${BASH_SOURCE[0]}")/build_common.sh"
67

78
print_environment_details
89

910
PRESET="cccl-c-parallel"
1011

11-
CMAKE_OPTIONS="-DCMAKE_CXX_STANDARD=${CXX_STANDARD} -DCMAKE_CUDA_STANDARD=${CXX_STANDARD}"
12+
CMAKE_OPTIONS=("-DCMAKE_CXX_STANDARD=${CXX_STANDARD}" "-DCMAKE_CUDA_STANDARD=${CXX_STANDARD}")
1213

13-
configure_and_build_preset "CCCL C Parallel Library" "$PRESET" "$CMAKE_OPTIONS"
14+
configure_and_build_preset "CCCL C Parallel Library" "$PRESET" "${CMAKE_OPTIONS[@]}"
1415

1516
print_time_summary

0 commit comments

Comments
 (0)