Search in sources :

Example 51 with MethodResourceDescription

use of es.bsc.compss.types.resources.MethodResourceDescription in project compss by bsc-wdc.

the class MOResourceSchedulerTest method setUpClass.

@BeforeClass
public static void setUpClass() {
    LOGGER.info("Setup Class");
    // Method resource description and its slots
    Processor p = new Processor();
    p.setComputingUnits(4);
    MethodResourceDescription description = new MethodResourceDescription();
    description.addProcessor(p);
    worker = new FakeWorker(description, 4);
    int coreId = CoreManager.registerNewCoreElement("methodA");
    LinkedList<Implementation> impls = new LinkedList<>();
    LinkedList<String> signs = new LinkedList<>();
    Implementation impl = new MethodImplementation("ClassA", "methodA", coreId, 0, new MethodResourceDescription());
    impls.add(impl);
    signs.add("ClassA.methodA");
    impl = new MethodImplementation("ClassB", "methodA", coreId, 1, new MethodResourceDescription());
    impls.add(impl);
    signs.add("ClassB.methodA");
    CoreManager.registerNewImplementations(coreId, impls, signs);
    coreId = CoreManager.registerNewCoreElement("methodB");
    impls = new LinkedList<>();
    signs = new LinkedList<>();
    impl = new MethodImplementation("ClassA", "methodB", coreId, 0, new MethodResourceDescription());
    impls.add(impl);
    signs.add("ClassA.methodB");
    CoreManager.registerNewImplementations(coreId, impls, signs);
}
Also used : MethodImplementation(es.bsc.compss.types.implementations.MethodImplementation) Processor(es.bsc.compss.types.resources.components.Processor) MethodResourceDescription(es.bsc.compss.types.resources.MethodResourceDescription) FakeWorker(es.bsc.compss.scheduler.types.fake.FakeWorker) Implementation(es.bsc.compss.types.implementations.Implementation) MethodImplementation(es.bsc.compss.types.implementations.MethodImplementation) LinkedList(java.util.LinkedList) BeforeClass(org.junit.BeforeClass)

Aggregations

MethodResourceDescription (es.bsc.compss.types.resources.MethodResourceDescription)51 CloudMethodResourceDescription (es.bsc.compss.types.resources.description.CloudMethodResourceDescription)26 Test (org.junit.Test)23 CloudInstanceTypeDescription (es.bsc.compss.types.resources.description.CloudInstanceTypeDescription)21 Implementation (es.bsc.compss.types.implementations.Implementation)20 MethodImplementation (es.bsc.compss.types.implementations.MethodImplementation)19 HashMap (java.util.HashMap)17 CloudImageDescription (es.bsc.compss.types.resources.description.CloudImageDescription)12 JSONObject (org.json.JSONObject)10 ResourceScheduler (es.bsc.compss.components.impl.ResourceScheduler)9 FakeNode (es.bsc.compss.types.fake.FakeNode)7 CloudMethodWorker (es.bsc.compss.types.resources.CloudMethodWorker)7 MOProfile (es.bsc.compss.scheduler.multiobjective.types.MOProfile)4 CloudProvider (es.bsc.compss.types.CloudProvider)4 Processor (es.bsc.compss.types.resources.components.Processor)4 MethodWorker (es.bsc.compss.types.resources.MethodWorker)3 LinkedList (java.util.LinkedList)3 ResourceCreationRequest (es.bsc.compss.types.ResourceCreationRequest)2 FakeWorker (es.bsc.compss.types.fake.FakeWorker)2 AbstractMethodImplementation (es.bsc.compss.types.implementations.AbstractMethodImplementation)2