Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/lamont/test/sum-reduction/run.sh
ViewVC logotype

View of /branches/lamont/test/sum-reduction/run.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2548 - (download) (as text) (annotate)
Wed Feb 26 14:22:24 2014 UTC (7 years, 3 months ago) by lamonts
File size: 1905 byte(s)
Fixed global reduction block
#!/bin/bash

rm -rf results
 
#PARTICLES=6000000
#STEP=1000000

PARTICLES=600
STEP=100

STRAND_RUNS=5
DIRN="results"
SEQ="seq.txt" 

mkdir $DIRN

CSIZE[0]=4
CSIZE[1]=8
CSIZE[2]=16
CSIZE[3]=32
CSIZE[4]=64

cp pvst.r $DIRN/ 
cp speedup.r $DIRN/ 
cp genData.c $DIRN/

../../bin/diderotc  --double --target=pthread --exec sum-reduction.diderot
mv ./sum-reduction sum-reduction-p 
../../bin/diderotc  --double --target=c --exec sum-reduction.diderot
mv ./sum-reduction sum-reduction-s

cp pvt.r $DIRN/
cp speedup.r $DIRN/
cd $DIRN

for i in `seq  1 $STRAND_RUNS`; do 
	PDIR=$[$PARTICLES + $[STEP * $[$i - 1]]]
    echo "**** Particles ($PDIR) ****"
	mkdir $PDIR
	cp  ../sum-reduction-p $PDIR
	cp  ../sum-reduction-s $PDIR
	cd $PDIR
  for j in `seq 1 6`; do 
  	    
  	    if [ $j == 6 ]; then 
  	    	for k in `seq 1 20`; do
  	    	echo "=Running Iteration #$k in Sequential=" 
	   	  	 ../../../../bin/diderotc  --double --target=c --exec sum-reduction.diderot
			 ./sum-reduction-s -timing -nNumbers $PDIR >> $SEQ  2>&1
			 done
	   	else 
			for k in `seq 1 20`; do
	    		WSIZE=${CSIZE[$[$j -1]]}
	    		echo "=Running Iteration #$k with Processor size $WSIZE=" 
	    		WFILE="stat_$WSIZE.txt" 
	    		./sum-reduction-p -timing -nNumbers $PDIR -np $WSIZE -wgsize 8192 >> $WFILE  2>&1
    		done
 		fi

   done 
   cd ..
done  

#Generate the graph data 
clang -std=c99 genData.c -o genData

for i in `seq  1 6`; do 
  	 WSIZE=${CSIZE[$[$i -1]]}
	for j in `seq 1 $STRAND_RUNS`; do 
		PDIR=$[$PARTICLES + $[STEP * $[$j - 1]]]
	    SEQ="seq.txt" 
	    WFILE="stat_$WSIZE.txt" 
	    if [ $i == 6 ]; then 
	   		./genData 20 $j $STRAND_RUNS $PDIR/$SEQ
	   	else 
	   		./genData 20 $j $STRAND_RUNS $PDIR/$WFILE
	   	fi
   done 
done  

#Generate processor vs execution time graph 
R --slave -f pvst.r 
mv Rplots.pdf pvst.pdf 

#Generate speedup time graph 
R --slave -f speedup.r 
mv Rplots.pdf speedup.pdf 

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0