fix a scheduling simulator bug, basically change all time related parameters to type...
authorjzhou <jzhou>
Thu, 2 Jul 2009 23:34:16 +0000 (23:34 +0000)
committerjzhou <jzhou>
Thu, 2 Jul 2009 23:34:16 +0000 (23:34 +0000)
Robust/src/Analysis/Scheduling/ClassNode.java
Robust/src/Analysis/Scheduling/CoreSimulator.java
Robust/src/Analysis/Scheduling/MCImplSynthesis.java
Robust/src/Analysis/Scheduling/ScheduleAnalysis.java
Robust/src/Analysis/Scheduling/ScheduleEdge.java
Robust/src/Analysis/Scheduling/ScheduleSimulator.java
Robust/src/Analysis/Scheduling/SchedulingUtil.java
Robust/src/Analysis/Scheduling/SimExecutionEdge.java
Robust/src/Analysis/Scheduling/SimExecutionNode.java
Robust/src/Analysis/Scheduling/TaskSimulator.java
Robust/src/buildscript

index ec4480300fdec8765d491f38c8ec038d3502c614..0662f19a49b2dbbf7ae7470e98dfda109aae9114 100644 (file)
@@ -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() {
index a18047423be31a6df59630e3ab819747b2fcffb4..12ca8d8de6e864597fbef6412b54bc4199e12e5d 100644 (file)
@@ -15,7 +15,7 @@ public class CoreSimulator {
   Hashtable<FlagState, Vector<Integer>> allyCSimulator;
   Hashtable<FlagState, FlagState> 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<Integer> 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<ObjectSimulator>();
@@ -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);
   }
index 13488bf7df770c40b08e7a30f84a342f891571d2..06836479f19f1e4e39e96aa8007f6a10b01c558f 100644 (file)
@@ -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<Vector<ScheduleNode>> 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<Vector<ScheduleNode>>();
                newscheduleGraphs.add(totestscheduleGraphs.elementAt(ii));
                int tryindex = 1;
-               int bestexetime = Integer.MAX_VALUE;
+               long bestexetime = Long.MAX_VALUE;
                int gid = 1;
                Vector<Schedule> scheduling = null;
                Vector<ScheduleNode> 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<SimExecutionEdge> criticalPath) {
+    private long getCriticalPath(SimExecutionNode senode, 
+                                Vector<SimExecutionEdge> criticalPath) {
        Vector<SimExecutionEdge> edges = (Vector<SimExecutionEdge>)senode.getEdgeVector();
        if((edges == null) || (edges.size() == 0)) {
            edges = null;
@@ -634,7 +636,7 @@ public class MCImplSynthesis {
        }
        Vector<SimExecutionEdge> subcriticalpath = new Vector<SimExecutionEdge>();
        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<SimExecutionEdge> 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<Integer> sparecores = null;
        // group according to core index
-       Hashtable<Integer, Hashtable<Integer, Vector<SimExecutionEdge>>> toselects = 
-           new Hashtable<Integer, Hashtable<Integer, Vector<SimExecutionEdge>>>();
+       Hashtable<Long, Hashtable<Integer, Vector<SimExecutionEdge>>> toselects = 
+           new Hashtable<Long, Hashtable<Integer, Vector<SimExecutionEdge>>>();
        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<Integer> keys = new Vector<Integer>(toselects.keySet());
+       Vector<Long> keys = new Vector<Long>(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<Integer, Vector<SimExecutionEdge>> 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();
index 793b2fbd3d45960c58cd3cf51659b9db7d3d8e83..6889c8f9a7cbd9ae497e4cc9f3e8dcc5ec79c580 100644 (file)
@@ -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<Vector<CombinationUtil.Combine>> combine = cGen.getCombine();
                        Vector<ScheduleNode> sNodes = 
index 3d9e7cec29943e961002f308a857ebed4b6effdb..918f46d84c41ba394f333171f0edb8bae17c50c4 100644 (file)
@@ -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;
   }
 
index db817797de97dfcb49571be16480375db34245f8..9544928e55704248a904255ec948a43f50259d31 100644 (file)
@@ -21,7 +21,7 @@ public class ScheduleSimulator {
   private Vector<Schedule> scheduling;
   private Vector<CoreSimulator> cores;
   private Vector<TaskSimulator> tasks;
-  private int processTime;
+  private long processTime;
   private int invoketime;
 
   State state;
@@ -59,10 +59,10 @@ public class ScheduleSimulator {
     applyScheduling();
   }
   
-  public int simulate(Vector<Vector<Schedule>> schedulings,
+  public long simulate(Vector<Vector<Schedule>> schedulings,
                      Vector<Integer> selectedScheduling,
                      Vector<Vector<SimExecutionEdge>> 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<SimExecutionEdge> simexegraph = new Vector<SimExecutionEdge>();
              Vector<CheckPoint> checkpoints = new Vector<CheckPoint>();
-             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<Schedule> getScheduling() {
@@ -206,8 +206,8 @@ public class ScheduleSimulator {
     return tasks;
   }
 
-  public int process(Vector<CheckPoint> checkpoints,
-                    Vector<SimExecutionEdge> simexegraph) {
+  public long process(Vector<CheckPoint> checkpoints,
+                     Vector<SimExecutionEdge> simexegraph) {
     assert(this.scheduling != null);
 
     this.invoketime++;
@@ -217,12 +217,12 @@ public class ScheduleSimulator {
     Hashtable<SimExecutionNode, Action> senode2action = 
            new Hashtable<SimExecutionNode, Action>();
     SimExecutionNode[] lastseNodes = new SimExecutionNode[this.cores.size()];
-    Hashtable<Action, Integer> action2exetime = 
-           new Hashtable<Action, Integer>();
+    Hashtable<Action, Long> action2exetime = 
+           new Hashtable<Action, Long>();
     Hashtable<TransTaskSimulator, SimExecutionNode> tttask2senode = 
            new Hashtable<TransTaskSimulator, SimExecutionNode>();
-    Hashtable<Integer, Integer> obj2transtime = 
-           new Hashtable<Integer, Integer>();
+    Hashtable<Integer, Long> obj2transtime = 
+           new Hashtable<Integer, Long>();
     Hashtable<Integer, SimExecutionEdge> obj2lastseedge = 
            new Hashtable<Integer, SimExecutionEdge>();
 
@@ -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<TaskSimulator> finishTasks = new Vector<TaskSimulator>();
       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<SimExecutionEdge> simexegraph,
                                        Hashtable<SimExecutionNode, Action> senode2action,
                                        SimExecutionNode[] lastseNodes,
-                                       Hashtable<Action, Integer> action2exetime,
+                                       Hashtable<Action, Long> action2exetime,
                                        Hashtable<TransTaskSimulator, SimExecutionNode> tttask2senode,
-                                       Hashtable<Integer, Integer> obj2transtime) {
+                                       Hashtable<Integer, Long> 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<TransTaskSimulator> tttasks,
                                                    Hashtable<SimExecutionNode, Action> senode2action,
                                                    SimExecutionNode[] lastseNodes,
-                                                   Hashtable<Action, Integer> action2exetime) {
+                                                   Hashtable<Action, Long> action2exetime) {
       Vector<ObjectSimulator> totransObjs = new Vector<ObjectSimulator>();
       CoreSimulator cs = task.getCs();
       int corenum = cs.getCoreNum();
@@ -580,7 +580,9 @@ public class ScheduleSimulator {
              Vector<Integer> 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<Integer> 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<SimExecutionEdge> simexegraph,
                               Hashtable<SimExecutionNode, Action> senode2action,
                               SimExecutionNode[] lastseNodes,
-                              Hashtable<Action, Integer> action2exetime,
+                              Hashtable<Action, Long> action2exetime,
                               Hashtable<TransTaskSimulator, SimExecutionNode> tttask2senode,
-                              Hashtable<Integer, Integer> obj2transtime,
+                              Hashtable<Integer, Long> obj2transtime,
                               Hashtable<Integer, SimExecutionEdge> 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<SimExecutionNode, Action> senode2action,
                                  SimExecutionNode[] lastseNodes,
-                                 Hashtable<Action, Integer> action2exetime,
+                                 Hashtable<Action, Long> 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<Action> actions;
     private Vector<Integer> 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
+}
index 8197cdd229021215548805359f4a1c5f2f3cf45b..a20dc7483767e73f1cbbc592266a475329b812c6 100644 (file)
@@ -471,7 +471,7 @@ public class SchedulingUtil {
   }
 
   public static void printSimulationResult(String path, 
-                                          int time, 
+                                          long time, 
                                           int coreNum, 
                                           Vector<CheckPoint> 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 + "->");
index 49f9d93f8f20ba3314c044ad2c0a72bdb4b63565..a8edc42bc8d729120949c23d3b880ed13d805c87 100644 (file)
@@ -13,9 +13,9 @@ public class SimExecutionEdge extends Edge {
     private int coreNum;
     private TaskDescriptor td;
     private Vector<Integer> taskparams;
-    private int weight;
+    private long weight;
     
-    private int bestStartPoint;
+    private long bestStartPoint;
     private SimExecutionNode lastpredicatenode;
     private SimExecutionEdge lastpredicateedge;
     private Vector<SimExecutionEdge> predicates;
@@ -24,7 +24,7 @@ public class SimExecutionEdge extends Edge {
     public SimExecutionEdge(SimExecutionNode target,
                            int corenum,
                            TaskDescriptor td,
-                           int weight,
+                           long weight,
                             Vector<Integer> 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;
     }
 
index 23f88861ee5e4f38ac68dd1f663dc68ae1141ef2..ebafd27f4ded0187a65b3f5660f4f4dffd535e3f 100644 (file)
@@ -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<Integer> 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;
     }
 
index b52ac2d02652faddf7ff0b716500e8250f622039..a1de20eec27eeabd5e993fbbefa4ee7bb6fa811f 100644 (file)
@@ -23,7 +23,7 @@ public class TaskSimulator {
   boolean finish;
 
   public class ExeResult {
-    int finishTime;
+    long finishTime;
     Vector<ObjectSimulator> 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;
   }
index 9a9579be362d6d4dda70ee978401410571e211f0..c08ee9df747570c44bb96645ce68c3d108f1c4c9 100755 (executable)
@@ -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"