Skip to content

Commit 3fc2438

Browse files
committed
Adapt spack script to gpu support
1 parent bae00ef commit 3fc2438

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

examples/gprat_cpp/run_gprat_spack.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@ if command -v spack &> /dev/null; then
1515
HOSTNAME=$(hostname -s)
1616

1717
if [[ "$HOSTNAME" == "ipvs-epyc1" ]]; then
18-
spack install gprat%[email protected] blas=openblas
19-
spack load gprat blas=openblas
2018
module load gcc/14.2.0
2119
export CXX=g++
2220
export CC=gcc
21+
spack install gprat%[email protected] blas=openblas
22+
spack load gprat blas=openblas
23+
elif [[ "$HOSTNAME" == "simcl1n1" || "$HOSTNAME" == "simcl1n2" ]]; then
24+
# Check if the gprat_gpu_clang environment exists
25+
module load clang/17.0.1
26+
export CXX=clang++
27+
export CC=clang
28+
spack install gprat%[email protected] blas=openblas +cuda
29+
spack load gprat blas=openblas +cuda
2330
else
2431
echo "Hostname is $HOSTNAME — no action taken."
2532
fi
@@ -46,5 +53,13 @@ make -j
4653
################################################################################
4754
# Run code
4855
################################################################################
56+
if [[ -z "$1" ]]; then
57+
echo "Input parameter is missing. Using default: Run computations on CPU"
58+
elif [[ "$1" == "gpu" ]]; then
59+
use_gpu="--use_gpu"
60+
elif [[ "$1" != "cpu" ]]; then
61+
echo "Please specify input parameter: cpu/gpu"
62+
exit 1
63+
fi
4964

5065
./gprat_cpp $1

0 commit comments

Comments
 (0)