use of es.bsc.compss.scheduler.exceptions.InvalidSchedulingException in project compss by bsc-wdc.
the class MOResourceScheduler method tryToLaunch.
private boolean tryToLaunch(AllocatableAction action) {
boolean launched = false;
try {
action.tryToLaunch();
launched = true;
} catch (InvalidSchedulingException ise) {
}
if (!launched) {
long actionScore = MOScore.getActionScore(action);
Score aScore = new MOScore(actionScore, 0, 0, 0, 0, 0);
try {
action.schedule(aScore);
try {
action.tryToLaunch();
} catch (InvalidSchedulingException ise2) {
// Impossible exception.
LOGGER.error(ise2);
}
} catch (BlockedActionException | UnassignedActionException be) {
// Can not happen since there was an original source
LOGGER.error(be);
}
}
return launched;
}
use of es.bsc.compss.scheduler.exceptions.InvalidSchedulingException in project compss by bsc-wdc.
the class TaskScheduler method reducedWorkerResources.
@SuppressWarnings("unchecked")
private <T extends WorkerResourceDescription> void reducedWorkerResources(ResourceScheduler<T> worker, ResourceUpdate<T> modification) {
CloudMethodWorker cloudWorker = (CloudMethodWorker) worker.getResource();
if (!cloudWorker.getDescription().getTypeComposition().isEmpty()) {
synchronized (workers) {
workers.remove(((ResourceScheduler<WorkerResourceDescription>) worker).getResource());
int coreCount = CoreManager.getCoreCount();
List<Implementation>[] runningCoreImpls = worker.getExecutableImpls();
for (int coreId = 0; coreId < coreCount; coreId++) {
for (Implementation impl : runningCoreImpls[coreId]) {
Profile p = worker.getProfile(impl);
if (p != null) {
offVMsProfiles[coreId][impl.getImplementationId()].accumulate(p);
}
}
}
}
this.workerRemoved((ResourceScheduler<WorkerResourceDescription>) worker);
StopWorkerAction action = new StopWorkerAction(generateSchedulingInformation(worker), worker, this, modification);
try {
action.schedule((ResourceScheduler<WorkerResourceDescription>) worker, (Score) null);
action.tryToLaunch();
} catch (BlockedActionException | UnassignedActionException | InvalidSchedulingException e) {
// Can not be blocked nor unassigned
}
} else {
ResourceManager.terminateCloudResource(cloudWorker, (CloudMethodResourceDescription) modification.getModification());
}
}
use of es.bsc.compss.scheduler.exceptions.InvalidSchedulingException 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
}
}
}
use of es.bsc.compss.scheduler.exceptions.InvalidSchedulingException 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
}
}
Aggregations