use of es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceScheduler 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();
}
use of es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceScheduler 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);
}
use of es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceScheduler 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();
}
Aggregations