use of es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation in project compss by bsc-wdc.
the class LocalOptimizationState method releaseResources.
public void releaseResources(long expectedStart, AllocatableAction action) {
if (action.getAssignedImplementation() != null) {
Gap gap;
gap = new Gap(expectedStart, Long.MAX_VALUE, action, action.getAssignedImplementation().getRequirements().copy(), 0);
MOSchedulingInformation dsi = (MOSchedulingInformation) action.getSchedulingInfo();
dsi.addGap();
gaps.add(gap);
if (missingResources != null) {
ResourceDescription empty = gap.getResources().copy();
topStartTime = gap.getInitialTime();
ResourceDescription.reduceCommonDynamics(empty, missingResources);
}
} else {
LOGGER.debug(LOG_PREFIX + "Action has null implementation. Nothing done at release resources *** ");
}
}
use of es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation in project compss by bsc-wdc.
the class LocalOptimizationState method releaseDataSuccessors.
public void releaseDataSuccessors(MOSchedulingInformation dsi, long timeLimit) {
List<AllocatableAction> successors = dsi.getOptimizingSuccessors();
for (AllocatableAction successor : successors) {
MOSchedulingInformation successorDSI = (MOSchedulingInformation) successor.getSchedulingInfo();
int missingParams = 0;
long startTime = 0;
boolean retry = true;
while (retry) {
try {
List<AllocatableAction> predecessors = successor.getDataPredecessors();
for (AllocatableAction predecessor : predecessors) {
MOSchedulingInformation predDSI = ((MOSchedulingInformation) predecessor.getSchedulingInfo());
if (predecessor.getAssignedResource() != worker) {
startTime = Math.max(startTime, predDSI.getExpectedEnd());
} else if (predDSI.isOnOptimization()) {
missingParams++;
} else {
startTime = Math.max(startTime, predDSI.getExpectedEnd());
}
}
retry = false;
} catch (ConcurrentModificationException cme) {
missingParams = 0;
startTime = 0;
}
}
successorDSI.setExpectedStart(startTime);
if (missingParams == 0) {
if (successorDSI.getExpectedStart() <= timeLimit) {
selectableActions.offer(successor);
} else {
readyActions.add(successor);
}
}
}
dsi.clearOptimizingSuccessors();
}
use of es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation in project compss by bsc-wdc.
the class PriorityActionSet method poll.
public AllocatableAction poll() {
AllocatableAction currentPeek;
while ((currentPeek = priority.poll()) != null) {
Integer coreId = currentPeek.getCoreId();
AllocatableAction nextPeek;
if (coreId == null) {
noCoreActions.poll();
nextPeek = noCoreActions.peek();
} else {
coreActions[coreId].poll();
nextPeek = coreActions[coreId].peek();
}
if (nextPeek != null) {
priority.offer(nextPeek);
}
MOSchedulingInformation dsi = (MOSchedulingInformation) currentPeek.getSchedulingInfo();
if (dsi.isToReschedule()) {
break;
}
}
return currentPeek;
}
use of es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation in project compss by bsc-wdc.
the class PriorityActionSet method peek.
public AllocatableAction peek() {
AllocatableAction currentPeek = priority.peek();
while (currentPeek != null && !((MOSchedulingInformation) currentPeek.getSchedulingInfo()).isToReschedule()) {
removeFirst(currentPeek.getCoreId());
currentPeek = priority.peek();
}
return currentPeek;
}
use of es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation in project compss by bsc-wdc.
the class PriorityActionSet method peekAll.
public PriorityQueue<AllocatableAction> peekAll() {
PriorityQueue<AllocatableAction> peeks = new PriorityQueue<AllocatableAction>(coreActions.length + 1, comparator);
AllocatableAction currentCore = noCoreActions.peek();
if (currentCore != null && !((MOSchedulingInformation) currentCore.getSchedulingInfo()).isToReschedule()) {
noCoreActions.poll();
currentCore = noCoreActions.peek();
}
if (currentCore != null) {
peeks.offer(currentCore);
}
for (PriorityQueue<AllocatableAction> core : coreActions) {
currentCore = core.peek();
if (currentCore != null && !((MOSchedulingInformation) currentCore.getSchedulingInfo()).isToReschedule()) {
core.poll();
currentCore = core.peek();
}
if (currentCore != null) {
peeks.offer(currentCore);
}
}
return peeks;
}
Aggregations