Search in sources :

Example 1 with MOResourceScheduler

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");
    }
}
Also used : MOResourceScheduler(es.bsc.compss.scheduler.multiobjective.MOResourceScheduler) JSONObject(org.json.JSONObject) MethodResourceDescription(es.bsc.compss.types.resources.MethodResourceDescription) Implementation(es.bsc.compss.types.implementations.Implementation) MethodImplementation(es.bsc.compss.types.implementations.MethodImplementation) MOProfile(es.bsc.compss.scheduler.multiobjective.types.MOProfile) Test(org.junit.Test)

Aggregations

MOResourceScheduler (es.bsc.compss.scheduler.multiobjective.MOResourceScheduler)1 MOProfile (es.bsc.compss.scheduler.multiobjective.types.MOProfile)1 Implementation (es.bsc.compss.types.implementations.Implementation)1 MethodImplementation (es.bsc.compss.types.implementations.MethodImplementation)1 MethodResourceDescription (es.bsc.compss.types.resources.MethodResourceDescription)1 JSONObject (org.json.JSONObject)1 Test (org.junit.Test)1