use of es.bsc.compss.scheduler.multiobjective.MOResourceScheduler in project compss by bsc-wdc.
the class MOResourceSchedulerTest method testAllSetCopy.
@Test
public void testAllSetCopy() {
MOResourceScheduler<MethodResourceDescription> rs = new MOResourceScheduler<MethodResourceDescription>(worker, new JSONObject("{\"idlePower\": " + SET_IDLE_POWER + ", \"idlePrice\": " + SET_IDLE_PRICE + ", \"implementations\":{\"ClassA.methodA\":" + SET_PROFILE + "," + "\"ClassB.methodA\":" + SET_PROFILE + "," + "\"ClassA.methodB\":" + SET_PROFILE + "}}"), null);
JSONObject jo = rs.toJSONObject();
rs = new MOResourceScheduler<MethodResourceDescription>(worker, jo, null);
for (int coreId = 0; coreId < CoreManager.getCoreCount(); coreId++) {
List<Implementation> impls = CoreManager.getCoreImplementations(coreId);
for (Implementation impl : impls) {
MOProfile p = (MOProfile) rs.getProfile(impl);
try {
checkSetProfile(p);
} catch (CheckerException ce) {
fail("Invalid " + ce.getFeature() + " for unset implementation " + impl.getImplementationId() + " core " + impl.getCoreId() + " on all set test");
}
}
}
if (rs.getIdlePower() != SET_IDLE_POWER) {
fail("Invalid idle Power for copy test");
}
if (rs.getIdlePrice() != SET_IDLE_PRICE) {
fail("Invalid idle Price for copy test");
}
}
Aggregations