use of es.bsc.compss.types.fake.FakeResourceScheduler in project compss by bsc-wdc.
the class AllocatableActionTest method completed.
/*---------------------------------------------------------
----------------------------------------------------------
--------------------- SCHEDULER ACTIONS ------------------
----------------------------------------------------------
--------------------------------------------------------*/
public void completed(FakeAllocatableAction action) throws BlockedActionException, UnassignedActionException, InvalidSchedulingException {
FakeResourceScheduler resource = (FakeResourceScheduler) action.getAssignedResource();
List<AllocatableAction> dataFree = action.completed();
List<AllocatableAction> resourceFree = resource.unscheduleAction(action);
Set<AllocatableAction> freeTasks = new HashSet<>();
freeTasks.addAll(dataFree);
freeTasks.addAll(resourceFree);
for (AllocatableAction a : freeTasks) {
FakeAllocatableAction fa = (FakeAllocatableAction) a;
fa.tryToLaunch();
}
}
use of es.bsc.compss.types.fake.FakeResourceScheduler in project compss by bsc-wdc.
the class AllocatableActionTest method setUpClass.
@BeforeClass
public static void setUpClass() {
ResourceManager.clear(rus);
// Method resource description and its slots
int maxSlots = 3;
Processor p = new Processor();
p.setComputingUnits(maxSlots);
description = new MethodResourceDescription();
description.addProcessor(p);
// Task Scheduler
ts = new TaskScheduler();
// Task Dispatcher
fao = new FakeActionOrchestrator(ts);
ts.setOrchestrator(fao);
// Resource Scheduler
rs = new FakeResourceScheduler(new FakeWorker(description, maxSlots), null, null);
}
use of es.bsc.compss.types.fake.FakeResourceScheduler in project compss by bsc-wdc.
the class AllocatableActionTest method error.
public void error(FakeAllocatableAction action) throws BlockedActionException, UnassignedActionException, InvalidSchedulingException {
FakeResourceScheduler resource = (FakeResourceScheduler) action.getAssignedResource();
List<AllocatableAction> resourceFree;
try {
action.error();
resourceFree = resource.unscheduleAction(action);
} catch (FailedActionException fae) {
resourceFree = new LinkedList<>();
for (AllocatableAction failed : action.failed()) {
resourceFree.addAll(resource.unscheduleAction(failed));
}
}
for (AllocatableAction a : resourceFree) {
FakeAllocatableAction fa = (FakeAllocatableAction) a;
fa.tryToLaunch();
}
}
Aggregations