From fbd4dcec1fb893acd3afaff38b6a85b52f15b26f Mon Sep 17 00:00:00 2001 From: jzhou Date: Sun, 3 Aug 2008 00:55:15 +0000 Subject: [PATCH] small changes --- .../src/Analysis/Scheduling/ScheduleAnalysis.java | 6 +++++- Robust/src/Runtime/multicoretask.c | 13 ++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Robust/src/Analysis/Scheduling/ScheduleAnalysis.java b/Robust/src/Analysis/Scheduling/ScheduleAnalysis.java index a48cd871..2562a8cd 100644 --- a/Robust/src/Analysis/Scheduling/ScheduleAnalysis.java +++ b/Robust/src/Analysis/Scheduling/ScheduleAnalysis.java @@ -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; } diff --git a/Robust/src/Runtime/multicoretask.c b/Robust/src/Runtime/multicoretask.c index 0a52d3d7..d5e180e6 100644 --- a/Robust/src/Runtime/multicoretask.c +++ b/Robust/src/Runtime/multicoretask.c @@ -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) { -- 2.34.1