From ff72d642da2ccfceee015bf69c03f3eecdc6ec8d Mon Sep 17 00:00:00 2001 From: jjenista Date: Fri, 24 Sep 2010 23:44:38 +0000 Subject: [PATCH] found a bug, wasn't returning pointer at end of poolcreate--pool allocation doesn't seem to improve SOR speedup --- .../src/Analysis/OoOJava/OoOJavaAnalysis.java | 6 +- Robust/src/Benchmarks/oooJava/sor/makefile | 2 +- .../src/Benchmarks/oooJava/sor/speedup.notes | 93 +++++++++++++++++++ Robust/src/IR/Flat/BuildCode.java | 4 +- Robust/src/Runtime/memPool.h | 12 +-- 5 files changed, 104 insertions(+), 13 deletions(-) create mode 100644 Robust/src/Benchmarks/oooJava/sor/speedup.notes diff --git a/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java b/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java index 20d5f548..2424ae8d 100644 --- a/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java +++ b/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java @@ -1540,7 +1540,11 @@ public class OoOJavaAnalysis { throws java.io.IOException { if (!fsen.getIsCallerSESEplaceholder()) { - bw.write("SESE " + fsen.getPrettyIdentifier() + " {\n"); + bw.write("SESE " + fsen.getPrettyIdentifier()); + if( fsen.getIsLeafSESE() ) { + bw.write(" (leaf)"); + } + bw.write(" {\n"); bw.write(" in-set: " + fsen.getInVarSet() + "\n"); Iterator tItr = fsen.getInVarSet().iterator(); diff --git a/Robust/src/Benchmarks/oooJava/sor/makefile b/Robust/src/Benchmarks/oooJava/sor/makefile index 4f8d6da4..cebb6c20 100644 --- a/Robust/src/Benchmarks/oooJava/sor/makefile +++ b/Robust/src/Benchmarks/oooJava/sor/makefile @@ -6,7 +6,7 @@ BUILDSCRIPT=../../../buildscript USEOOO= -ooojava 24 2 -ooodebug -BSFLAGS= -64bit -mainclass $(PROGRAM) -heapsize-mb 6*1024 -garbagestats -debug -joptimize -noloop -optimize -ooodebug-disable-task-mem-pool +BSFLAGS= -64bit -mainclass $(PROGRAM) -heapsize-mb 6*1024 -garbagestats -debug -joptimize -noloop -optimize #-ooodebug-disable-task-mem-pool #-coreprof -coreprof-eventwords 1024*1024*128 #-coreprof-checkoverflow DISJOINT= -disjoint -disjoint-k 1 -enable-assertions #-disjoint-desire-determinism diff --git a/Robust/src/Benchmarks/oooJava/sor/speedup.notes b/Robust/src/Benchmarks/oooJava/sor/speedup.notes new file mode 100644 index 00000000..3f6c727b --- /dev/null +++ b/Robust/src/Benchmarks/oooJava/sor/speedup.notes @@ -0,0 +1,93 @@ +Without using memory pool allocation for task records: +Single: Avg. execution time over 3 runs is +742.761s / 3 = 247.587s + +Par: Avg. execution time over 3 runs is +165.59s / 3 = 55.197s + +NO POOL: speedup 4.49x + + + + +With memory pool allocation: +Single: 697.984 / 3 = 232.661s +Par: 184.572 / 3 = 61.524s + +POOL: speedup 3.78x + + + + +RAW DATA BELOW: + + + +WITHOUT MEM POOL: +jjenista@dc-10:~/research/Robust/src/Benchmarks/oooJava/sor$ ./runs; ./runs; ./runs; ./runp; ./runp; ./runp +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 4m35.011s +user 4m34.672s +sys 0m0.273s +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 3m53.994s +user 3m53.689s +sys 0m0.263s +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 3m53.756s +user 3m53.470s +sys 0m0.244s +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 0m55.299s +user 9m11.543s +sys 12m28.633s +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 0m55.240s +user 9m10.687s +sys 12m27.857s +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 0m55.051s +user 9m9.511s +sys 12m24.147s + + + +WITH MEM POOL + +jjenista@dc-10:~/research/Robust/src/Benchmarks/oooJava/sor$ ./runs; ./runs; ./runs; ./runp; ./runp; ./runp +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 3m52.918s +user 3m52.633s +sys 0m0.244s +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 3m52.731s +user 3m52.449s +sys 0m0.240s +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 3m52.335s +user 3m52.054s +sys 0m0.240s +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 0m53.868s +user 9m2.613s +sys 12m8.709s +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 1m17.154s +user 13m28.935s +sys 16m45.794s +Section2:SOR:Kernel 0.000000 (s) inf (Iterations/s)Finished + +real 0m53.550s +user 9m2.889s +sys 12m0.588s diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 884f9a1f..ca23a771 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -3642,8 +3642,8 @@ public class BuildCode { } // before doing anything, lock your own record and increment the running children - if( (state.MLP && fsen != mlpa.getMainSESE()) || - (state.OOOJAVA && fsen != oooa.getMainSESE()) + if( (state.MLP && fsen != mlpa.getMainSESE()) || + (state.OOOJAVA && fsen != oooa.getMainSESE()) ) { output.println(" atomic_inc(&(runningSESE->numRunningChildren));"); } diff --git a/Robust/src/Runtime/memPool.h b/Robust/src/Runtime/memPool.h index 356e15e8..b9b55cf6 100644 --- a/Robust/src/Runtime/memPool.h +++ b/Robust/src/Runtime/memPool.h @@ -19,10 +19,6 @@ ////////////////////////////////////////////////////////// #include - -// just until uninitialized mem bug found -#include - #include "mlp_lock.h" @@ -56,6 +52,7 @@ static MemPool* poolcreate( int itemSize ) { p->head = calloc( 1, itemSize ); p->head->next = NULL; p->tail = p->head; + return p; } @@ -113,16 +110,13 @@ static inline void* poolalloc( MemPool* p ) { if( headCurrent->next == NULL ) { // only one item, so don't take from pool - //return malloc( p->itemSize ); - - // just until uninitialized mem bug found - return calloc( 1, p->itemSize ); + return malloc( p->itemSize ); } p->head = headCurrent->next; // just until uninitialized mem bug found - memset( headCurrent, 0, p->itemSize ); + //memset( headCurrent, 0, p->itemSize ); return headCurrent; } -- 2.34.1