use of es.bsc.compss.scheduler.multiobjective.types.MOScore 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.MOScore in project compss by bsc-wdc.
the class MOScheduleOptimizer method scheduleOnWorker.
public void scheduleOnWorker(AllocatableAction action, Implementation impl, OptimizationWorker ow) {
boolean failedSpecificScheduling = false;
try {
action.schedule(ow.getResource(), impl);
try {
action.tryToLaunch();
} catch (InvalidSchedulingException ise) {
failedSpecificScheduling = true;
}
} catch (BlockedActionException bae) {
// Can not happen since there was an original source
} catch (UnassignedActionException be) {
failedSpecificScheduling = true;
}
if (failedSpecificScheduling) {
try {
long actionScore = MOScore.getActionScore(action);
long dataTime = MOScore.getDataPredecessorTime(action.getDataPredecessors());
Score aScore = new MOScore(actionScore, dataTime, 0, 0, 0, 0);
action.schedule(aScore);
try {
action.tryToLaunch();
} catch (InvalidSchedulingException ise2) {
// Impossible exception if schedule method on action is ok.
}
} catch (BlockedActionException | UnassignedActionException be) {
// Can not happen since there was an original source
}
}
}
Aggregations