Search in sources :

Example 1 with Score

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

the class ScoresTest method testActionScores.

@SuppressWarnings("unchecked")
@Test
public void testActionScores() throws BlockedActionException, UnassignedActionException {
    drs1.clear();
    FakeAllocatableAction action1 = new FakeAllocatableAction(fao, 1, 1, CoreManager.getCoreImplementations(0));
    FakeAllocatableAction action2 = new FakeAllocatableAction(fao, 2, 0, CoreManager.getCoreImplementations(0));
    FakeAllocatableAction action14 = new FakeAllocatableAction(fao, 14, 0, CoreManager.getCoreImplementations(0));
    action14.selectExecution(drs2, (FakeImplementation) action14.getImplementations()[0]);
    FullGraphSchedulingInformation<FakeProfile, FakeResourceDescription, FakeImplementation> dsi14 = (FullGraphSchedulingInformation<FakeProfile, FakeResourceDescription, FakeImplementation>) action14.getSchedulingInfo();
    dsi14.setExpectedEnd(10_000);
    FakeAllocatableAction action15 = new FakeAllocatableAction(fao, 15, 0, CoreManager.getCoreImplementations(0));
    action15.selectExecution(drs2, (FakeImplementation) action15.getImplementations()[0]);
    FullGraphSchedulingInformation<FakeProfile, FakeResourceDescription, FakeImplementation> dsi15 = (FullGraphSchedulingInformation<FakeProfile, FakeResourceDescription, FakeImplementation>) action15.getSchedulingInfo();
    dsi15.setExpectedEnd(12_000);
    FullGraphScore<FakeProfile, FakeResourceDescription, FakeImplementation> score1 = (FullGraphScore<FakeProfile, FakeResourceDescription, FakeImplementation>) ds.generateActionScore(action1);
    Score score2 = ds.generateActionScore(action2);
    Verifiers.verifyScore(score1, 1, 0, 0, 0, 0);
    Verifiers.verifyScore((FullGraphScore<FakeProfile, FakeResourceDescription, FakeImplementation>) score2, 0, 0, 0, 0, 0);
    Verifiers.validateBetterScore(score1, score2, true);
    action1.addDataPredecessor(action14);
    score1 = (FullGraphScore<FakeProfile, FakeResourceDescription, FakeImplementation>) ds.generateActionScore(action1);
    Verifiers.verifyScore(score1, 1, 10_000, 0, 0, 10_000);
    action1.addDataPredecessor(action15);
    score1 = (FullGraphScore<FakeProfile, FakeResourceDescription, FakeImplementation>) ds.generateActionScore(action1);
    Verifiers.verifyScore(score1, 1, 12_000, 0, 0, 12_000);
}
Also used : FakeProfile(es.bsc.es.bsc.compss.scheduler.types.fake.FakeProfile) FakeImplementation(es.bsc.es.bsc.compss.scheduler.types.fake.FakeImplementation) FullGraphScore(es.bsc.es.bsc.compss.scheduler.types.FullGraphScore) Score(es.bsc.es.bsc.compss.scheduler.types.Score) FullGraphSchedulingInformation(es.bsc.es.bsc.compss.scheduler.fullGraphScheduler.FullGraphSchedulingInformation) FullGraphScore(es.bsc.es.bsc.compss.scheduler.types.FullGraphScore) FakeResourceDescription(es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceDescription) FakeAllocatableAction(es.bsc.es.bsc.compss.scheduler.types.fake.FakeAllocatableAction) Test(org.junit.Test)

Aggregations

FullGraphSchedulingInformation (es.bsc.es.bsc.compss.scheduler.fullGraphScheduler.FullGraphSchedulingInformation)1 FullGraphScore (es.bsc.es.bsc.compss.scheduler.types.FullGraphScore)1 Score (es.bsc.es.bsc.compss.scheduler.types.Score)1 FakeAllocatableAction (es.bsc.es.bsc.compss.scheduler.types.fake.FakeAllocatableAction)1 FakeImplementation (es.bsc.es.bsc.compss.scheduler.types.fake.FakeImplementation)1 FakeProfile (es.bsc.es.bsc.compss.scheduler.types.fake.FakeProfile)1 FakeResourceDescription (es.bsc.es.bsc.compss.scheduler.types.fake.FakeResourceDescription)1 Test (org.junit.Test)1