#!/bin/sh GPGPUSIM_CONFIG=$1 if [ "x$GPGPUSIM_CONFIG" = "x" ]; then echo "Usage: $0 " 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