summaryrefslogtreecommitdiff
path: root/benchmarks/setup_config.sh
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/setup_config.sh')
-rwxr-xr-xbenchmarks/setup_config.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/benchmarks/setup_config.sh b/benchmarks/setup_config.sh
new file mode 100755
index 0000000..4da67c0
--- /dev/null
+++ b/benchmarks/setup_config.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+GPGPUSIM_CONFIG=$1
+if [ "x$GPGPUSIM_CONFIG" = "x" ]; then
+ echo "Usage: $0 <GPGPU-Sim Config Name | --cleanup>"
+ exit 0
+fi
+
+if [ "x$GPGPUSIM_ROOT" = "x" ]; then
+ GPGPUSIM_ROOT="$PWD/.."
+fi
+
+BENCHMARKS=`ls -1 CUDA | sed 's/\(.\)/\.\/CUDA\/\1/'`
+
+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
+