Commit 1b7c1920 authored by Belviranli, Mehmet E's avatar Belviranli, Mehmet E
Browse files

modified experiment scripts to include a timeout value

parent 1ee9b89d
......@@ -4,10 +4,11 @@ STEP=$1
OUTPUT=$2
GLOBAL=$3
NORMAL=$4
JUGG=$4
REGULAR_ITERS=$5
PROFILE_ITERS=$6
OVERHEAD=$7
TIMEOUT=$7
FILE=$2
PARAM=$3
......@@ -23,11 +24,11 @@ VERIFICATION=-c
APPS=( HEAT SW SAT DTW INT JACOBI LUD )
SCHED_POLICIES=( RR RR2 LF )
NVPROF="timeout 1000 nvprof --events l2_subp0_write_sector_misses,l2_subp0_total_write_sector_queries,l2_subp0_read_sector_misses,l2_subp0_total_read_sector_queries"
#NVPROF="nvprof --events l2_subp0_write_sector_misses,l2_subp1_write_sector_misses,l2_subp0_total_write_sector_queries,l2_subp1_total_write_sector_queries,l2_subp0_read_sector_misses,l2_subp1_read_sector_misses,l2_subp0_total_read_sector_queries,l2_subp1_total_read_sector_queries"
#TIMING_CMD="/usr/bin/time -f totalProcessTime\t%e"
NVPROF="$TIMING_CMD timeout 600 nvprof --events l2_subp0_write_sector_misses,l2_subp0_total_write_sector_queries,l2_subp0_read_sector_misses,l2_subp0_total_read_sector_queries"
EXEC=./OMP_CUDART
EXEC="./OMP_CUDART"
# The main experiment including the profiling results
if [ $STEP -eq 0 ] ; then
......@@ -54,7 +55,7 @@ if [ $STEP -eq 0 ] ; then
COMMAND="$EXEC -n $dataSize -b $tbSize -r $timeIter -i 1 -d 1 -a $APP -s $SCHED_POLICY"
if [ $NORMAL -eq 1 ] ; then
if [ $JUGG -eq 1 ] ; then
i="0"
while [ $i -lt $REGULAR_ITERS ]
do
......@@ -63,16 +64,42 @@ if [ $STEP -eq 0 ] ; then
if [ $i -eq 0 ] && [ "$SCHED_POLICY" = "RR2" ] ; then
COMMAND_MOD="$COMMAND $VERIFICATION"
fi
exit_status=124
timout_ctr=0
while [ $exit_status -eq 124 ]
do
COMMAND_MOD2=$COMMAND_MOD
if [ ! -z "$TIMEOUT" ]; then
COMMAND_MOD2="$TIMING_CMD timeout $TIMEOUT $COMMAND_MOD2"
fi
echo $COMMAND_MOD2 > $OUTPUT.tmp.$APP
( set -x ; $COMMAND_MOD2 >> $OUTPUT.tmp.$APP )
exit_status=$?
if [ $exit_status -eq 124 ]; then
echo "WARNING: Execution timed out, running again..."
timout_ctr=$[$timout_ctr+1]
fi
if [ $timout_ctr -eq 5 ]; then
echo "WARNING: Too many timeouts, skipping this run...."
exit_status=1
fi
done
cat $OUTPUT.tmp.$APP >> $OUTPUT.$APP
rm $OUTPUT.tmp.$APP
i=$[$i+1]
echo $COMMAND_MOD >> $OUTPUT.$APP
( set -x ; $COMMAND_MOD >> $OUTPUT.$APP )
done
i="0"
while [ $i -lt $PROFILE_ITERS ]
do
i=$[$i+1]
echo $COMMAND >> $OUTPUT.$APP
echo $COMMAND >> $OUTPUT.PROF.$APP
( set -x ; $NVPROF $COMMAND >>$OUTPUT.PROF.$APP 2>>$OUTPUT.PROF.$APP )
done
fi
......@@ -84,16 +111,40 @@ if [ $STEP -eq 0 ] ; then
i="0"
while [ $i -lt $REGULAR_ITERS ]
do
exit_status=124
timout_ctr=0
while [ $exit_status -eq 124 ]
do
COMMAND_MOD2=$COMMAND
if [ ! -z "$TIMEOUT" ]; then
COMMAND_MOD2="$TIMING_CMD timeout $TIMEOUT $COMMAND_MOD2"
fi
echo $COMMAND_MOD2 > $OUTPUT.tmp.$APP
( set -x ; $COMMAND_MOD2 >> $OUTPUT.tmp.$APP )
exit_status=$?
if [ $exit_status -eq 124 ]; then
echo "WARNING: Execution timed out, running again..."
timout_ctr=$[$timout_ctr+1]
fi
if [ $timout_ctr -eq 5 ]; then
echo "WARNING: Too many timeouts, skipping this run...."
exit_status=1
fi
done
cat $OUTPUT.tmp.$APP >> $OUTPUT.$APP
rm $OUTPUT.tmp.$APP
i=$[$i+1]
echo $COMMAND >> $OUTPUT.$APP
( set -x ; $COMMAND >> $OUTPUT.$APP )
done
i="0"
while [ $i -lt $PROFILE_ITERS ]
do
i=$[$i+1]
#echo $COMMAND >> $OUTPUT.$APP
#echo $COMMAND >> $OUTPUT.PROF.$APP
#( set -x ; $NVPROF $COMMAND >>$OUTPUT.PROF.$APP 2>>$OUTPUT.PROF.$APP )
done
fi
......@@ -123,7 +174,7 @@ if [ $STEP -eq 2 ] ; then
dataSize=22680
tbSize=756
if [ $NORMAL -eq 1 ] ; then
if [ $JUGG -eq 1 ] ; then
for (( i=2; i<=$maxIters; i++ ))
do
COMMAND="$EXEC -n $dataSize -b $tbSize -r $i -i 1 -d 1 -a $APP -s $SCHED_POLICY"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment