From: jzhou Date: Thu, 2 Jul 2009 23:34:16 +0000 (+0000) Subject: fix a scheduling simulator bug, basically change all time related parameters to type... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=62439541cbbb36d9b1063940dc6b6b9b3ea2445c;p=IRC.git fix a scheduling simulator bug, basically change all time related parameters to type long --- diff --git a/Robust/src/Analysis/Scheduling/ClassNode.java b/Robust/src/Analysis/Scheduling/ClassNode.java index ec448030..0662f19a 100644 --- a/Robust/src/Analysis/Scheduling/ClassNode.java +++ b/Robust/src/Analysis/Scheduling/ClassNode.java @@ -23,7 +23,7 @@ public class ClassNode extends GraphNode implements Cloneable { private boolean sorted = false; private boolean clone = false; - private int transTime; + private long transTime; /** Class constructor * @param cd ClassDescriptor @@ -51,11 +51,11 @@ public class ClassNode extends GraphNode implements Cloneable { this.transTime = 0; } - public int getTransTime() { + public long getTransTime() { return this.transTime; } - public void setTransTime(int transTime) { + public void setTransTime(long transTime) { this.transTime = transTime; } @@ -135,7 +135,7 @@ public class ClassNode extends GraphNode implements Cloneable { public int hashCode() { return cd.hashCode()^uid^cid^Boolean.toString(sorted).hashCode()^ - Boolean.toString(clone).hashCode()^transTime^flagStates.hashCode(); + Boolean.toString(clone).hashCode()^(int)transTime^flagStates.hashCode(); } public String getLabel() { diff --git a/Robust/src/Analysis/Scheduling/CoreSimulator.java b/Robust/src/Analysis/Scheduling/CoreSimulator.java index a1804742..12ca8d8d 100644 --- a/Robust/src/Analysis/Scheduling/CoreSimulator.java +++ b/Robust/src/Analysis/Scheduling/CoreSimulator.java @@ -15,7 +15,7 @@ public class CoreSimulator { Hashtable> allyCSimulator; Hashtable targetFState; int coreNum; - int activeTime; + long activeTime; public CoreSimulator(RuntimeSchedule schedule, int coreNum) { @@ -92,7 +92,7 @@ public class CoreSimulator { this.targetFState = targetFState; } - public int getActiveTime() { + public long getActiveTime() { return activeTime; } @@ -160,7 +160,7 @@ public class CoreSimulator { Vector allycores = this.getAllyCores(obj.getCurrentFS()); if(allycores != null) { obj.setShared(true); - for(int k = 0; k < allycores.size(); ++k) { + //for(int k = 0; k < allycores.size(); ++k) { //Integer allyCore = allycores.elementAt(k); if(transObjs == null) { transObjs = new Vector(); @@ -169,7 +169,7 @@ public class CoreSimulator { transObjs.add(obj); } remove = false; - } + //} allycores = null; } // check if need to transfer to other cores @@ -195,7 +195,7 @@ public class CoreSimulator { return transObjs; } - public void updateTask(int time) { + public void updateTask(long time) { this.activeTime += time; this.rtask.updateFinishTime(time); } diff --git a/Robust/src/Analysis/Scheduling/MCImplSynthesis.java b/Robust/src/Analysis/Scheduling/MCImplSynthesis.java index 13488bf7..06836479 100644 --- a/Robust/src/Analysis/Scheduling/MCImplSynthesis.java +++ b/Robust/src/Analysis/Scheduling/MCImplSynthesis.java @@ -147,7 +147,7 @@ public class MCImplSynthesis { it_tasks = null; int tryindex = 1; - int bestexetime = Integer.MAX_VALUE; + long bestexetime = Long.MAX_VALUE; Random rand = new Random(); // simulate the generated schedulings and try to optimize it do { @@ -185,7 +185,7 @@ public class MCImplSynthesis { selectedSimExeGraphs.elementAt(i).clear(); } selectedSimExeGraphs.clear(); - int tmpexetime = this.scheduleSimulator.simulate(schedulings, + long tmpexetime = this.scheduleSimulator.simulate(schedulings, selectedSchedulings, selectedSimExeGraphs); boolean remove = false; @@ -310,7 +310,8 @@ public class MCImplSynthesis { System.setOut(stdout); if(false) { - this.scheduleAnalysis.setScheduleThreshold(100000); + // Generate all possible schedulings + this.scheduleAnalysis.setScheduleThreshold(Integer.MAX_VALUE); this.scheduleAnalysis.schedule(-1); Vector> totestscheduleGraphs = @@ -361,11 +362,12 @@ public class MCImplSynthesis { selectedSimExeGraphs.elementAt(i).clear(); } selectedSimExeGraphs.clear(); - int tmpexetime = this.scheduleSimulator.simulate(schedulings, + long tmpexetime = this.scheduleSimulator.simulate(schedulings, selectedSchedulings, selectedSimExeGraphs); output.println(((float)tmpexetime/1000000)); } + } else { // generate multiple schedulings this.scheduleThreshold = 20; @@ -413,7 +415,7 @@ public class MCImplSynthesis { new Vector>(); newscheduleGraphs.add(totestscheduleGraphs.elementAt(ii)); int tryindex = 1; - int bestexetime = Integer.MAX_VALUE; + long bestexetime = Long.MAX_VALUE; int gid = 1; Vector scheduling = null; Vector schedulinggraph = null; @@ -462,7 +464,7 @@ public class MCImplSynthesis { tmpgraph.clear(); } selectedSimExeGraphs.clear(); - int tmpexetime = this.scheduleSimulator.simulate(schedulings, + long tmpexetime = this.scheduleSimulator.simulate(schedulings, selectedSchedulings, selectedSimExeGraphs); if(isfirst) { @@ -625,8 +627,8 @@ public class MCImplSynthesis { // TODO: currently only get one critical path. It's possible that there are // multiple critical paths and some of them can not be optimized while others // can. Need to fix up for this situation. - private int getCriticalPath(SimExecutionNode senode, - Vector criticalPath) { + private long getCriticalPath(SimExecutionNode senode, + Vector criticalPath) { Vector edges = (Vector)senode.getEdgeVector(); if((edges == null) || (edges.size() == 0)) { edges = null; @@ -634,7 +636,7 @@ public class MCImplSynthesis { } Vector subcriticalpath = new Vector(); SimExecutionEdge edge = edges.elementAt(0); - int sum = edge.getWeight() + getCriticalPath((SimExecutionNode)edge.getTarget(), + long sum = edge.getWeight() + getCriticalPath((SimExecutionNode)edge.getTarget(), subcriticalpath); criticalPath.clear(); criticalPath.add(edge); @@ -642,7 +644,7 @@ public class MCImplSynthesis { for(int i = 1; i < edges.size(); i++) { edge = edges.elementAt(i); subcriticalpath.clear(); - int tmpsum = edge.getWeight() + long tmpsum = edge.getWeight() + getCriticalPath((SimExecutionNode)edge.getTarget(), subcriticalpath); if(tmpsum > sum) { @@ -666,11 +668,11 @@ public class MCImplSynthesis { Vector predicates = seedge.getPredicates(); if(predicates != null) { // have predicates - int starttime = 0; + long starttime = 0; // check the latest finish time of all the predicates for(int j = 0; j < predicates.size(); j++) { SimExecutionEdge predicate = predicates.elementAt(j); - int tmptime = predicate.getBestStartPoint() + predicate.getWeight(); + long tmptime = predicate.getBestStartPoint() + predicate.getWeight(); if(tmptime > starttime) { starttime = tmptime; seedge.setLastpredicateEdge(predicate); @@ -685,7 +687,7 @@ public class MCImplSynthesis { seedge.setBestStartPoint(starttime); } else if(seedge.getSource().getInedgeVector().size() > 0) { // should have only one in edge - int starttime = ((SimExecutionNode)seedge.getSource()).getTimepoint(); + long starttime = ((SimExecutionNode)seedge.getSource()).getTimepoint(); seedge.setBestStartPoint(starttime); } else { // no predicates @@ -711,15 +713,15 @@ public class MCImplSynthesis { // first check all seedges whose real start point is late than predicted // earliest start time and group them - int opcheckpoint = Integer.MAX_VALUE; + long opcheckpoint = Long.MAX_VALUE; Vector sparecores = null; // group according to core index - Hashtable>> toselects = - new Hashtable>>(); + Hashtable>> toselects = + new Hashtable>>(); Random rand = new Random(); for(int i = 0; i < criticalPath.size(); i++) { SimExecutionEdge seedge = criticalPath.elementAt(i); - int starttime = seedge.getBestStartPoint(); + long starttime = seedge.getBestStartPoint(); if(starttime < ((SimExecutionNode)seedge.getSource()).getTimepoint()) { // no restrictions due to data dependencies // have potential to be parallelled and start execution earlier @@ -744,21 +746,21 @@ public class MCImplSynthesis { // Randomly choose the tasks to optimize(previously only // consider the tasks with smallest best start time) - Vector keys = new Vector(toselects.keySet()); + Vector keys = new Vector(toselects.keySet()); do{ int length = keys.size(); if(length == 0) { return optimizeschedulegraphs; } int tochoose = Math.abs(rand.nextInt()) % length; - opcheckpoint = (keys.elementAt(tochoose)).intValue(); + opcheckpoint = (keys.elementAt(tochoose)).longValue(); keys.removeElementAt(tochoose); Hashtable> tooptimize = toselects.get(opcheckpoint); SimExecutionEdge seedge = tooptimize.values().iterator().next().elementAt(0); SimExecutionNode lastpredicatenode = seedge.getLastpredicateNode(); SimExecutionEdge lastpredicateedge = seedge.getLastpredicateEdge(); - int timepoint = lastpredicatenode.getTimepoint(); + long timepoint = lastpredicatenode.getTimepoint(); if(lastpredicateedge.getTd() == null) { // transfer edge timepoint += lastpredicateedge.getWeight(); diff --git a/Robust/src/Analysis/Scheduling/ScheduleAnalysis.java b/Robust/src/Analysis/Scheduling/ScheduleAnalysis.java index 793b2fbd..6889c8f9 100644 --- a/Robust/src/Analysis/Scheduling/ScheduleAnalysis.java +++ b/Robust/src/Analysis/Scheduling/ScheduleAnalysis.java @@ -1182,7 +1182,7 @@ public class ScheduleAnalysis { CombinationUtil.CombineGenerator cGen = CombinationUtil.allocateCombineGenerator(rootNodes, nodes2combine); - while((gid <= this.scheduleThreshold) && cGen.nextGen()) { + while((gid <= this.scheduleThreshold) && cGen.nextGen()) { if(Math.abs(rand.nextInt()) % 100 > generateThreshold) { Vector> combine = cGen.getCombine(); Vector sNodes = diff --git a/Robust/src/Analysis/Scheduling/ScheduleEdge.java b/Robust/src/Analysis/Scheduling/ScheduleEdge.java index 3d9e7cec..918f46d8 100644 --- a/Robust/src/Analysis/Scheduling/ScheduleEdge.java +++ b/Robust/src/Analysis/Scheduling/ScheduleEdge.java @@ -27,7 +27,7 @@ public class ScheduleEdge extends Edge { private ClassNode targetCNode; private double probability; - private int transTime; + private long transTime; private long listExeTime; private FEdge fedge; @@ -81,7 +81,7 @@ public class ScheduleEdge extends Edge { if(ScheduleEdge.NEWEDGE == this.type) { completeLabel += ":" + Integer.toString(this.newRate); } - completeLabel += ":(" + Double.toString(this.probability) + "%)" + ":[" + Integer.toString(this.transTime) + "]"; + completeLabel += ":(" + Double.toString(this.probability) + "%)" + ":[" + Long.toString(this.transTime) + "]"; return completeLabel; } @@ -175,7 +175,7 @@ public class ScheduleEdge extends Edge { public int hashCode() { int hashcode = gid^uid^label.hashCode()^target.hashCode()^source.hashCode()^fstate.hashCode()^ sourceCNode.hashCode()^targetCNode.hashCode()^newRate^(int)probability^ - type^transTime^(int)listExeTime; + type^(int)transTime^(int)listExeTime; if(targetFState != null) { hashcode ^= targetFState.hashCode(); } @@ -193,11 +193,11 @@ public class ScheduleEdge extends Edge { this.newRate = nr; } - public int getTransTime() { + public long getTransTime() { return this.transTime; } - public void setTransTime(int transTime) { + public void setTransTime(long transTime) { this.transTime = transTime; } diff --git a/Robust/src/Analysis/Scheduling/ScheduleSimulator.java b/Robust/src/Analysis/Scheduling/ScheduleSimulator.java index db817797..9544928e 100644 --- a/Robust/src/Analysis/Scheduling/ScheduleSimulator.java +++ b/Robust/src/Analysis/Scheduling/ScheduleSimulator.java @@ -21,7 +21,7 @@ public class ScheduleSimulator { private Vector scheduling; private Vector cores; private Vector tasks; - private int processTime; + private long processTime; private int invoketime; State state; @@ -59,10 +59,10 @@ public class ScheduleSimulator { applyScheduling(); } - public int simulate(Vector> schedulings, + public long simulate(Vector> schedulings, Vector selectedScheduling, Vector> selectedSimExeGraphs) { - int processTime = Integer.MAX_VALUE; + long processTime = Long.MAX_VALUE; /*if(schedulings.size() > 1500) { int index = 0; int upperbound = schedulings.size(); @@ -101,7 +101,7 @@ public class ScheduleSimulator { this.setScheduling(scheduling); Vector simexegraph = new Vector(); Vector checkpoints = new Vector(); - int tmpTime = process(checkpoints, simexegraph); + long tmpTime = process(checkpoints, simexegraph); if(tmpTime < processTime) { selectedScheduling.clear(); selectedScheduling.add(index); @@ -152,7 +152,7 @@ public class ScheduleSimulator { } public int getUtility(int index) { - return (this.cores.elementAt(index).getActiveTime() * 100) / this.processTime; + return (int)(this.cores.elementAt(index).getActiveTime() * 100) / (int)this.processTime; } public Vector getScheduling() { @@ -206,8 +206,8 @@ public class ScheduleSimulator { return tasks; } - public int process(Vector checkpoints, - Vector simexegraph) { + public long process(Vector checkpoints, + Vector simexegraph) { assert(this.scheduling != null); this.invoketime++; @@ -217,12 +217,12 @@ public class ScheduleSimulator { Hashtable senode2action = new Hashtable(); SimExecutionNode[] lastseNodes = new SimExecutionNode[this.cores.size()]; - Hashtable action2exetime = - new Hashtable(); + Hashtable action2exetime = + new Hashtable(); Hashtable tttask2senode = new Hashtable(); - Hashtable obj2transtime = - new Hashtable(); + Hashtable obj2transtime = + new Hashtable(); Hashtable obj2lastseedge = new Hashtable(); @@ -252,7 +252,7 @@ public class ScheduleSimulator { SimExecutionNode seNode = new SimExecutionNode(coreid, this.processTime); seNode.setSpareCores(cp.getSpareCores()); senode2action.put(seNode, action); - action2exetime.put(action, -1); + action2exetime.put(action, (long)-1); lastseNodes[coreid] = seNode; } } @@ -266,12 +266,12 @@ public class ScheduleSimulator { // for each task in todo queue, decide the execution path of this time // according to statistic information - int finishTime = Integer.MAX_VALUE; + long finishTime = Long.MAX_VALUE; Vector finishTasks = new Vector(); for(i = 0; i < this.tasks.size(); i++) { TaskSimulator task = this.tasks.elementAt(i); task.process(); - int tempTime = task.getCurrentRun().getFinishTime(); + long tempTime = task.getCurrentRun().getFinishTime(); if(tempTime < finishTime) { finishTime = tempTime; finishTasks.clear(); @@ -368,7 +368,7 @@ public class ScheduleSimulator { // create edges between previous senode on this core to this node if(lastsenode != null) { Action tmpaction = senode2action.get(lastsenode); - int weight = tmpaction != null? action2exetime.get(tmpaction) : 0; // TODO ???? + long weight = tmpaction != null? action2exetime.get(tmpaction) : 0; // TODO ???? SimExecutionEdge seEdge = new SimExecutionEdge(seNode, lastsenode.getCoreNum(), tmpaction != null? tmpaction.getTd():null, @@ -386,7 +386,7 @@ public class ScheduleSimulator { if(lastedge.getCoreNum() != seEdge.getCoreNum()) { // the obj is transferred from another core // create an seEdge for this transfer - int transweight = obj2transtime.get(tparam); + long transweight = obj2transtime.get(tparam); SimExecutionEdge transseEdge = new SimExecutionEdge((SimExecutionNode)seEdge.getSource(), lastedge.getCoreNum(), null, // TODO: not sure if this is enough @@ -449,9 +449,9 @@ public class ScheduleSimulator { Vector simexegraph, Hashtable senode2action, SimExecutionNode[] lastseNodes, - Hashtable action2exetime, + Hashtable action2exetime, Hashtable tttask2senode, - Hashtable obj2transtime) { + Hashtable obj2transtime) { TransTaskSimulator tmptask = (TransTaskSimulator)task; // add ADDOBJ task to targetCore int targetCoreNum = tmptask.getTargetCoreNum(); @@ -485,7 +485,7 @@ public class ScheduleSimulator { SimExecutionNode seNode = new SimExecutionNode(targetCoreNum, this.processTime); seNode.setSpareCores(cp.getSpareCores()); senode2action.put(seNode, action); - action2exetime.put(action, -1); + action2exetime.put(action, (long)-1); SimExecutionNode lastsenode = lastseNodes[targetCoreNum]; // create edges between previous senode on this core to this node @@ -499,7 +499,7 @@ public class ScheduleSimulator { 0, null); } else { - int weight = action2exetime.get(tmpaction); + long weight = action2exetime.get(tmpaction); seEdge = new SimExecutionEdge(seNode, lastsenode.getCoreNum(), tmpaction.getTd(), @@ -520,7 +520,7 @@ public class ScheduleSimulator { Vector tttasks, Hashtable senode2action, SimExecutionNode[] lastseNodes, - Hashtable action2exetime) { + Hashtable action2exetime) { Vector totransObjs = new Vector(); CoreSimulator cs = task.getCs(); int corenum = cs.getCoreNum(); @@ -580,7 +580,9 @@ public class ScheduleSimulator { Vector allycores = cs.getAllyCores(nobj.getCurrentFS()); if(allycores != null) { nobj.setShared(true); - for(int k = 0; k < allycores.size(); ++k) { + // TODO, temporarily send to at most 2 cores + int numtosend = allycores.size() > 2 ? 2 : allycores.size(); + for(int k = 0; k < numtosend; ++k) { Integer allyCore = allycores.elementAt(k); if(allyCore == corenum) { cs.addObject(nobj); @@ -635,7 +637,9 @@ public class ScheduleSimulator { Vector allycores = cs.getAllyCores(tobj.getCurrentFS()); if(allycores != null) { tobj.setShared(true); - for(int k = 0; k < allycores.size(); ++k) { + // TODO, temporarily send to at most 2 cores + int numtosend = allycores.size() > 2 ? 2 : allycores.size(); + for(int k = 0; k < numtosend; ++k) { Integer allyCore = allycores.elementAt(k); if(allyCore == corenum) { cs.addObject(tobj); @@ -682,9 +686,9 @@ public class ScheduleSimulator { Vector simexegraph, Hashtable senode2action, SimExecutionNode[] lastseNodes, - Hashtable action2exetime, + Hashtable action2exetime, Hashtable tttask2senode, - Hashtable obj2transtime, + Hashtable obj2transtime, Hashtable obj2lastseedge) { TaskSimulator newTask = cs.process(); int corenum = cs.getCoreNum(); @@ -701,12 +705,12 @@ public class ScheduleSimulator { SimExecutionNode seNode = new SimExecutionNode(corenum, this.processTime); seNode.setSpareCores(cp.getSpareCores()); senode2action.put(seNode, action); - action2exetime.put(action, -1); + action2exetime.put(action, (long)-1); SimExecutionNode lastsenode = lastseNodes[corenum]; // create edges between previous senode on this core to this node if(lastsenode != null) { Action tmpaction = senode2action.get(lastsenode); - int weight = tmpaction != null? action2exetime.get(tmpaction):0; + long weight = tmpaction != null? action2exetime.get(tmpaction):0; seEdge = new SimExecutionEdge(seNode, lastsenode.getCoreNum(), tmpaction!= null?tmpaction.getTd():null, @@ -727,7 +731,7 @@ public class ScheduleSimulator { // create edges between previous senode on this core to this node if(lastsenode != null) { Action tmpaction = senode2action.get(lastsenode); - int weight = action2exetime.get(tmpaction); + long weight = action2exetime.get(tmpaction); seEdge = new SimExecutionEdge(seNode, lastsenode.getCoreNum(), tmpaction.getTd(), @@ -751,7 +755,7 @@ public class ScheduleSimulator { if(lastedge.getCoreNum() != seEdge.getCoreNum()) { // the obj is transferred from another core // create an seEdge for this transfer - int weight = obj2transtime.get(tparam); + long weight = obj2transtime.get(tparam); SimExecutionEdge transseEdge = new SimExecutionEdge((SimExecutionNode)seEdge.getSource(), lastedge.getCoreNum(), null, // TODO: not sure if this is enough @@ -791,7 +795,7 @@ public class ScheduleSimulator { CheckPoint cp, Hashtable senode2action, SimExecutionNode[] lastseNodes, - Hashtable action2exetime, + Hashtable action2exetime, int type) { Action action = new Action(cs.getCoreNum(), type, @@ -812,11 +816,11 @@ public class ScheduleSimulator { } public class CheckPoint { - private int timepoint; + private long timepoint; private Vector actions; private Vector spareCores; - public CheckPoint(int timepoint, + public CheckPoint(long timepoint, int corenum) { super(); this.timepoint = timepoint; @@ -847,7 +851,7 @@ public class ScheduleSimulator { } } - public int getTimepoint() { + public long getTimepoint() { return timepoint; } @@ -969,4 +973,4 @@ public class ScheduleSimulator { } } -} \ No newline at end of file +} diff --git a/Robust/src/Analysis/Scheduling/SchedulingUtil.java b/Robust/src/Analysis/Scheduling/SchedulingUtil.java index 8197cdd2..a20dc748 100644 --- a/Robust/src/Analysis/Scheduling/SchedulingUtil.java +++ b/Robust/src/Analysis/Scheduling/SchedulingUtil.java @@ -471,7 +471,7 @@ public class SchedulingUtil { } public static void printSimulationResult(String path, - int time, + long time, int coreNum, Vector checkpoints) { try { @@ -758,13 +758,13 @@ public class SchedulingUtil { } output.print("\t"); output.print("\t"); - int prev = Integer.parseInt(timeNodes.elementAt(0)); - int next = 0; - int max = 0; - int max2 = 0; + long prev = Long.parseLong(timeNodes.elementAt(0)); + long next = 0; + long max = 0; + long max2 = 0; for(j = 1; j < timeNodes.size(); j++) { - next = Integer.parseInt(timeNodes.elementAt(j)); - int delta = next - prev; + next = Long.parseLong(timeNodes.elementAt(j)); + long delta = next - prev; if(max < delta) { max2 = max; max = delta; @@ -779,10 +779,10 @@ public class SchedulingUtil { max2 = max/100; } output.println("\"Time\"->" + timeNodes.elementAt(0) + "[style=invis];"); - prev = Integer.parseInt(timeNodes.elementAt(0)); + prev = Long.parseLong(timeNodes.elementAt(0)); next = 0; for(j = 1; j < timeNodes.size(); j++) { - next = Integer.parseInt(timeNodes.elementAt(j)); + next = Long.parseLong(timeNodes.elementAt(j)); if(next - prev > max2) { do { output.print(prev + "->"); diff --git a/Robust/src/Analysis/Scheduling/SimExecutionEdge.java b/Robust/src/Analysis/Scheduling/SimExecutionEdge.java index 49f9d93f..a8edc42b 100644 --- a/Robust/src/Analysis/Scheduling/SimExecutionEdge.java +++ b/Robust/src/Analysis/Scheduling/SimExecutionEdge.java @@ -13,9 +13,9 @@ public class SimExecutionEdge extends Edge { private int coreNum; private TaskDescriptor td; private Vector taskparams; - private int weight; + private long weight; - private int bestStartPoint; + private long bestStartPoint; private SimExecutionNode lastpredicatenode; private SimExecutionEdge lastpredicateedge; private Vector predicates; @@ -24,7 +24,7 @@ public class SimExecutionEdge extends Edge { public SimExecutionEdge(SimExecutionNode target, int corenum, TaskDescriptor td, - int weight, + long weight, Vector taskparams) { super(target); this.eid = SimExecutionEdge.nodeID++; @@ -39,15 +39,15 @@ public class SimExecutionEdge extends Edge { this.isFixedTime = true; } - public int getBestStartPoint() { + public long getBestStartPoint() { if(this.bestStartPoint == -1) { if(this.predicates.size() > 0) { // have predicates - int starttime = 0; + long starttime = 0; // check the latest finish time of all the predicates for(int j = 0; j < this.predicates.size(); j++) { SimExecutionEdge predicate = this.predicates.elementAt(j); - int tmptime = predicate.getBestStartPoint() + predicate.getWeight(); + long tmptime = predicate.getBestStartPoint() + predicate.getWeight(); if(tmptime > starttime) { starttime = tmptime; this.lastpredicateedge = predicate; @@ -68,7 +68,7 @@ public class SimExecutionEdge extends Edge { return bestStartPoint; } - public void setBestStartPoint(int bestStartPoint) { + public void setBestStartPoint(long bestStartPoint) { this.bestStartPoint = bestStartPoint; } @@ -93,7 +93,7 @@ public class SimExecutionEdge extends Edge { return td; } - public int getWeight() { + public long getWeight() { return weight; } diff --git a/Robust/src/Analysis/Scheduling/SimExecutionNode.java b/Robust/src/Analysis/Scheduling/SimExecutionNode.java index 23f88861..ebafd27f 100644 --- a/Robust/src/Analysis/Scheduling/SimExecutionNode.java +++ b/Robust/src/Analysis/Scheduling/SimExecutionNode.java @@ -10,11 +10,11 @@ public class SimExecutionNode extends GraphNode { private static int nodeID=0; private int coreNum; - private int timepoint; + private long timepoint; public Vector spareCores; public SimExecutionNode(int corenum, - int timepoint) { + long timepoint) { this.nid = SimExecutionNode.nodeID++; this.coreNum = corenum; this.timepoint = timepoint; @@ -25,7 +25,7 @@ public class SimExecutionNode extends GraphNode { return nid; } - public int getTimepoint() { + public long getTimepoint() { return timepoint; } diff --git a/Robust/src/Analysis/Scheduling/TaskSimulator.java b/Robust/src/Analysis/Scheduling/TaskSimulator.java index b52ac2d0..a1de20ee 100644 --- a/Robust/src/Analysis/Scheduling/TaskSimulator.java +++ b/Robust/src/Analysis/Scheduling/TaskSimulator.java @@ -23,7 +23,7 @@ public class TaskSimulator { boolean finish; public class ExeResult { - int finishTime; + long finishTime; Vector newObjs; int exetype; // 0--normal executing // 1--abort due to fail on grabbing locks @@ -34,11 +34,11 @@ public class TaskSimulator { newObjs = null; } - public int getFinishTime() { + public long getFinishTime() { return finishTime; } - public void setFinishTime(int finishTime) { + public void setFinishTime(long finishTime) { this.finishTime = finishTime; } @@ -204,7 +204,7 @@ public class TaskSimulator { this.currentRun.init(); } - int finishTime = 0; + long finishTime = 0; // According to runtime statistic information, decide the execution path of this task this time. // Mainly following things: // 1.the result, i.e. the result FlagState reached by each parameter. @@ -304,7 +304,7 @@ public class TaskSimulator { this.currentRun.setExetype(0); } - public void updateFinishTime(int time) { + public void updateFinishTime(long time) { this.currentRun.setFinishTime(this.currentRun.finishTime - time); finish = false; } diff --git a/Robust/src/buildscript b/Robust/src/buildscript index 9a9579be..c08ee9df 100755 --- a/Robust/src/buildscript +++ b/Robust/src/buildscript @@ -586,6 +586,8 @@ cp ../Tilera/lib/* ./ cp ../tmpbuilddirectory/*.c ./ cp ../tmpbuilddirectory/*.h ./ +make + else #!RAWFLAG && !TILERAFLAG cd $CURDIR @@ -634,7 +636,7 @@ then FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c" fi -if $MLP +if $MLPFLAG then FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c" FILES="$FILES $ROBUSTROOT/Runtime/psemaphore.c"