From 4ff44d7e27834ad695f511e63a6f15c28c069bb6 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 3 Aug 2010 08:20:02 +0000 Subject: [PATCH] change --- .../oooJava/sor/JGFSORBenchSizeD.java | 19 +++--- .../src/Benchmarks/oooJava/sor/SORRunner.java | 3 +- Robust/src/Runtime/garbage.c | 2 +- Robust/src/Runtime/mlp_runtime.c | 58 +++++++++++++------ Robust/src/Runtime/mlp_runtime.h | 8 +-- Robust/src/buildscript | 2 - 6 files changed, 60 insertions(+), 32 deletions(-) diff --git a/Robust/src/Benchmarks/oooJava/sor/JGFSORBenchSizeD.java b/Robust/src/Benchmarks/oooJava/sor/JGFSORBenchSizeD.java index bd1ce691..80d7605d 100644 --- a/Robust/src/Benchmarks/oooJava/sor/JGFSORBenchSizeD.java +++ b/Robust/src/Benchmarks/oooJava/sor/JGFSORBenchSizeD.java @@ -23,13 +23,18 @@ public class JGFSORBenchSizeD{ public static void main(String argv[]){ int nthreads; + nthreads = 1; + int size = 3; if(argv.length != 0 ) { - nthreads = Integer.parseInt(argv[0]); - } else { - System.printString("The no of threads has not been specified, defaulting to 1\n"); - System.printString(" \n"); - nthreads = 1; - } + size = Integer.parseInt(argv[0]); + } +// if(argv.length != 0 ) { +// nthreads = Integer.parseInt(argv[0]); +// } else { +// System.printString("The no of threads has not been specified, defaulting to 1\n"); +// System.printString(" \n"); +// nthreads = 1; +// } JGFInstrumentor instr = new JGFInstrumentor(); //JGFInstrumentor.printHeader(2,0,nthreads); @@ -37,7 +42,7 @@ public class JGFSORBenchSizeD{ JGFSORBench sor; sor = new JGFSORBench(nthreads); - int size = 3; + JGFInstrumentor.addTimer("Section2:SOR:Kernel", "Iterations",size, instr.timers); sor.JGFsetsize(size); diff --git a/Robust/src/Benchmarks/oooJava/sor/SORRunner.java b/Robust/src/Benchmarks/oooJava/sor/SORRunner.java index a66568d9..6891e3c7 100644 --- a/Robust/src/Benchmarks/oooJava/sor/SORRunner.java +++ b/Robust/src/Benchmarks/oooJava/sor/SORRunner.java @@ -19,7 +19,7 @@ * * **************************************************************************/ -class SORRunner extends Thread { +class SORRunner { int id, num_iterations; double G[][],omega; @@ -147,5 +147,6 @@ class SORRunner extends Thread { } //barrier }//end of for + } //end of run() } diff --git a/Robust/src/Runtime/garbage.c b/Robust/src/Runtime/garbage.c index 9e7b62ee..db7363a1 100644 --- a/Robust/src/Runtime/garbage.c +++ b/Robust/src/Runtime/garbage.c @@ -35,7 +35,7 @@ extern struct QI * tailqi; #define NUMPTRS 100 -#define INITIALHEAPSIZE 256*1024*1024L +#define INITIALHEAPSIZE 8*1024*1024*1024L #define GCPOINT(x) ((INTPTR)((x)*0.99)) /* This define takes in how full the heap is initially and returns a new heap size to use */ #define HEAPSIZE(x,y) ((INTPTR)(x+y))*2 diff --git a/Robust/src/Runtime/mlp_runtime.c b/Robust/src/Runtime/mlp_runtime.c index a9cdb3e0..e106cc60 100644 --- a/Robust/src/Runtime/mlp_runtime.c +++ b/Robust/src/Runtime/mlp_runtime.c @@ -20,9 +20,33 @@ void mlpInitOncePerThread() { */ __thread SESEcommon_p seseCaller; +__thread void * baseptr=NULL; + +__thread int spaceleft=0; + +#define MBLOCK 65536 +#define MLOW 1000 + +void * MLPMALLOC(int size) { + // printf("%d\n",size); + if (spaceleftspaceleft) { + return malloc(size); + } else { + //rount size up + size=(size+7)&~7; + char *charbase=(char *)baseptr; + baseptr=(void *)(charbase+size); + spaceleft-=size; + return charbase; + } +} void* mlpAllocSESErecord( int size ) { - void* newrec = RUNMALLOC( size ); + void* newrec = MLPMALLOC( size ); if( newrec == 0 ) { printf( "mlpAllocSESErecord did not obtain memory!\n" ); exit( -1 ); @@ -32,12 +56,12 @@ void* mlpAllocSESErecord( int size ) { void mlpFreeSESErecord( void* seseRecord ) { - RUNFREE( seseRecord ); + // MLPFREE( seseRecord ); } MemoryQueue** mlpCreateMemoryQueueArray(int numMemoryQueue){ int i; - MemoryQueue** newMemoryQueue=(MemoryQueue**)RUNMALLOC( sizeof( MemoryQueue* ) * numMemoryQueue ); + MemoryQueue** newMemoryQueue=(MemoryQueue**)MLPMALLOC( sizeof( MemoryQueue* ) * numMemoryQueue ); for(i=0; itype=type; newREntry->seseRec=seseToIssue; newREntry->pointer=dynID; - if((*newREntry->pointer)!=0){// make sure it is not unresolved address. - struct ___Object___ * obj=(struct ___Object___*)((unsigned INTPTR)*newREntry->pointer); + if (obj!=NULL) newREntry->oid=obj->oid; - } + return newREntry; } REntry* mlpCreateREntry(int type, void* seseToIssue){ - REntry* newREntry=(REntry*)RUNMALLOC(sizeof(REntry)); + REntry* newREntry=(REntry*)MLPMALLOC(sizeof(REntry)); newREntry->type=type; newREntry->seseRec=seseToIssue; return newREntry; @@ -162,10 +186,10 @@ int generateKey(unsigned int data){ Hashtable* createHashtable(){ int i=0; - Hashtable* newTable=(Hashtable*)RUNMALLOC(sizeof(Hashtable)); + Hashtable* newTable=(Hashtable*)MLPMALLOC(sizeof(Hashtable)); newTable->item.type=HASHTABLE; for(i=0;iarray[i]=(BinElement*)RUNMALLOC(sizeof(BinElement)); + newTable->array[i]=(BinElement*)MLPMALLOC(sizeof(BinElement)); newTable->array[i]->head=NULL; newTable->array[i]->tail=NULL; } @@ -174,34 +198,34 @@ Hashtable* createHashtable(){ } WriteBinItem* createWriteBinItem(){ - WriteBinItem* binitem=(WriteBinItem*)RUNMALLOC(sizeof(WriteBinItem)); + WriteBinItem* binitem=(WriteBinItem*)MLPMALLOC(sizeof(WriteBinItem)); binitem->item.type=WRITEBIN; return binitem; } ReadBinItem* createReadBinItem(){ - ReadBinItem* binitem=(ReadBinItem*)RUNMALLOC(sizeof(ReadBinItem)); + ReadBinItem* binitem=(ReadBinItem*)MLPMALLOC(sizeof(ReadBinItem)); binitem->index=0; binitem->item.type=READBIN; return binitem; } Vector* createVector(){ - Vector* vector=(Vector*)RUNMALLOC(sizeof(Vector)); + Vector* vector=(Vector*)MLPMALLOC(sizeof(Vector)); vector->index=0; vector->item.type=VECTOR; return vector; } SCC* createSCC(){ - SCC* scc=(SCC*)RUNMALLOC(sizeof(SCC)); + SCC* scc=(SCC*)MLPMALLOC(sizeof(SCC)); scc->item.type=SINGLEITEM; return scc; } MemoryQueue* createMemoryQueue(){ - MemoryQueue* queue = (MemoryQueue*)RUNMALLOC(sizeof(MemoryQueue)); - MemoryQueueItem* dummy=(MemoryQueueItem*)RUNMALLOC(sizeof(MemoryQueueItem)); + MemoryQueue* queue = (MemoryQueue*)MLPMALLOC(sizeof(MemoryQueue)); + MemoryQueueItem* dummy=(MemoryQueueItem*)MLPMALLOC(sizeof(MemoryQueueItem)); dummy->type=3; // dummy type dummy->total=0; dummy->status=READY; diff --git a/Robust/src/Runtime/mlp_runtime.h b/Robust/src/Runtime/mlp_runtime.h index 148f8594..0cf680e3 100644 --- a/Robust/src/Runtime/mlp_runtime.h +++ b/Robust/src/Runtime/mlp_runtime.h @@ -15,8 +15,8 @@ #define TRUE 1 #endif -#define NUMBINS 64 -#define NUMREAD 64 +#define NUMBINS 512 +#define NUMREAD 16 #define NUMITEMS 64 #define NUMRENTRY 256 @@ -49,15 +49,15 @@ #endif typedef struct REntry_t{ - int type; // fine read:0, fine write:1, parent read:2, parent write:3 coarse: 4, parent coarse:5, scc: 6 struct Hashtable_t* hashtable; struct BinItem_t* binitem; struct Vector_t* vector; struct SCC_t* scc; struct MemoryQueue_t* queue; - psemaphore parentStallSem; void* seseRec; INTPTR* pointer; + psemaphore parentStallSem; + int type; // fine read:0, fine write:1, parent read:2, parent write:3 coarse: 4, parent coarse:5, scc: 6 int oid; int isBufMode; } REntry; diff --git a/Robust/src/buildscript b/Robust/src/buildscript index 1de6f6cc..0a32ae2f 100755 --- a/Robust/src/buildscript +++ b/Robust/src/buildscript @@ -492,8 +492,6 @@ then COREPROF=true JAVAOPTS="$JAVAOPTS -coreprof" EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF -I$ROBUSTROOT/Runtime/coreprof" -shift -shift elif [[ $1 = '-mlp' ]] then -- 2.34.1