-
Notifications
You must be signed in to change notification settings - Fork 24
/
setup_config.sh
executable file
·61 lines (52 loc) · 1.66 KB
/
setup_config.sh
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
#!/bin/sh
if [ ! -n "$GPGPUSIM_ROOT" ]; then
echo "ERROR ** GPGPUSIM_ROOT not set. Run setup_environment first.";
fi
BENCHMARKS=`ls -1 -F | awk '/\//' | sed 's/\///'`;
GPGPUSIM_CONFIG=$1
if [ "x$GPGPUSIM_CONFIG" = "x" ]; then
echo "";
echo "Usage: $0 <GPGPU-Sim Config Name | --cleanup>"
echo "where <GPGPU-Sim Config Name> is one of:"
ls -1 $GPGPUSIM_ROOT/configs
echo "";
exit 0
fi
if [ "x$GPGPUSIM_ROOT" = "x" ]; then
GPGPUSIM_ROOT="$PWD/.."
fi
if [ $1 = "--cleanup" ]; then
echo "Removing existing configs in the following directories:"
for BMK in $BENCHMARKS; do
if [ -f $BMK/gpgpusim.config ]; then
echo "$BMK"
OLD_ICNT=`awk '/-inter_config_file/ { print $2 }' $BMK/gpgpusim.config`
rm $BMK/gpgpusim.config $BMK/$OLD_ICNT
fi
done
exit 0
fi
GPU_CONFIG_FILE=$GPGPUSIM_ROOT/configs/$GPGPUSIM_CONFIG/gpgpusim.config
if [ -f $GPU_CONFIG_FILE ]; then
echo "Found GPGPU-Sim config file: $GPU_CONFIG_FILE"
else
echo "Unknown config: $GPGPUSIM_CONFIG"
exit 0
fi
ICNT_CONFIG=`awk '/-inter_config_file/ { print $2 }' $GPU_CONFIG_FILE`
ICNT_CONFIG=$GPGPUSIM_ROOT/configs/$GPGPUSIM_CONFIG/$ICNT_CONFIG
if [ -f $GPU_CONFIG_FILE ]; then
echo "Interconnection config file detected: $ICNT_CONFIG"
else
echo "Interconnection config file not found: $ICNT_CONFIG"
exit 0
fi
for BMK in $BENCHMARKS; do
if [ -f $BMK/gpgpusim.config ]; then
echo "Existing symbolic-links to config found in $BMK! Skipping... "
else
echo "Adding symbolic-links to configuration files for $BMK:"
ln -v -s $GPU_CONFIG_FILE $BMK
ln -v -s $ICNT_CONFIG $BMK
fi
done