use of es.bsc.compss.scheduler.types.AllocatableAction in project compss by bsc-wdc.
the class MOResourceScheduler method classifyPendingSchedulings.
public void classifyPendingSchedulings(List<AllocatableAction> pendingSchedulings, LocalOptimizationState state) {
for (AllocatableAction action : pendingSchedulings) {
// Action has an artificial resource dependency with the opAction
MOSchedulingInformation actionDSI = (MOSchedulingInformation) action.getSchedulingInfo();
actionDSI.scheduled();
actionDSI.setOnOptimization(true);
actionDSI.setToReschedule(true);
// Data Dependencies analysis
boolean hasInternal = false;
boolean hasExternal = false;
long startTime = 0;
try {
List<AllocatableAction> dPreds = action.getDataPredecessors();
for (AllocatableAction dPred : dPreds) {
MOSchedulingInformation dPredDSI = (MOSchedulingInformation) dPred.getSchedulingInfo();
if (dPred.getAssignedResource() == this) {
if (dPredDSI.tryToLock()) {
if (dPredDSI.isScheduled()) {
hasInternal = true;
dPredDSI.addOptimizingSuccessor(action);
}
dPredDSI.unlock();
}
// else
// The predecessor is trying to be unscheduled but it is
// blocked by another successor reschedule.
} else {
hasExternal = true;
startTime = Math.max(startTime, dPredDSI.getExpectedEnd());
}
}
} catch (ConcurrentModificationException cme) {
hasInternal = false;
hasExternal = false;
startTime = 0;
}
actionDSI.setExpectedStart(startTime);
state.classifyAction(action, hasInternal, hasExternal, true, startTime);
}
}
use of es.bsc.compss.scheduler.types.AllocatableAction in project compss by bsc-wdc.
the class MOSchedulingInformation method toString.
@Override
public String toString() {
StringBuilder sb = new StringBuilder("\tlastUpdate: " + lastUpdate + "\n" + "\texpectedStart: " + expectedStart + "\n" + "\texpectedEnd:" + expectedEnd + "\n");
sb.append("\t").append("schedPredecessors: ");
for (Gap g : getPredecessors()) {
sb.append(" ").append(g.getOrigin());
}
sb.append("\n");
sb.append("\t").append("schedSuccessors: ");
for (AllocatableAction aa : getSuccessors()) {
sb.append(" ").append(aa);
}
sb.append("\n");
sb.append("\tOptimization Successors").append(optimizingSuccessors);
return sb.toString();
}
use of es.bsc.compss.scheduler.types.AllocatableAction in project compss by bsc-wdc.
the class LocalOptimizationState method progressOnTime.
public void progressOnTime(long time) {
while (readyActions.size() > 0) {
AllocatableAction top = readyActions.peek();
MOSchedulingInformation topDSI = (MOSchedulingInformation) top.getSchedulingInfo();
long start = topDSI.getExpectedStart();
if (start > time) {
break;
}
readyActions.poll();
selectableActions.offer(top);
}
}
use of es.bsc.compss.scheduler.types.AllocatableAction in project compss by bsc-wdc.
the class LocalOptimizationState method blockDataSuccessors.
public void blockDataSuccessors(MOSchedulingInformation dsi) {
List<AllocatableAction> successors = dsi.getOptimizingSuccessors();
for (AllocatableAction successor : successors) {
MOSchedulingInformation sucDSI = (MOSchedulingInformation) successor.getSchedulingInfo();
sucDSI.lock();
if (sucDSI.isOnOptimization()) {
sucDSI.clearPredecessors();
sucDSI.clearSuccessors();
dataBlockedAction(successor);
blockDataSuccessors(sucDSI);
sucDSI.setExpectedStart(Long.MAX_VALUE);
sucDSI.setExpectedEnd(Long.MAX_VALUE);
sucDSI.setOnOptimization(false);
}
sucDSI.unlock();
}
}
use of es.bsc.compss.scheduler.types.AllocatableAction in project compss by bsc-wdc.
the class LocalOptimizationState method addTmpGap.
public void addTmpGap(Gap g) {
AllocatableAction gapAction = g.getOrigin();
MOSchedulingInformation gapDSI = (MOSchedulingInformation) gapAction.getSchedulingInfo();
gapDSI.addGap();
}
Aggregations