add Tilera version stuff in buildscript and removes some redundant codes to avoid...
authorjzhou <jzhou>
Fri, 24 Apr 2009 00:05:40 +0000 (00:05 +0000)
committerjzhou <jzhou>
Fri, 24 Apr 2009 00:05:40 +0000 (00:05 +0000)
15 files changed:
Robust/src/IR/State.java
Robust/src/Main/Main.java
Robust/src/Runtime/GenericHashtable.c
Robust/src/Runtime/ObjectHash.c
Robust/src/Runtime/RAW/runtime_arch.h
Robust/src/Runtime/RAW/task_arch.c
Robust/src/Runtime/SimpleHash.c
Robust/src/Runtime/mem.c
Robust/src/Runtime/multicoreruntime.c
Robust/src/Runtime/multicoreruntime.h
Robust/src/Runtime/multicoretask.c
Robust/src/Runtime/object.c
Robust/src/Runtime/runtime.h
Robust/src/Runtime/socket.c
Robust/src/buildscript

index 011a1756c0c5eecb52a70f42e29cc14eeaedcb72..aec082572bb3d601ae1f85fea549191f99ced0a7 100644 (file)
@@ -66,7 +66,6 @@ public class State {
   public String OWNERSHIPALIASFILE=null;
   public boolean OPTIONAL=false;
   public boolean ARRAYBOUNDARYCHECK=true;
-  public boolean RAW=false;
   public boolean SCHEDULING=false;
   public boolean USEPROFILE=false;
   public boolean THREAD=false;
index 743d309c7fdc6043202920daba4184855ad32b66..d70417c9228654ada8c77cb3f0894c1703c7fbeb 100644 (file)
@@ -135,8 +135,6 @@ public class Main {
        state.OPTIMIZE=true;
       else if (option.equals("-dcopts"))
        state.DCOPTS=true;
-      else if (option.equals("-raw"))
-       state.RAW=true;
       else if (option.equals("-scheduling"))
        state.SCHEDULING=true;
       else if (option.equals("-distributioninfo"))
@@ -196,7 +194,6 @@ public class Main {
        System.out.println("-mlp build mlp code, report progress and interim results");
        System.out.println("-multicore generate multi-core version binary");
        System.out.println("-numcore set the number of cores (should be used together with -multicore), defaultly set as 1");
-       System.out.println("-raw generate raw version binary (should be used together with -multicore)");
        System.out.println("-interrupt generate raw version binary with interruption (should be used togethere with -raw)");
        System.out.println("-rawconfig config raw simulator as 4xn (should be used together with -raw)");
        System.out.println("-rawpath print out execute path information for raw version (should be used together with -raw)");
index a3f838ca47a84dc087c4d879202c607e21e1bc05..83a65b63eff3ebe544dc3a09e2fee8c2b7c085e6 100755 (executable)
@@ -115,7 +115,7 @@ int hashsize(struct genhashtable *ht) {
 void genrehash(struct genhashtable * ht) {
   struct genpointerlist **newbins=(struct genpointerlist **) RUNMALLOC(sizeof (struct genpointerlist *)*ht->currentsize);
   struct genpointerlist **oldbins=ht->bins;
-  long j,i;
+  long i;
 
   for(i=0; i<ht->currentsize; i++) {
     struct genpointerlist * tmpptr=oldbins[i];
index 77a9233bf92bac550af399fce02b0617768cb7e9..8312857dcb49e003cb324f8698df804797bd04b3 100755 (executable)
@@ -66,7 +66,6 @@ int ObjectHashremove(struct ObjectHash *thisvar, int key) {
   unsigned int hashkey = (unsigned int)key % thisvar->size;
 
   struct ObjectNode **ptr = &thisvar->bucket[hashkey];
-  int i;
 
   while (*ptr) {
     if ((*ptr)->key == key) {
index e4d75541d554335292abfd40ce2e90af4f99c0c4..6e33e5cf2cd1f05dde0c2e842a948b4aa73e5585 100644 (file)
@@ -10,6 +10,9 @@
 #include <raw.h>
 #include <raw_compiler_defs.h>
 
+#define BAMBOO_CACHE_LINE_SIZE (kCacheLineSize)
+#define BAMBOO_CACHE_LINE_MASK (kCacheLineMask)
+
 #define BAMBOO_TOTALCORE (raw_get_num_tiles())  // the total # of cores available in the processor
 #define BAMBOO_NUM_OF_CORE corenum   // the # of current residing core
 #define BAMBOO_GET_NUM_OF_CORE() (raw_get_abs_pos_x() + raw_get_array_size_x() * raw_get_abs_pos_y())  // compute the # of current residing core
index f7408602fb1ca48658c69182a940e9ee6bbdd8ae..52c00c1c6ffb9e2cea970f1b10cf069829fbb435 100644 (file)
@@ -3,10 +3,10 @@
 #include "multicoreruntime.h"
 #include "runtime_arch.h"
 
-inline void initialization() {
+__attribute__((always_inline)) inline void initialization() {
 } // initialization()
 
-inline void initCommunication() {
+__attribute__((always_inline)) inline void initCommunication() {
 #ifdef INTERRUPT
   if (corenum < NUMCORES) {
     // set up interrupts
@@ -16,7 +16,7 @@ inline void initCommunication() {
 #endif
 }
 
-inline void fakeExecution() {
+__attribute__((always_inline)) inline void fakeExecution()  {
   // handle communications
   while(true) {
          receiveObject();
@@ -31,7 +31,7 @@ void begin() {
   run(NULL);
 }
 
-inline void terminate() {
+__attribute__((always_inline)) inline void terminate()  {
        raw_test_done(1);
 }
 
@@ -42,7 +42,7 @@ inline void terminate() {
 
 // transfer an object to targetcore
 // format: object
-void transferObject(struct transObjInfo * transObj) {
+inline void transferObject(struct transObjInfo * transObj) {//  __attribute__((always_inline)){
   void * obj = transObj->objptr;
   int type=((int *)obj)[0];
   int targetcore = transObj->targetcore;  
@@ -138,7 +138,7 @@ void transferObject(struct transObjInfo * transObj) {
   }
 }
 
-inline void send_msg_1 (int targetcore, int n0) {
+__attribute__((always_inline)) inline void send_msg_1 (int targetcore, int n0) {
   // send this msg
   unsigned msgHdr;
   int self_y, self_x, target_y, target_x;
@@ -206,7 +206,7 @@ inline void send_msg_1 (int targetcore, int n0) {
   }
 }
 
-inline void send_msg_2 (int targetcore, int n0, int n1) {
+__attribute__((always_inline)) inline void send_msg_2 (int targetcore, int n0, int n1) {
   // send this msg
   unsigned msgHdr;
   int self_y, self_x, target_y, target_x;
@@ -278,7 +278,7 @@ inline void send_msg_2 (int targetcore, int n0, int n1) {
   }
 }
 
-inline void send_msg_3 (int targetcore, int n0, int n1, int n2) {
+__attribute__((always_inline)) inline void send_msg_3 (int targetcore, int n0, int n1, int n2) {
   // send this msg
   unsigned msgHdr;
   int self_y, self_x, target_y, target_x;
@@ -354,7 +354,7 @@ inline void send_msg_3 (int targetcore, int n0, int n1, int n2) {
   }
 }
 
-inline void send_msg_4 (int targetcore, int n0, int n1, int n2, int n3) {
+__attribute__((always_inline)) inline void send_msg_4 (int targetcore, int n0, int n1, int n2, int n3) {
   // send this msg
   unsigned msgHdr;
   int self_y, self_x, target_y, target_x;
@@ -434,7 +434,7 @@ inline void send_msg_4 (int targetcore, int n0, int n1, int n2, int n3) {
   }
 }
 
-inline void send_msg_5 (int targetcore, int n0, int n1, int n2, int n3, int n4) {
+__attribute__((always_inline)) inline void send_msg_5 (int targetcore, int n0, int n1, int n2, int n3, int n4) {
   // send this msg
   unsigned msgHdr;
   int self_y, self_x, target_y, target_x;
@@ -518,7 +518,7 @@ inline void send_msg_5 (int targetcore, int n0, int n1, int n2, int n3, int n4)
   }
 }
 
-inline void send_msg_6 (int targetcore, int n0, int n1, int n2, int n3, int n4, int n5) {
+__attribute__((always_inline)) inline void send_msg_6 (int targetcore, int n0, int n1, int n2, int n3, int n4, int n5) {
   // send this msg
   unsigned msgHdr;
   int self_y, self_x, target_y, target_x;
@@ -606,7 +606,7 @@ inline void send_msg_6 (int targetcore, int n0, int n1, int n2, int n3, int n4,
   }
 }
 
-inline void cache_msg_2 (int targetcore, int n0, int n1) {
+__attribute__((always_inline)) inline void cache_msg_2 (int targetcore, int n0, int n1) {
   // cache this msg
 #ifdef DEBUG
   BAMBOO_DEBUGPRINT(0xdede);
@@ -620,7 +620,7 @@ inline void cache_msg_2 (int targetcore, int n0, int n1) {
   outmsgdata[outmsglast++] = n1;
 }
 
-inline void cache_msg_3 (int targetcore, int n0, int n1, int n2) {
+__attribute__((always_inline)) inline void cache_msg_3 (int targetcore, int n0, int n1, int n2) {
   // cache this msg
 #ifdef DEBUG
   BAMBOO_DEBUGPRINT(0xdede);
@@ -635,7 +635,7 @@ inline void cache_msg_3 (int targetcore, int n0, int n1, int n2) {
   outmsgdata[outmsglast++] = n2;
 }
 
-inline void cache_msg_4 (int targetcore, int n0, int n1, int n2, int n3) {
+__attribute__((always_inline)) inline void cache_msg_4 (int targetcore, int n0, int n1, int n2, int n3) {
   // cache this msg
 #ifdef DEBUG
   BAMBOO_DEBUGPRINT(0xdede);
@@ -651,7 +651,7 @@ inline void cache_msg_4 (int targetcore, int n0, int n1, int n2, int n3) {
   outmsgdata[outmsglast++] = n3;
 }
 
-inline void cache_msg_6 (int targetcore, int n0, int n1, int n2, int n3, int n4, int n5) {
+__attribute__((always_inline)) inline void cache_msg_6 (int targetcore, int n0, int n1, int n2, int n3, int n4, int n5) {
   // cache this msg
 #ifdef DEBUG
   BAMBOO_DEBUGPRINT(0xdede);
@@ -669,7 +669,7 @@ inline void cache_msg_6 (int targetcore, int n0, int n1, int n2, int n3, int n4,
   outmsgdata[outmsglast++] = n5;
 }
 
-inline int receiveMsg() {
+__attribute__((always_inline)) inline int receiveMsg() {
   if(gdn_input_avail() == 0) {
 #ifdef DEBUG
     if(corenum < NUMCORES) {
@@ -724,7 +724,7 @@ inline int receiveMsg() {
 }
 
 #ifdef PROFILE
-inline void profileTaskStart(char * taskname) {
+__attribute__((always_inline)) inline void profileTaskStart(char * taskname) {
   if(!taskInfoOverflow) {
          TaskInfo* taskInfo = RUNMALLOC(sizeof(struct task_info));
          taskInfoArray[taskInfoIndex] = taskInfo;
@@ -736,7 +736,7 @@ inline void profileTaskStart(char * taskname) {
   }
 }
 
-inline void profileTaskEnd() {
+__attribute__((always_inline)) inline void profileTaskEnd() {
   if(!taskInfoOverflow) {
          taskInfoArray[taskInfoIndex]->endTime = raw_get_cycle();
          taskInfoIndex++;
index b877a7adcae20a78d0e2c5442465ac70797d942a..5f872e06c1e46bc2cff7d5661c4efedb8e7d3164 100755 (executable)
@@ -66,7 +66,6 @@ int RuntimeHashremovekey(struct RuntimeHash *thisvar, int key) {
   unsigned int hashkey = (unsigned int)key % thisvar->size;
 
   struct RuntimeNode **ptr = &thisvar->bucket[hashkey];
-  int i;
 
   while (*ptr) {
     if ((*ptr)->key == key) {
@@ -98,7 +97,6 @@ int RuntimeHashremove(struct RuntimeHash *thisvar, int key, int data) {
   unsigned int hashkey = (unsigned int)key % thisvar->size;
 
   struct RuntimeNode **ptr = &thisvar->bucket[hashkey];
-  int i;
 
   while (*ptr) {
     if ((*ptr)->key == key && (*ptr)->data == data) {
index c134e50758e821c9ce9ff03bcd5e81908f0ea058..5ef956b0a232edba30a2ea2dc397a0c32e06db5f 100644 (file)
 
 void * mycalloc(int m, int size) {
   void * p = NULL;
-  int isize = 2*kCacheLineSize-4+(size-1)&(~kCacheLineMask);
+  int isize = 2*BAMBOO_CACHE_LINE_SIZE-4+(size-1)&(~BAMBOO_CACHE_LINE_MASK);
   BAMBOO_START_CRITICAL_SECTION_MEM();
   p = BAMBOO_SHARE_MEM_CALLOC(m, isize); // calloc(m, isize);
   BAMBOO_CLOSE_CRITICAL_SECTION_MEM();
-  return (void *)(kCacheLineSize+((int)p-1)&(~kCacheLineMask));
+  return (void *)(BAMBOO_CACHE_LINE_SIZE+((int)p-1)&(~BAMBOO_CACHE_LINE_MASK));
 }
 
 void * mycalloc_i(int m, int size) {
   void * p = NULL;
-  int isize = 2*kCacheLineSize-4+(size-1)&(~kCacheLineMask);
+  int isize = 2*BAMBOO_CACHE_LINE_SIZE-4+(size-1)&(~BAMBOO_CACHE_LINE_MASK);
   p = BAMBOO_SHARE_MEM_CALLOC(m, isize); // calloc(m, isize);
-  return (void *)(kCacheLineSize+((int)p-1)&(~kCacheLineMask));
+  return (void *)(BAMBOO_CACHE_LINE_SIZE+((int)p-1)&(~BAMBOO_CACHE_LINE_MASK));
 }
 
 void myfree(void * ptr) {
index 498a3ec04fc84a231a48a1b7b89521065325c800..5f25575f942ac8577a2e614459a0e3646f2806f9 100644 (file)
@@ -8,6 +8,9 @@
 #ifndef RAW
 #include <stdio.h>
 #endif
+#ifdef MULTICORE
+#include "runtime_arch.h"
+#endif
 //#include "option.h"
 
 extern int classsize[];
@@ -28,7 +31,7 @@ int instaccum=0;
 #include "dmalloc.h"
 #endif
 
-#ifdef RAW
+#ifdef MULTICORE
 void initializeexithandler() {
 }
 #else
@@ -51,8 +54,8 @@ void initializeexithandler() {
 /* This function inject failures */
 
 void injectinstructionfailure() {
-#ifdef RAW
-  // not supported in RAW version
+#ifdef MULTICORE
+  // not supported in MULTICORE version
   return;
 #else
 #ifdef TASK
@@ -87,31 +90,31 @@ void injectinstructionfailure() {
 }
 
 void CALL11(___System______exit____I,int ___status___, int ___status___) {
+#ifdef MULTICORE
+  BAMBOO_EXIT(___status___);
+#else
 #ifdef DEBUG
   printf("exit in CALL11\n");
 #endif
-#ifdef RAW
-  raw_test_done(___status___);
-#else
   exit(___status___);
 #endif
 }
 
 void CALL11(___System______printI____I,int ___status___, int ___status___) {
+#ifdef MULTICORE
+  BAMBOO_DEBUGPRINT(0x1111);
+  BAMBOO_DEBUGPRINT_REG(___status___);
+#else
 #ifdef DEBUG
   printf("printI in CALL11\n");
 #endif
-#ifdef RAW
-  raw_test_pass(0x1111);
-  raw_test_pass_reg(___status___);
-#else
   printf("%d\n", ___status___);
 #endif
 }
 
 long CALL00(___System______currentTimeMillis____) {
-#ifdef RAW
-  // not supported in RAW version
+#ifdef MULTICORE
+  // not supported in MULTICORE version
   return -1;
 #else
   struct timeval tv; long long retval;
@@ -124,7 +127,7 @@ long CALL00(___System______currentTimeMillis____) {
 }
 
 void CALL01(___System______printString____L___String___,struct ___String___ * ___s___) {
-#ifdef RAW
+#ifdef MULTICORE
 #else
   struct ArrayObject * chararray=VAR(___s___)->___value___;
   int i;
index e76254a036f1645240b259a4aaba7d1015c34710..164a1b8d1ef7865594c7b3cee906cd79c76ba7ba 100644 (file)
@@ -106,7 +106,7 @@ inline void cache_msg_3(int targetcore, int n0, int n1, int n2) __attribute__((a
 inline void cache_msg_4(int targetcore, int n0, int n1, int n2, int n3) __attribute__((always_inline));
 inline void cache_msg_6(int targetcore, int n0, int n1, int n2, int n3, int n4, int n5) __attribute__((always_inline));
 inline void transferObject(struct transObjInfo * transObj);
-inline int receiveMsg(void) __attribute__((always_inline)) __attribute__((always_inline));
+inline int receiveMsg(void) __attribute__((always_inline));
 
 #ifdef PROFILE
 inline void profileTaskStart(char * taskname) __attribute__((always_inline));
@@ -142,6 +142,8 @@ inline void profileTaskEnd(void) __attribute__((always_inline));
 //  BAMBOO_CLOSE_CRITICAL_SECTION(): locks for all global data structures          //
 //  BAMBOO_WAITING_FOR_LOCK(): routine executed while waiting for lock request     //
 //                             response                                            //
+//  BAMBOO_CACHE_LINE_SIZE: the cache line size                                    //
+//  BAMBOO_CACHE_LINE_MASK: mask for a cache line                                  //
 //  BAMBOO_CACHE_FLUSH_RANGE(x, y): flush cache lines started at x with length y   //
 //  BAMBOO_CACHE_FLUSH_ALL(): flush the whole cache of a core if necessary         //
 //  BAMBOO_EXIT(x): exit routine                                                   //
index 3dd7dc42f01f97ab28cd88a5a7e968a315c1da6d..4becf4ef0852f6397f8a12f56f429cb9ea551d12 100644 (file)
@@ -2,6 +2,7 @@
 #include "runtime.h"
 #include "multicoreruntime.h"
 #include "runtime_arch.h"
+#include "GenericHashtable.h"
 /*
    extern int injectfailures;
    extern float failurechance;
@@ -36,7 +37,6 @@ void releasereadlock(void* ptr);
 bool getwritelock(void* ptr);
 void releasewritelock(void* ptr);
 void releasewritelock_r(void * lock, void * redirectlock);
-inline void run(void * arg);
 
 // specific functions used inside critical sections
 void enqueueObject_I(void * ptr, struct parameterwrapper ** queues, int length);
@@ -367,7 +367,7 @@ inline void run(void * arg) {
                                                                  totalexetime = BAMBOO_GET_EXE_TIME();
 #else
                                                                  BAMBOO_DEBUGPRINT(0xbbbbbbbb);
-                                                                 BAMBOO_DEBUGPRINT(BAMBOO_GET_EXE_TIME());
+                                                                 BAMBOO_DEBUGPRINT((int)BAMBOO_GET_EXE_TIME());
 #endif
                                                                  // profile mode, send msgs to other cores to request pouring
                                                                  // out progiling data
@@ -822,7 +822,7 @@ void enqueueObject(void * vptr, struct parameterwrapper ** vqueues, int vlength)
        struct ___Object___ *ptr = (struct ___Object___ *)vptr;
        
        {
-               struct QueueItem *tmpptr;
+               //struct QueueItem *tmpptr;
                struct parameterwrapper * parameter=NULL;
                int j;
                int i;
@@ -848,7 +848,7 @@ void enqueueObject(void * vptr, struct parameterwrapper ** vqueues, int vlength)
                                if (tagptr==NULL)
                                        goto nextloop; //that means the object has no tag but that param needs tag
                                else if(tagptr->type==TAGTYPE) { //one tag
-                                       struct ___TagDescriptor___ * tag=(struct ___TagDescriptor___*) tagptr;   
+                                       //struct ___TagDescriptor___ * tag=(struct ___TagDescriptor___*) tagptr;         
                                        for(i=0; i<parameter->numbertags; i++) {
                                                //slotid is parameter->tagarray[2*i];
                                                int tagid=parameter->tagarray[2*i+1];
@@ -892,7 +892,7 @@ void enqueueObject_I(void * vptr, struct parameterwrapper ** vqueues, int vlengt
        struct ___Object___ *ptr = (struct ___Object___ *)vptr;
        
        {
-               struct QueueItem *tmpptr;
+               //struct QueueItem *tmpptr;
                struct parameterwrapper * parameter=NULL;
                int j;
                int i;
@@ -918,7 +918,7 @@ void enqueueObject_I(void * vptr, struct parameterwrapper ** vqueues, int vlengt
                                if (tagptr==NULL)
                                        goto nextloop; //that means the object has no tag but that param needs tag
                                else if(tagptr->type==TAGTYPE) { //one tag
-                                       struct ___TagDescriptor___ * tag=(struct ___TagDescriptor___*) tagptr;   
+                                       //struct ___TagDescriptor___ * tag=(struct ___TagDescriptor___*) tagptr;         
                                        for(i=0; i<parameter->numbertags; i++) {
                                                //slotid is parameter->tagarray[2*i];
                                                int tagid=parameter->tagarray[2*i+1];
@@ -1269,7 +1269,7 @@ int processlockrequest(int locktype, int lock, int obj, int requestcore, int roo
 //                            otherwise -- received msg type
 int receiveObject() {
   int deny = 0;
-  int targetcore = 0;
+  //int targetcore = 0;
   
 msg:
   if(receiveMsg() == -1) {
@@ -1906,7 +1906,7 @@ bool getwritelock(void * ptr) {
   int targetcore = 0;
 
   // for 32 bit machine, the size is always 5 words
-  int msgsize = 5;
+  //int msgsize = 5;
 
   lockobj = (int)ptr;
   if(((struct ___Object___ *)ptr)->lock == NULL) {
@@ -2261,11 +2261,11 @@ void releasewritelock_I_r(void * lock, void * redirectlock) {
 int enqueuetasks(struct parameterwrapper *parameter, struct parameterwrapper *prevptr, struct ___Object___ *ptr, int * enterflags, int numenterflags) {
   void * taskpointerarray[MAXTASKPARAMS];
   int j;
-  int numparams=parameter->task->numParameters;
+  //int numparams=parameter->task->numParameters;
   int numiterators=parameter->task->numTotal-1;
   int retval=1;
-  int addnormal=1;
-  int adderror=1;
+  //int addnormal=1;
+  //int adderror=1;
 
   struct taskdescriptor * task=parameter->task;
 
@@ -2298,7 +2298,7 @@ backtrackinit:
 
   while(1) {
     /* Enqueue current state */
-    int launch = 0;
+    //int launch = 0;
     struct taskparamdescriptor *tpd=RUNMALLOC(sizeof(struct taskparamdescriptor));
     tpd->task=task;
     tpd->numParameters=numiterators+1;
@@ -2340,11 +2340,11 @@ backtrackinc:
 int enqueuetasks_I(struct parameterwrapper *parameter, struct parameterwrapper *prevptr, struct ___Object___ *ptr, int * enterflags, int numenterflags) {
   void * taskpointerarray[MAXTASKPARAMS];
   int j;
-  int numparams=parameter->task->numParameters;
+  //int numparams=parameter->task->numParameters;
   int numiterators=parameter->task->numTotal-1;
   int retval=1;
-  int addnormal=1;
-  int adderror=1;
+  //int addnormal=1;
+  //int adderror=1;
 
   struct taskdescriptor * task=parameter->task;
 
@@ -2377,7 +2377,7 @@ backtrackinit:
 
   while(1) {
     /* Enqueue current state */
-    int launch = 0;
+    //int launch = 0;
     struct taskparamdescriptor *tpd=RUNMALLOC_I(sizeof(struct taskparamdescriptor));
     tpd->task=task;
     tpd->numParameters=numiterators+1;
@@ -2457,6 +2457,8 @@ void removereadfd(int fd) {
 #define OFFSET 0
 #endif
 
+int containstag(struct ___Object___ *ptr, struct ___TagDescriptor___ *tag);
+
 void executetasks() {
   void * taskpointerarray[MAXTASKPARAMS+OFFSET];
   int numparams=0;
@@ -2780,7 +2782,7 @@ parameterpresent:
 #endif
 #endif  // #if 0: for recovery
        if (x=setjmp(error_handler)) {
-         int counter;
+         //int counter;
          /* Recover */
 #ifdef DEBUG
 #ifndef RAW
@@ -2930,7 +2932,7 @@ void processobject(struct parameterwrapper *parameter, int index, struct paramet
 
   for(i=0; i<pd->numbertags; i++) {
     int slotid=pd->tagarray[2*i];
-    int tagid=pd->tagarray[2*i+1];
+    //int tagid=pd->tagarray[2*i+1];
     if (statusarray[slotid+numparams]!=0) {
       /* This tag has already been enqueued, use it to narrow search */
       parameter->iterators[*iteratorcount].tagbindings[tagcount]=slotid+numparams;
index 766d2a64470b23f2a26d2b7db8c4ade230f8d666..a935927d8b775701bb7e909564fbfad6bab91282 100644 (file)
@@ -1,6 +1,6 @@
 #include "object.h"
-#ifdef RAW
-#include <raw.h>
+#ifdef MULTICORE
+#include "runtime_arch.h"
 #else
 #include "stdio.h"
 #endif
@@ -74,8 +74,8 @@ int CALL01(___Object______MonitorExit____, struct ___Object___ * ___this___) {
     pthread_cond_broadcast(&objcond);
     pthread_mutex_unlock(&objlock);
   } else {
-#ifdef RAW
-    raw_test_done(-1);
+#ifdef MULTICORE
+    BAMBOO_EXIT(-1);
 #else
     printf("ERROR...UNLOCKING LOCK WE DON'T HAVE\n");
     exit(-1);
index 3b4dd34cefad5b012ad163a529066013ed1e281a..7480746b369fa9cfbf55d0f05ef5009a5bb7ef29 100644 (file)
@@ -92,8 +92,8 @@ void createstartupobject();
 
 #ifdef TASK
 #include "SimpleHash.h"
-#include "chash.h"
 #ifndef MULTICORE
+#include "chash.h"
 #include "ObjectHash.h"
 #include "structdefs.h"
 #endif
@@ -127,7 +127,8 @@ extern struct ___Object___ * ___fcrevert___;
 #endif
 
 #ifdef MULTICORE
-inline int receiveObject(void);
+inline void run(void * arg);
+int receiveObject(void);
 void flagorand(void * ptr, int ormask, int andmask, struct parameterwrapper ** queues, int length);
 void flagorandinit(void * ptr, int ormask, int andmask);
 void enqueueObject(void * ptr, struct parameterwrapper ** queues, int length);
index 12f5d4396ecda18ec63b3b12929d0e280051bc4d..564e74283860002738b047198b957a60dde7fdca 100644 (file)
@@ -1,7 +1,7 @@
 #include "runtime.h"
 #include "structdefs.h"
 #include <fcntl.h>
-#ifndef RAW
+#ifndef MULTICORE
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <strings.h>
@@ -15,8 +15,8 @@
 struct RuntimeHash *fdtoobject;
 
 int CALL24(___Socket______nativeConnect____I__AR_B_I, int ___fd___, int ___port___, struct ___Socket___ * ___this___, int ___fd___, struct ArrayObject * ___address___,int ___port___) {
-#ifdef RAW
-  // not supported in RAW version
+#ifdef MULTICORE
+  // not supported in MULTICORE version
   return -1;
 #else
   struct sockaddr_in sin;
@@ -64,17 +64,21 @@ error:
 
 #ifdef TASK
 int CALL12(___Socket______nativeBindFD____I, int ___fd___, struct ___Socket___ * ___this___, int ___fd___) {
+#ifdef MULTICORE
+#else
   if (RuntimeHashcontainskey(fdtoobject, ___fd___))
     RuntimeHashremovekey(fdtoobject, ___fd___);
   RuntimeHashadd(fdtoobject, ___fd___, (int) VAR(___this___));
   addreadfd(___fd___);
+#endif
+  return 0;
 }
 #endif
 
 
 int CALL12(___Socket______nativeBind_____AR_B_I, int ___port___,  struct ArrayObject * ___address___, int ___port___) {
-#ifdef RAW
-  // not supported in RAW version
+#ifdef MULTICORE
+  // not supported in MULTICORE version
   return -1;
 #else
   int fd;
@@ -131,8 +135,8 @@ error:
 }
 
 struct ArrayObject * CALL01(___InetAddress______getHostByName_____AR_B, struct ArrayObject * ___hostname___) {
-#ifdef RAW
-  // not supported in RAW version
+#ifdef MULTICORE
+  // not supported in MULTICORE version
   return NULL;
 #else
 //struct ArrayObject * CALL01(___InetAddress______getHostByName_____AR_B, struct ___ArrayObject___ * ___hostname___) {
@@ -180,8 +184,8 @@ struct ArrayObject * CALL01(___InetAddress______getHostByName_____AR_B, struct A
 
 
 int CALL12(___ServerSocket______createSocket____I, int port, struct ___ServerSocket___ * ___this___, int port) {
-#ifdef RAW
-  // not supported in RAW version
+#ifdef MULTICORE
+  // not supported in MULTICORE version
   return -1;
 #else
   int fd;
@@ -285,8 +289,8 @@ int CALL12(___ServerSocket______createSocket____I, int port, struct ___ServerSoc
 }
 
 int CALL02(___ServerSocket______nativeaccept____L___Socket___,struct ___ServerSocket___ * ___this___, struct ___Socket___ * ___s___) {
-#ifdef RAW
-  // not supported in RAW version
+#ifdef MULTICORE
+  // not supported in MULTICORE version
   return -1;
 #else
   struct sockaddr_in sin;
@@ -328,8 +332,6 @@ int CALL02(___ServerSocket______nativeaccept____L___Socket___,struct ___ServerSo
 #ifdef MULTICORE
   flagorand(VAR(___this___),0,0xFFFFFFFE,NULL,0);
   enqueueObject(VAR(___this___), NULL, 0);
-  //flagorand(VAR(___this___),0,0xFFFFFFFE,objq4socketobj[corenum],numqueues4socketobj[corenum]);
-  //enqueueObject(VAR(___this___), objq4socketobj[corenum], numqueues4socketobj[corenum]);
 #else
   flagorand(VAR(___this___),0,0xFFFFFFFE);
   enqueueObject(VAR(___this___));
@@ -354,7 +356,7 @@ void CALL24(___Socket______nativeWrite_____AR_B_I_I, int offset, int length, str
     }
 
     if (length!=0) {
-#ifndef RAW
+#ifndef MULTICORE
       perror("ERROR IN NATIVEWRITE");
       printf("error=%d remaining bytes %d\n",errno, length);
 #endif
@@ -395,7 +397,7 @@ int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___,
 
 
   if (byteread<0) {
-#ifndef RAW
+#ifndef MULTICORE
     printf("ERROR IN NATIVEREAD\n");
     perror("");
 #endif
@@ -404,8 +406,6 @@ int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___,
 #ifdef MULTICORE
   flagorand(VAR(___this___),0,0xFFFFFFFE,NULL,0);
   enqueueObject(VAR(___this___), NULL, 0);
-  //flagorand(VAR(___this___),0,0xFFFFFFFE,objq4socketobj[corenum],numqueues4socketobj[corenum]);
-  //enqueueObject(VAR(___this___),objq4socketobj[corenum],numqueues4socketobj[corenum]);
 #else
   flagorand(VAR(___this___),0,0xFFFFFFFE);
   enqueueObject(VAR(___this___));
@@ -415,21 +415,17 @@ int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___,
 }
 
 void CALL01(___Socket______nativeClose____, struct ___Socket___ * ___this___) {
+#ifdef MULTICORE
+#else
   int fd=VAR(___this___)->___fd___;
   int data;
 #ifdef TASK
   RuntimeHashget(fdtoobject, fd, &data);
   RuntimeHashremove(fdtoobject, fd, data);
   removereadfd(fd);
-#ifdef MULTICORE
-  flagorand(VAR(___this___),0,0xFFFFFFFE,NULL,0);
-  enqueueObject(VAR(___this___), NULL, 0);
-  //flagorand(VAR(___this___),0,0xFFFFFFFE,objq4socketobj[corenum],numqueues4socketobj[corenum]);
-  //enqueueObject(VAR(___this___),objq4socketobj[corenum],numqueues4socketobj[corenum]);
-#else
   flagorand(VAR(___this___),0,0xFFFFFFFE);
   enqueueObject(VAR(___this___));
-#endif
 #endif
   close(fd);
+#endif
 }
index 3fb9e3cad9db86289dc4a83b8761397a5cd36b1f..8242ff842825c5e5aec06fe7ce5f36ad99735580 100755 (executable)
@@ -25,16 +25,17 @@ echo -tagstate do tag state analysis
 echo -scheduling do task scheduling
 echo -multicore generate multi-core version binary
 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
-echo "-raw generate raw version binary (should be used together with -multicore)"
 echo "-cacheflush enable cache flush in raw version binary (should be used togethere with -raw)"
 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
-echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
-echo -threadsimulate generate multi-thread simulate version binary
 echo -printscheduling print out scheduling graphs
 echo -printschedulesim print out scheduling simulator result graphs
 echo -abcclose close the array boundary check
+echo "-tilera generate tilera version binary (should be used together with -multicore"
+echo "-raw generate raw version binary (should be used together with -multicore)"
+echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
+echo -threadsimulate generate multi-thread simulate version binary
 echo -optional enable optional
 echo -debug generate debug symbols
 echo -prefetch do prefetch analysis
@@ -71,6 +72,7 @@ MLPFLAG=false
 MLPDEBUG=false
 MULTICOREFLAG=false
 RAWFLAG=false
+TILERAFLAG=false
 CACHEFLUSHFLAG=false
 RAWCONFIG=''
 DEBUGFLAG=false
@@ -200,7 +202,9 @@ shift
 elif [[ $1 = '-raw' ]]
 then
 RAWFLAG=true
-JAVAOPTS="$JAVAOPTS -raw"
+elif [[ $1 = '-tilera' ]]
+then
+TILERAFLAG=true
 elif [[ $1 = '-cacheflush' ]]
 then
 CACHEFLUSHFLAG=true
@@ -475,7 +479,75 @@ cp ../tmpbuilddirectory/*.h ./
 
 make
 
-else #!RAWFLAG
+elif $TILERAFLAG
+then # TILERAFLAG
+TILERADIR="$CURDIR/tilera"
+MAKEFILE="Makefile.tilera"
+mkdir $TILERADIR
+cd $TILERADIR
+make clean
+rm ./*
+
+export TILERACFLAGS="-DTASK -DMULTICORE"
+
+if $CACHEFLUSHFLAG
+then # print path
+TILERACFLAGS="${TILERACFLAGS} -DCACHEFLUSH"
+fi
+
+if $RAWPATHFLAG
+then # print path
+TILERACFLAGS="${TILERACFLAGS} -DRAWPATH"
+fi
+
+if $DEBUGFLAG
+then #debug version
+TILERACFLAGS="${TILERACFLAGS} -DDEBUG"
+fi
+
+if $PROFILEFLAG
+then # profile version
+TILERACFLAGS="${TILERACFLAGS} -DPROFILE"
+fi
+
+if $USEIOFLAG
+then # useio version
+TILERACFLAGS="${TILERACFLAGS} -DUSEIO"
+fi
+
+if $INTERRUPTFLAG
+then #INTERRUPT version
+TILERACFLAGS="${TILERACFLAGS} -DINTERRUPT"
+fi #INTERRUPT version
+
+cp $ROBUSTROOT/Runtime/Tilera/$MAKEFILE ./Makefile
+cp ../Runtime/multicoretask.c ./
+cp ../Runtime/multicoreruntime.c ./
+cp ../Runtime/Queue.c ./
+cp ../Runtime/file.c ./
+cp ../Runtime/math.c ./
+cp ../Runtime/object.c ./
+cp ../Runtime/GenericHashtable.c ./
+cp ../Runtime/SimpleHash.c ./
+cp ../Runtime/ObjectHash.c ./
+cp ../Runtime/socket.c ./
+cp ../Runtime/taskdefs.c ./
+cp ../Runtime/methods.c ./
+cp ../Runtime/mem.c ./
+cp ../Runtime/GenericHashtable.h ./
+cp ../Runtime/mem.h ./
+cp ../Runtime/multicoreruntime.h ./
+cp ../Runtime/object.h ./
+cp ../Runtime/ObjectHash.h ./
+cp ../Runtime/Queue.h ./
+cp ../Runtime/runtime.h ./
+cp ../Runtime/SimpleHash.h ./
+cp ../Runtime/Tilera/*.c ./
+cp ../Runtime/Tilera/*.h ./
+cp ../tmpbuilddirectory/*.c ./
+cp ../tmpbuilddirectory/*.h ./
+
+else #!RAWFLAG && !TILERAFLAG
 cd $CURDIR 
 
 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \