use of es.bsc.compss.scheduler.multiobjective.types.Gap in project compss by bsc-wdc.
the class MOResourceScheduler method generateResourceScore.
/*--------------------------------------------------
---------------------------------------------------
------------------ Score Methods ------------------
---------------------------------------------------
--------------------------------------------------*/
/**
* @param action
* @param params
* @param actionScore
* @return
*/
@Override
public Score generateResourceScore(AllocatableAction action, TaskDescription params, Score actionScore) {
long resScore = Score.calculateDataLocalityScore(params, myWorker);
for (AllocatableAction pred : action.getDataPredecessors()) {
if (pred.isPending() && pred.getAssignedResource() == this) {
resScore++;
}
}
resScore = params.getParameters().length - resScore;
long lessTimeStamp = Long.MAX_VALUE;
Gap g = gaps.peekFirst();
if (g != null) {
lessTimeStamp = g.getInitialTime();
if (lessTimeStamp < 0) {
lessTimeStamp = 0;
}
}
long actionPriority = actionScore.getActionScore();
long expectedDataAvailable = ((MOScore) actionScore).getExpectedDataAvailable() + resScore * MOConfiguration.DATA_TRANSFER_DELAY;
return new MOScore(actionPriority, expectedDataAvailable, lessTimeStamp, 0, 0, 0);
}
use of es.bsc.compss.scheduler.multiobjective.types.Gap in project compss by bsc-wdc.
the class MOResourceScheduler method generateCurrentImplementationScore.
public MOScore generateCurrentImplementationScore(AllocatableAction action, Implementation impl, Score resourceScore) {
// Check if it is to be deleted
long resourceFreeTime = Long.MAX_VALUE;
Gap g = gaps.peekFirst();
if (g != null) {
resourceFreeTime = ((MOSchedulingInformation) action.getSchedulingInfo()).getExpectedStart();
}
long expectedDataAvailable = ((MOScore) resourceScore).getExpectedDataAvailable();
long actionPriority = resourceScore.getActionScore();
return generateMOScore(resourceFreeTime, expectedDataAvailable, actionPriority, impl);
}
use of es.bsc.compss.scheduler.multiobjective.types.Gap in project compss by bsc-wdc.
the class MOResourceScheduler method scheduleAction.
/*--------------------------------------------------
---------------------------------------------------
---------------- Scheduler Methods ----------------
---------------------------------------------------
--------------------------------------------------*/
@Override
public void scheduleAction(AllocatableAction action) {
synchronized (gaps) {
if (opAction != null) {
// If optimization in progress
((MOSchedulingInformation) opAction.getSchedulingInfo()).addSuccessor(action);
Gap opActionGap = new Gap(0, 0, opAction, action.getAssignedImplementation().getRequirements().copy(), 0);
((MOSchedulingInformation) action.getSchedulingInfo()).addPredecessor(opActionGap);
} else {
scheduleUsingGaps(action, gaps);
}
}
}
use of es.bsc.compss.scheduler.multiobjective.types.Gap in project compss by bsc-wdc.
the class MOSchedulingInformation method isExecutable.
@Override
public final boolean isExecutable() {
boolean b = true;
lock();
for (Gap g : resourcePredecessors) {
b = b && (g.getOrigin() == null);
}
unlock();
return b;
}
use of es.bsc.compss.scheduler.multiobjective.types.Gap 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();
}
Aggregations