forked from HPC-Dwarfs/RabbitCT
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun-bench.sh
More file actions
executable file
·67 lines (57 loc) · 1.88 KB
/
Copy pathrun-bench.sh
File metadata and controls
executable file
·67 lines (57 loc) · 1.88 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
#!/bin/bash
# Copyright (C) NHR@FAU, University Erlangen-Nuremberg.
# All rights reserved. This file is part of RabbitCT.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
TOOLCHAIN="${TOOLCHAIN:-CLANG}"
RUNNER="./rabbitRunner-${TOOLCHAIN}"
INPUT="./RabbitInput/RabbitInput.rct"
GEOMETRY="./RabbitInput/RabbitGeometry.rct"
VARIANT="LolaOMP"
# OMP worker threads inherit OMP_STACKSIZE, not the process ulimit. The
# default is too small for the L=1024 collapsed parallel-for at high thread
# counts and causes segfaults in LolaASM and LolaISPC.
export OMP_STACKSIZE="${OMP_STACKSIZE:-64M}"
usage() {
echo "Usage: $0 -s <size> [-v <variant>] [-n <numProc>] [-o <outfile>]"
echo ""
echo " -s <size> Problem size: 128, 256, 512, 1024"
echo " -v <variant> Algorithm variant (default: ${VARIANT})"
echo " Available: LolaOMP, LolaBunny, LolaOPT, LolaASM, LolaISPC"
echo " -n <numProc> Number of processors for likwid-pin (optional)"
echo " -o <outfile> Output volume file (optional)"
echo ""
echo "Environment: TOOLCHAIN (default: CLANG)"
exit 1
}
while getopts "s:v:n:o:h" opt; do
case $opt in
s) SIZE="$OPTARG" ;;
v) VARIANT="$OPTARG" ;;
n) NUM_PROC="$OPTARG" ;;
o) VOLOUT="-o $OPTARG" ;;
h) usage ;;
*) usage ;;
esac
done
if [ -z "$SIZE" ]; then
echo "Error: -s <size> is required"
usage
fi
if [ ! -x "$RUNNER" ]; then
echo "Error: Runner not found: $RUNNER"
echo "Build with: make TOOLCHAIN=$TOOLCHAIN"
exit 1
fi
REFVOL="./RabbitInput/Reference${SIZE}.vol"
CHECK=""
if [ -f "$REFVOL" ]; then
CHECK="-c $REFVOL"
fi
CMD="$RUNNER -b 1 -m $VARIANT -a $GEOMETRY -i $INPUT $CHECK $VOLOUT -s $SIZE"
if [ -n "$NUM_PROC" ]; then
PIN="${PIN:-likwid-pin}"
CMD="$PIN -c N:0-${NUM_PROC} $CMD"
fi
echo "$CMD"
exec $CMD