small changes
authorjzhou <jzhou>
Sun, 3 Aug 2008 00:55:15 +0000 (00:55 +0000)
committerjzhou <jzhou>
Sun, 3 Aug 2008 00:55:15 +0000 (00:55 +0000)
Robust/src/Analysis/Scheduling/ScheduleAnalysis.java
Robust/src/Runtime/multicoretask.c

index a48cd8712dcb4aee8de868c08c498c2f239d8571..2562a8cd1cbaa24ab0e3d06fe6459ee5ff65f0d3 100644 (file)
@@ -372,7 +372,11 @@ public class ScheduleAnalysis {
            int repeat = (int)Math.ceil(se.getNewRate() * se.getProbability() / 100);
            if(merge) {
                try {
-                   rate = (int)Math.ceil((se.getTransTime() - calInExeTime(se.getSourceFState()))/ se.getListExeTime());
+                   if(se.getListExeTime() == 0) {
+                               rate = repeat;
+                       } else {
+                               rate = (int)Math.ceil((se.getTransTime() - calInExeTime(se.getSourceFState()))/ se.getListExeTime());
+                       }
                    if(rate < 0 ) {
                        rate = 0;
                    }
index 0a52d3d72cfc10d6e90e8079f51a34889dde5c01..d5e180e626fdee14d4cebc38100c9c5865c7a192 100644 (file)
@@ -1859,7 +1859,7 @@ bool getreadlock(void * ptr) {
 #ifdef RAW
        unsigned msgHdr;
        int self_y, self_x, target_y, target_x;
-       int targetcore = ((int)ptr >> 1) % TOTALCORE;
+       int targetcore = ((int)ptr >> 5) % TOTALCORE;
        // for 32 bit machine, the size is always 4 words
        //int msgsize = sizeof(int) * 4;
        int msgsize = 4;
@@ -2004,7 +2004,7 @@ void releasereadlock(void * ptr) {
 #ifdef RAW
        unsigned msgHdr;
        int self_y, self_x, target_y, target_x;
-       int targetcore = ((int)ptr >> 1) % TOTALCORE;
+       int targetcore = ((int)ptr >> 5) % TOTALCORE;
        // for 32 bit machine, the size is always 3 words
        //int msgsize = sizeof(int) * 3;
        int msgsize = 3;
@@ -2075,7 +2075,7 @@ void releasereadlock(void * ptr) {
 bool getreadlock_I(void * ptr) {
        unsigned msgHdr;
        int self_y, self_x, target_y, target_x;
-       int targetcore = ((int)ptr >> 1) % TOTALCORE;
+       int targetcore = ((int)ptr >> 5) % TOTALCORE;
        // for 32 bit machine, the size is always 4 words
        //int msgsize = sizeof(int) * 4;
        int msgsize = 4;
@@ -2158,7 +2158,7 @@ bool getreadlock_I(void * ptr) {
 void releasereadlock_I(void * ptr) {
        unsigned msgHdr;
        int self_y, self_x, target_y, target_x;
-       int targetcore = ((int)ptr >> 1) % TOTALCORE;
+       int targetcore = ((int)ptr >> 5) % TOTALCORE;
        // for 32 bit machine, the size is always 3 words
        //int msgsize = sizeof(int) * 3;
        int msgsize = 3;
@@ -2210,7 +2210,7 @@ bool getwritelock(void * ptr) {
 #ifdef RAW
        unsigned msgHdr;
        int self_y, self_x, target_y, target_x;
-       int targetcore = ((int)ptr >> 1) % TOTALCORE;
+       int targetcore = ((int)ptr >> 5) % TOTALCORE;
        // for 32 bit machine, the size is always 4 words
        //int msgsize = sizeof(int) * 4;
        int msgsize= 4;
@@ -2393,7 +2393,7 @@ void releasewritelock(void * ptr) {
 #ifdef RAW
        unsigned msgHdr;
        int self_y, self_x, target_y, target_x;
-       int targetcore = ((int)ptr >> 1) % TOTALCORE;
+       int targetcore = ((int)ptr >> 5) % TOTALCORE;
        // for 32 bit machine, the size is always 3 words
        //int msgsize = sizeof(int) * 3;
        int msgsize = 3;
@@ -3056,7 +3056,6 @@ execute:
          } else {
            ((void (*) (void **)) currtpd->task->taskptr)(taskpointerarray);
          }
-
          if(lock) {
 #ifdef RAW
           for(i = 0; i < numparams; ++i) {