use of es.bsc.compss.scheduler.exceptions.UnassignedActionException in project compss by bsc-wdc.
the class TaskScheduler method reduceWorkerResources.
private <T extends WorkerResourceDescription> void reduceWorkerResources(ResourceScheduler<T> worker, ResourceUpdate<T> modification) {
worker.pendingModification(modification);
SchedulingInformation schedInfo = generateSchedulingInformation(worker);
ReduceWorkerAction<T> action = new ReduceWorkerAction<>(schedInfo, worker, this, modification);
try {
action.schedule(worker, (Score) null);
action.tryToLaunch();
} catch (BlockedActionException | UnassignedActionException | InvalidSchedulingException e) {
// Can not be blocked nor unassigned
}
}
use of es.bsc.compss.scheduler.exceptions.UnassignedActionException in project compss by bsc-wdc.
the class ExecutionAction method schedule.
@Override
public final <T extends WorkerResourceDescription> void schedule(ResourceScheduler<T> targetWorker, Score actionScore) throws BlockedActionException, UnassignedActionException {
if (targetWorker == null || // Resource is not compatible with the Core
!targetWorker.getResource().canRun(task.getTaskDescription().getId()) || // already ran on the resource
this.getExecutingResources().contains(targetWorker)) {
String message = "Worker " + (targetWorker == null ? "null" : targetWorker.getName()) + " has not available resources to run " + this;
LOGGER.warn(message);
throw new UnassignedActionException();
}
Implementation bestImpl = null;
Score bestScore = null;
Score resourceScore = targetWorker.generateResourceScore(this, task.getTaskDescription(), actionScore);
for (Implementation impl : getCompatibleImplementations(targetWorker)) {
Score implScore = targetWorker.generateImplementationScore(this, task.getTaskDescription(), impl, resourceScore);
if (Score.isBetter(implScore, bestScore)) {
bestImpl = impl;
bestScore = implScore;
}
}
schedule(targetWorker, bestImpl);
}
Aggregations