From a01422e1bdbf78f2fc5e10a0d6ced9e4824bc228 Mon Sep 17 00:00:00 2001 From: Jan Vales Date: Mon, 30 Jan 2012 18:12:48 +0100 Subject: [PATCH] i can haz graphs plz? --- scan/runAll.sh | 24 +++++++++++++++++++++++- scan/scan.c | 12 +++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/scan/runAll.sh b/scan/runAll.sh index 7de8905..c57462b 100755 --- a/scan/runAll.sh +++ b/scan/runAll.sh @@ -11,9 +11,31 @@ if [ ! -e build ]; then fi STARTTS="`date --iso-8601=minutes`" +NODELIST="$(seq 0 4 32)" +NNPLIST="$(seq 0 4 16)" +RUNLIST="$(seq 0 25000 100000) $(seq 0 250000 1000000) $(seq 0 2500000 10000000)" echo "STARTING: stats/raw/${STARTTS}" mkdir -p "stats/raw/${STARTTS}" -mpirun -node 1-32 -nnp 1 build/scan &> stats/raw/tmp && echo "done" && mv stats/raw/tmp "stats/raw/${STARTTS}/scan" +for nno in $NODELIST; do + for nnnp in $NNPLIST; do + for i in $RUNLIST; do + if [ "$nno" -eq "0" ] ; then + nno=2 + fi + if [ "$nnnp" -eq "0" ] ; then + nnnp=1 + fi + if [ "$i" -eq "0" ] ; then + echo "* ignoring 0 run *" + else + echo "running with nno:${nno} nnnp:${nnnp} n:${i}" + mpirun -node 1-${nno} -nnp ${nnnp} build/scan -n${i} &> stats/tmp && mv stats/tmp "stats/raw/${STARTTS}/no${nno}_nnp${nnnp}_n${i}" + cat "stats/raw/${STARTTS}/no${nno}_nnp${nnnp}_n${i}" | grep "timing" + fi + done + done +done + diff --git a/scan/scan.c b/scan/scan.c index aff36b0..0f5badd 100755 --- a/scan/scan.c +++ b/scan/scan.c @@ -169,23 +169,22 @@ int main(int argc, char *argv[]){ MPI_Finalize(); exit(3); } - +#ifdef DEBUG fprintf(stdout, "[%d/%d:%s] file read - distributing work.\n",rank,nodes,name); +#endif startTime = MPI_Wtime(); MPI_Isend(databuf, size-1, MPI_LONG, 0, KEY, MPI_COMM_WORLD, &request); } - /* stuff done by all nodes */ + /* receive work and propagate to next node, if not last node. */ if (startTime == 0) startTime = MPI_Wtime(); tmp = rank -1; if(tmp < 0) tmp = 0; MPI_Recv(databuf, size, MPI_LONG, tmp, KEY, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - - /* propagate data, if not last node. */ if(rank +1 < nodes) MPI_Send(databuf, size, MPI_LONG, rank+1, KEY, MPI_COMM_WORLD); prepTime = MPI_Wtime(); - /* do processing here. */ + /* do actual work here. */ for(unsigned long i = (rank*blocksize+1); i < ((rank+1)*blocksize) && i < size; i++){ databuf[i] = databuf[(i-1)] + databuf[i]; } @@ -224,14 +223,17 @@ int main(int argc, char *argv[]){ MPI_Recv(databuf, size, MPI_LONG, nodes-1, KEY, MPI_COMM_WORLD, MPI_STATUS_IGNORE); endTime = MPI_Wtime(); fprintf(stdout, "[%d/%d:%s] result: %li\n",rank,nodes,name,databuf[size-1]); + fprintf(stdout, "[%d/%d:%s] timings: prep:%f algo:%f postp:%f end:%f\n",rank,nodes,name,prepTime-startTime,algoTime-startTime,postpTime-startTime,endTime-startTime); #ifdef DEBUG fprintf(stdout, "[%d/%d:%s] res array ",rank,nodes,name); array_contents(databuf, size); #endif } +#ifdef DEBUG if(endTime == 0) endTime = MPI_Wtime(); fprintf(stdout, "[%d/%d:%s] timings: prep:%f algo:%f postp:%f end:%f\n",rank,nodes,name,prepTime-startTime,algoTime-startTime,postpTime-startTime,endTime-startTime); +#endif MPI_Finalize(); return 0; } -- 2.43.0