SCM Repository
View of /benchmarks/scripts/run-one_sh.in
Parent Directory
|
Revision Log
Revision 3165 -
(download)
(annotate)
Sun Mar 29 19:06:39 2015 UTC (7 years, 3 months ago) by jhr
File size: 7530 byte(s)
Sun Mar 29 19:06:39 2015 UTC (7 years, 3 months ago) by jhr
File size: 7530 byte(s)
fixing typos in benchmarking script
#!/bin/ksh # # A script for running a single Diderot benchmark test. The results are output to a # JSON file named <bmark>-report.<date>-<time>. There is also a log file produced # that contains the build messages. # # usage: # scripts/run-one.sh bmark nruns nprocs nworkers [diderotc-flags] [-- runtime-flags] # where # bmark name of benchmark # nruns number of runs per benchmark version # nprocs max number of processors for parallel version (0 means no parallel run) # nworkers max number of workers/CU for GPU version (0 means no GPU run) # # @configure_input@ # # this script should be run from the rtest directory # HERE=$(pwd) if [ ! -d $HERE/programs ] ; then echo "run script from benchmarks directory" exit 1 fi # flags to enable/disable the running of specific benchmarks # if [ x"@TARGET_TEEM@" = x ] ; then ENABLE_TEEM=no else ENABLE_TEEM=yes fi if [ x"@TARGET_SEQ@" = x ] ; then ENABLE_SEQ=no else ENABLE_SEQ=yes fi if [ x"@TARGET_PAR@" = x ] ; then ENABLE_PAR=no else ENABLE_PAR=yes fi if [ x"@TARGET_CL@" = x ] ; then ENABLE_CL=no else ENABLE_CL=yes fi if [ x"@TARGET_CUDA@" = x ] ; then ENABLE_CUDA=no else ENABLE_CUDA=yes fi function usage { echo "usage:" echo " scripts/run-one.sh bmark nruns nprocs nworkers [diderotc-flags] [-- runtime-flags]" exit 1 } # get the name of the benchmark, number of runs, and max number of processors # if (( $# >= 4 )) ; then BMARK=$1; shift NRUNS=$1; shift MAXNP=$1; shift MAXNW=$1; shift if [ ! -d programs/$BMARK ] ; then echo "$BMARK is not a valid benchmark name" exit 1 fi else usage 1 fi # process the rest of the command-line arguments # DIDEROTC_FLAGS="" RUNTIME_FLAGS="" # get diderotc flags while [ $# -ne 0 ] ; do case $1 in --) shift; break ;; # switch modes -*) DIDEROTC_FLAGS="$DIDEROTC_FLAGS $1" ;; *) echo "unrecognized argument" usage 1 ;; esac shift done # get runtime flags if [ $# -gt 0 ] ; then RUNTIME_FLAGS="$*" else RUNTIME_FLAGS="" fi HOSTNAME=$( hostname -s ) DATE=$( date +"%F" ) TIME=$( date +"%H-%M-%S" ) LOG=$HERE/$BMARK-log.$DATE-$TIME REPORT=$HERE/$BMARK-report.$DATE-$TIME DIDEROTC_VERSION=$(@DIDEROTC@ --version) # compile the benchmark # cd programs/$BMARK if [ ! -f Makefile ] ; then echo "no Makefile for $BMARK; run configure to generate" exit 1 fi echo "********** $BMARK **********" > $LOG # clean out old executables make clean 2>> $LOG 1>> $LOG # customize build targets TARGETS="@TARGET_TEEM@ @TARGET_SEQ@" if [ $ENABLE_PAR = yes ] ; then if (($MAXNP > 0)) ; then TARGETS="$TARGETS bmark-par" fi fi if (($MAXNW > 0)) ; then if [ $ENABLE_CL = yes ] ; then TARGETS="$TARGETS bmark-cl" fi if [ $ENABLE_CUDA = yes ] ; then TARGETS="$TARGETS bmark-cuda" fi fi # # rebuild $TARGETS using the given DIDEROTC_FLAGS # if [ x"$DIDEROTC_FLAGS" != x ] ; then make DIDEROTC_FLAGS="$DIDEROTC_FLAGS" $TARGETS 2>> $LOG 1>> $LOG else make $TARGETS 2>> $LOG 1>> $LOG fi if [ "$?" -eq "0" ] ; then # # JSON header # cat - > $REPORT <<XXXX { "bmark" : "$BMARK", "host" : "$HOSTNAME", "version" : "$DIDEROTC_VERSION", "nruns" : $NRUNS, "max-nprocs" : $MAXNP, "max-nworkers" : $MAXNP, "date" : "$DATE", "time" : "$TIME", "diderotc-flags" : "$DIDEROTC_FLAGS", "runtime-flags" : "$RUNTIME_FLAGS", "results" : [ XXXX # # run teem version of benchmark # if [ $ENABLE_TEEM = yes ] ; then echo " {" >> $REPORT echo " \"name\" : \"teem\"," >> $REPORT echo " \"nprocs\" : 1," >> $REPORT echo " \"times\" : [" >> $REPORT print -n "bmark-teem " for ((i=1; $i <= $NRUNS; i++)) ; do print -n "." RESULT=$( ./bmark-teem | sed -e s/usr=// ) if (($i == $NRUNS)) ; then echo " $RESULT" >> $REPORT else echo " $RESULT," >> $REPORT fi done echo " ]" >> $REPORT if [ $ENABLE_SEQ = yes -o $ENABLE_PAR = yes -o $ENABLE_CL -o $ENABLE_CUDA = yes ] ; then echo " }," >> $REPORT else echo " }" >> $REPORT fi fi # # run sequential Diderot version of benchmark # if [ $ENABLE_SEQ = yes ] ; then echo " {" >> $REPORT echo " \"name\" : \"seq\"," >> $REPORT echo " \"nprocs\" : 1," >> $REPORT echo " \"times\" : [" >> $REPORT print -n "\nbmark-seq " for ((i=1; $i <= $NRUNS; i++)) ; do print -n "." RESULT=$( ./bmark-seq -t | sed -e s/usr=// ) if (($i == $NRUNS)) ; then echo " $RESULT" >> $REPORT else echo " $RESULT," >> $REPORT fi done echo " ]" >> $REPORT if [ $ENABLE_PAR = yes -o $ENABLE_CL = yes -o $ENABLE_CUDA = yes ] ; then echo " }," >> $REPORT else echo " }" >> $REPORT fi fi # # run parallel Diderot version of benchmark # if [ $ENABLE_PAR = yes ] ; then for ((np=1; $np <= $MAXNP; np++)) ; do print -n "\nbmark-par-$np " echo " {" >> $REPORT echo " \"name\" : \"par-$np\"," >> $REPORT echo " \"nprocs\" : $np," >> $REPORT echo " \"times\" : [" >> $REPORT for ((i=1; $i <= $NRUNS; i++)) ; do print -n "." RESULT=$( ./bmark-par -t -n $np | sed -e s/usr=// ) if (($i == $NRUNS)) ; then echo " $RESULT" >> $REPORT else echo " $RESULT," >> $REPORT fi done echo " ]" >> $REPORT if (($np < $MAXNP)) ; then echo " }," >> $REPORT elif [ $ENABLE_CL = yes -o $ENABLE_CUDA = yes ] ; then echo "! }," >> $REPORT else echo " }" >> $REPORT fi done fi # # run OpenCL Diderot version of benchmark # if [ $ENABLE_CL = yes ] ; then for ((nw=1; $nw <= $MAXNW; nw++)) ; do print -n "\nbmark-cl-$nw " echo " {" >> $REPORT echo " \"name\" : \"cl-$nw\"," >> $REPORT echo " \"nprocs\" : $nw," >> $REPORT echo " \"times\" : [" >> $REPORT for ((i=1; $i <= $NRUNS; i++)) ; do print -n "." RESULT=$( ./bmark-cl -t -n $nw | sed -e s/usr=// ) if (($i == $NRUNS)) ; then echo " $RESULT" >> $REPORT else echo " $RESULT," >> $REPORT fi done echo " ]" >> $REPORT if (($nw < $MAXNW)) ; then echo " }," >> $REPORT elif [ $ENABLE_CUDA = yes ] ; then echo " }," >> $REPORT else echo " }" >> $REPORT fi done fi # # run CUDA Diderot version of benchmark # if [ $ENABLE_CUDA = yes ] ; then for ((nw=1; $nw <= $MAXNW; nw++)) ; do print -n "\nbmark-cuda-$nw " echo " {" >> $REPORT echo " \"name\" : \"cl-$nw\"," >> $REPORT echo " \"nprocs\" : $nw," >> $REPORT echo " \"times\" : [" >> $REPORT for ((i=1; $i <= $NRUNS; i++)) ; do print -n "." RESULT=$( ./bmark-cuda -t -n $nw | sed -e s/usr=// ) if (($i == $NRUNS)) ; then echo " $RESULT" >> $REPORT else echo " $RESULT," >> $REPORT fi done echo " ]" >> $REPORT if (($nw < $MAXNW)) ; then echo " }," >> $REPORT else echo " }" >> $REPORT fi done fi print "" COMPLETED_AT=$( date +"%H-%M-%S" ) cat - >> $REPORT <<XXXX ], "completed-at" : "$COMPLETED_AT" } XXXX else echo "build failed" >> $REPORT echo "build of $BMARK failed" fi echo "report in $REPORT"
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |