Search in sources :

Example 1 with FakeWorker

use of es.bsc.es.bsc.compss.scheduler.types.fake.FakeWorker in project compss by bsc-wdc.

the class InitialSchedulingTest method setUpClass.

@BeforeClass
public static void setUpClass() {
    CoreManager.clear();
    CoreManager.registerNewCoreElement("fakeSignature00");
    CoreManager.registerNewCoreElement("fakeSignature10");
    CoreManager.registerNewCoreElement("fakeSignature20");
    FakeImplementation impl00 = new FakeImplementation(0, 0, new FakeResourceDescription(2));
    List<Implementation<?>> impls0 = new LinkedList<>();
    impls0.add(impl00);
    List<String> signatures0 = new LinkedList<>();
    signatures0.add("fakeSignature00");
    CoreManager.registerNewImplementations(0, impls0, signatures0);
    FakeImplementation impl10 = new FakeImplementation(1, 0, new FakeResourceDescription(3));
    List<Implementation<?>> impls1 = new LinkedList<>();
    impls1.add(impl10);
    List<String> signatures1 = new LinkedList<>();
    signatures1.add("fakeSignature10");
    CoreManager.registerNewImplementations(1, impls1, signatures1);
    FakeImplementation impl20 = new FakeImplementation(2, 0, new FakeResourceDescription(1));
    List<Implementation<?>> impls2 = new LinkedList<>();
    impls2.add(impl20);
    List<String> signatures2 = new LinkedList<>();
    signatures2.add("fakeSignature20");
    CoreManager.registerNewImplementations(2, impls2, signatures2);
    int maxSlots = 4;
    FakeResourceDescription frd = new FakeResourceDescription(maxSlots);
    FakeWorker fw = new FakeWorker("worker1", frd, maxSlots);
    drs = new FakeResourceScheduler(fw, fao, 0);
    drs.profiledExecution(impl00, new FakeProfile(50));
    drs.profiledExecution(impl10, new FakeProfile(50));
    drs.profiledExecution(impl20, new FakeProfile(30));
    CORE0 = drs.getProfile(impl00).getAverageExecutionTime();
    CORE1 = drs.getProfile(impl10).getAverageExecutionTime();
    CORE2 = drs.getProfile(impl20).getAverageExecutionTime();
// debugConfiguration();
}
Also used : FakeProfile(es.bsc.es.bsc.compss.scheduler.types.fake.FakeProfile) FakeImplementation(es.bsc.es.bsc.compss.scheduler.types.fake.FakeImplementation) FakeResourceDescription(es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceDescription) FakeResourceScheduler(es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceScheduler) Implementation(es.bsc.compss.types.implementations.Implementation) FakeImplementation(es.bsc.es.bsc.compss.scheduler.types.fake.FakeImplementation) LinkedList(java.util.LinkedList) FakeWorker(es.bsc.es.bsc.compss.scheduler.types.fake.FakeWorker) BeforeClass(org.junit.BeforeClass)

Example 2 with FakeWorker

use of es.bsc.es.bsc.compss.scheduler.types.fake.FakeWorker in project compss by bsc-wdc.

the class OptimizationTest method setUpClass.

@BeforeClass
public static void setUpClass() {
    CoreManager.clear();
    CoreManager.registerNewCoreElement("fakeSignature00");
    CoreManager.registerNewCoreElement("fakeSignature10");
    CoreManager.registerNewCoreElement("fakeSignature20");
    CoreManager.registerNewCoreElement("fakeSignature30");
    CoreManager.registerNewCoreElement("fakeSignature40");
    CoreManager.registerNewCoreElement("fakeSignature50");
    CoreManager.registerNewCoreElement("fakeSignature60");
    CoreManager.registerNewCoreElement("fakeSignature70");
    FakeImplementation impl00 = new FakeImplementation(0, 0, new FakeResourceDescription(2));
    List<Implementation<?>> impls0 = new LinkedList<>();
    impls0.add(impl00);
    List<String> signatures0 = new LinkedList<>();
    signatures0.add("fakeSignature00");
    CoreManager.registerNewImplementations(0, impls0, signatures0);
    FakeImplementation impl10 = new FakeImplementation(1, 0, new FakeResourceDescription(3));
    List<Implementation<?>> impls1 = new LinkedList<>();
    impls1.add(impl10);
    List<String> signatures1 = new LinkedList<>();
    signatures1.add("fakeSignature10");
    CoreManager.registerNewImplementations(1, impls1, signatures1);
    FakeImplementation impl20 = new FakeImplementation(2, 0, new FakeResourceDescription(1));
    List<Implementation<?>> impls2 = new LinkedList<>();
    impls2.add(impl20);
    List<String> signatures2 = new LinkedList<>();
    signatures2.add("fakeSignature20");
    CoreManager.registerNewImplementations(2, impls2, signatures2);
    FakeImplementation impl30 = new FakeImplementation(3, 0, new FakeResourceDescription(4));
    List<Implementation<?>> impls3 = new LinkedList<>();
    impls3.add(impl30);
    List<String> signatures3 = new LinkedList<>();
    signatures3.add("fakeSignature30");
    CoreManager.registerNewImplementations(3, impls3, signatures3);
    FakeImplementation impl40 = new FakeImplementation(4, 0, new FakeResourceDescription(2));
    List<Implementation<?>> impls4 = new LinkedList<>();
    impls4.add(impl40);
    List<String> signatures4 = new LinkedList<>();
    signatures4.add("fakeSignature40");
    CoreManager.registerNewImplementations(4, impls4, signatures4);
    FakeImplementation impl50 = new FakeImplementation(5, 0, new FakeResourceDescription(1));
    List<Implementation<?>> impls5 = new LinkedList<>();
    impls5.add(impl50);
    List<String> signatures5 = new LinkedList<>();
    signatures5.add("fakeSignature50");
    CoreManager.registerNewImplementations(5, impls5, signatures5);
    FakeImplementation impl60 = new FakeImplementation(6, 0, new FakeResourceDescription(3));
    List<Implementation<?>> impls6 = new LinkedList<>();
    impls6.add(impl60);
    List<String> signatures6 = new LinkedList<>();
    signatures6.add("fakeSignature60");
    CoreManager.registerNewImplementations(6, impls6, signatures6);
    int maxSlots = 4;
    FakeResourceDescription frd = new FakeResourceDescription(maxSlots);
    FakeWorker fw = new FakeWorker("worker1", frd, maxSlots);
    drs1 = new FullGraphResourceScheduler<FakeProfile, FakeResourceDescription, FakeImplementation>(fw, fao);
    FakeResourceDescription frd2 = new FakeResourceDescription(maxSlots);
    FakeWorker fw2 = new FakeWorker("worker2", frd2, maxSlots);
    drs2 = new FullGraphResourceScheduler<FakeProfile, FakeResourceDescription, FakeImplementation>(fw2, fao);
    drs1.profiledExecution(impl00, new FakeProfile(50));
    drs1.profiledExecution(impl10, new FakeProfile(50));
    drs1.profiledExecution(impl20, new FakeProfile(30));
    drs1.profiledExecution(impl30, new FakeProfile(50));
    drs1.profiledExecution(impl40, new FakeProfile(20));
    drs1.profiledExecution(impl50, new FakeProfile(10));
    drs1.profiledExecution(impl60, new FakeProfile(30));
    drs2.profiledExecution(impl00, new FakeProfile(50));
    drs2.profiledExecution(impl10, new FakeProfile(50));
    drs2.profiledExecution(impl20, new FakeProfile(30));
    // Faster than drs
    drs2.profiledExecution(impl30, new FakeProfile(30));
    drs2.profiledExecution(impl40, new FakeProfile(15));
    drs2.profiledExecution(impl50, new FakeProfile(10));
    drs2.profiledExecution(impl60, new FakeProfile(15));
}
Also used : FakeProfile(es.bsc.es.bsc.compss.scheduler.types.fake.FakeProfile) FakeImplementation(es.bsc.es.bsc.compss.scheduler.types.fake.FakeImplementation) FakeResourceDescription(es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceDescription) Implementation(es.bsc.compss.types.implementations.Implementation) FakeImplementation(es.bsc.es.bsc.compss.scheduler.types.fake.FakeImplementation) LinkedList(java.util.LinkedList) FakeWorker(es.bsc.es.bsc.compss.scheduler.types.fake.FakeWorker) BeforeClass(org.junit.BeforeClass)

Example 3 with FakeWorker

use of es.bsc.es.bsc.compss.scheduler.types.fake.FakeWorker in project compss by bsc-wdc.

the class OptimizationTest method testDonorsAndReceivers.

// @Test
@SuppressWarnings("unchecked")
public void testDonorsAndReceivers() {
    ScheduleOptimizer<FakeProfile, FakeResourceDescription, FakeImplementation> so = new ScheduleOptimizer<>(ds);
    long[] expectedEndTimes = new long[] { 35000, 20000, 15000, 50000, 40000, 1000 };
    OptimizationWorker<FakeProfile, FakeResourceDescription, FakeImplementation>[] optimizedWorkers = new OptimizationWorker[expectedEndTimes.length];
    for (int idx = 0; idx < expectedEndTimes.length; idx++) {
        int maxSlots = 1;
        FakeResourceDescription frd = new FakeResourceDescription(maxSlots);
        FakeWorker fw = new FakeWorker("worker" + idx, frd, maxSlots);
        FakeResourceScheduler frs = new FakeResourceScheduler(fw, fao, expectedEndTimes[idx]);
        optimizedWorkers[idx] = new OptimizationWorker<>(frs);
    }
    LinkedList<OptimizationWorker<FakeProfile, FakeResourceDescription, FakeImplementation>> receivers = new LinkedList<>();
    OptimizationWorker<FakeProfile, FakeResourceDescription, FakeImplementation> donor = so.determineDonorAndReceivers(optimizedWorkers, receivers);
    LinkedList<OptimizationWorker<FakeProfile, FakeResourceDescription, FakeImplementation>> donors = new LinkedList<>();
    donors.offer(donor);
    LinkedList<String> donorsNames = new LinkedList<>();
    donorsNames.add("worker3");
    LinkedList<String> receiversNames = new LinkedList<>();
    receiversNames.add("worker5");
    receiversNames.add("worker2");
    receiversNames.add("worker1");
    receiversNames.add("worker0");
    receiversNames.add("worker4");
    Verifiers.verifyWorkersPriority(donors, donorsNames);
    Verifiers.verifyWorkersPriority(receivers, receiversNames);
}
Also used : FakeProfile(es.bsc.es.bsc.compss.scheduler.types.fake.FakeProfile) FakeImplementation(es.bsc.es.bsc.compss.scheduler.types.fake.FakeImplementation) FakeResourceDescription(es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceDescription) FakeWorker(es.bsc.es.bsc.compss.scheduler.types.fake.FakeWorker) LinkedList(java.util.LinkedList) OptimizationWorker(es.bsc.es.bsc.compss.scheduler.types.OptimizationWorker) ScheduleOptimizer(es.bsc.es.bsc.compss.scheduler.fullGraphScheduler.ScheduleOptimizer) FakeResourceScheduler(es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceScheduler)

Example 4 with FakeWorker

use of es.bsc.es.bsc.compss.scheduler.types.fake.FakeWorker in project compss by bsc-wdc.

the class ScoresTest method setUpClass.

@BeforeClass
public static void setUpClass() {
    CoreManager.clear();
    CoreManager.registerNewCoreElement("fakeSignature00");
    CoreManager.registerNewCoreElement("fakeSignature10");
    CoreManager.registerNewCoreElement("fakeSignature20");
    CoreManager.registerNewCoreElement("fakeSignature30");
    CoreManager.registerNewCoreElement("fakeSignature40");
    CoreManager.registerNewCoreElement("task");
    System.setProperty(ITConstants.IT_TRACING, "0");
    System.setProperty(ITConstants.IT_EXTRAE_CONFIG_FILE, "");
    Comm.init();
    ds = new FullGraphScheduler<FakeProfile, FakeResourceDescription, FakeImplementation>();
    FakeImplementation impl00 = new FakeImplementation(0, 0, new FakeResourceDescription(2));
    List<Implementation<?>> impls0 = new LinkedList<>();
    impls0.add(impl00);
    List<String> signatures0 = new LinkedList<>();
    signatures0.add("fakeSignature00");
    CoreManager.registerNewImplementations(0, impls0, signatures0);
    FakeImplementation impl10 = new FakeImplementation(1, 0, new FakeResourceDescription(3));
    List<Implementation<?>> impls1 = new LinkedList<>();
    impls1.add(impl10);
    List<String> signatures1 = new LinkedList<>();
    signatures1.add("fakeSignature10");
    CoreManager.registerNewImplementations(1, impls1, signatures1);
    FakeImplementation impl20 = new FakeImplementation(2, 0, new FakeResourceDescription(1));
    List<Implementation<?>> impls2 = new LinkedList<>();
    impls2.add(impl20);
    List<String> signatures2 = new LinkedList<>();
    signatures2.add("fakeSignature20");
    CoreManager.registerNewImplementations(2, impls2, signatures2);
    FakeImplementation impl30 = new FakeImplementation(3, 0, new FakeResourceDescription(4));
    List<Implementation<?>> impls3 = new LinkedList<>();
    impls3.add(impl30);
    List<String> signatures3 = new LinkedList<>();
    signatures3.add("fakeSignature30");
    CoreManager.registerNewImplementations(3, impls3, signatures3);
    FakeImplementation impl40 = new FakeImplementation(4, 0, new FakeResourceDescription(4));
    FakeImplementation impl41 = new FakeImplementation(4, 1, new FakeResourceDescription(2));
    List<Implementation<?>> impls4 = new LinkedList<>();
    impls4.add(impl40);
    impls4.add(impl41);
    List<String> signatures4 = new LinkedList<>();
    signatures4.add("fakeSignature40");
    signatures4.add("fakeSignature41");
    CoreManager.registerNewImplementations(4, impls4, signatures4);
    int maxSlots = 4;
    FakeResourceDescription frd = new FakeResourceDescription(maxSlots);
    FakeWorker fw = new FakeWorker("worker1", frd, maxSlots);
    drs1 = new FakeResourceScheduler(fw, fao, 0);
    FakeResourceDescription frd2 = new FakeResourceDescription(maxSlots);
    FakeWorker fw2 = new FakeWorker("worker2", frd2, maxSlots);
    drs2 = new FakeResourceScheduler(fw2, fao, 0);
    drs1.profiledExecution(impl00, new FakeProfile(50));
    drs1.profiledExecution(impl10, new FakeProfile(50));
    drs1.profiledExecution(impl20, new FakeProfile(30));
    drs1.profiledExecution(impl30, new FakeProfile(50));
    drs1.profiledExecution(impl40, new FakeProfile(20));
    drs1.profiledExecution(impl41, new FakeProfile(30));
    CORE0 = drs1.getProfile(impl00).getAverageExecutionTime();
    CORE2 = drs1.getProfile(impl20).getAverageExecutionTime();
    CORE4_0 = drs1.getProfile(impl40).getAverageExecutionTime();
    CORE4_1 = drs1.getProfile(impl41).getAverageExecutionTime();
// debugConfiguration();
}
Also used : FakeProfile(es.bsc.es.bsc.compss.scheduler.types.fake.FakeProfile) FakeImplementation(es.bsc.es.bsc.compss.scheduler.types.fake.FakeImplementation) FakeResourceDescription(es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceDescription) FakeResourceScheduler(es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceScheduler) Implementation(es.bsc.compss.types.implementations.Implementation) FakeImplementation(es.bsc.es.bsc.compss.scheduler.types.fake.FakeImplementation) LinkedList(java.util.LinkedList) FakeWorker(es.bsc.es.bsc.compss.scheduler.types.fake.FakeWorker) BeforeClass(org.junit.BeforeClass)

Aggregations

FakeImplementation (es.bsc.es.bsc.compss.scheduler.types.fake.FakeImplementation)4 FakeProfile (es.bsc.es.bsc.compss.scheduler.types.fake.FakeProfile)4 FakeResourceDescription (es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceDescription)4 FakeWorker (es.bsc.es.bsc.compss.scheduler.types.fake.FakeWorker)4 LinkedList (java.util.LinkedList)4 Implementation (es.bsc.compss.types.implementations.Implementation)3 FakeResourceScheduler (es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceScheduler)3 BeforeClass (org.junit.BeforeClass)3 ScheduleOptimizer (es.bsc.es.bsc.compss.scheduler.fullGraphScheduler.ScheduleOptimizer)1 OptimizationWorker (es.bsc.es.bsc.compss.scheduler.types.OptimizationWorker)1