Search in sources :

Example 11 with FakeAllocatableAction

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

the class AllocatableActionTest method testEndResourceAndDataSuccessors.

private void testEndResourceAndDataSuccessors() {
    LOGGER.info("testEndDataAndResourceSuccessors");
    try {
        prepare(4);
        FakeAllocatableAction instance0 = new FakeAllocatableAction(fao, 0);
        instance0.assignResource(rs);
        FakeAllocatableAction instance1 = new FakeAllocatableAction(fao, 1);
        instance1.assignResource(rs);
        FakeAllocatableAction instance2 = new FakeAllocatableAction(fao, 2);
        instance2.assignResource(rs);
        FakeAllocatableAction instance3 = new FakeAllocatableAction(fao, 3);
        instance3.assignResource(rs);
        instance1.addDataPredecessor(instance0);
        addResourceDependency(instance0, instance2);
        instance0.tryToLaunch();
        completed(instance0);
        checkExecutions(new int[] { 1, 1, 1, 0 });
    } catch (Throwable e) {
        LOGGER.error(e);
        fail(e.getMessage());
    }
}
Also used : FakeAllocatableAction(es.bsc.compss.types.fake.FakeAllocatableAction)

Example 12 with FakeAllocatableAction

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

the class AllocatableActionTest method testEndResourceSuccessors.

private void testEndResourceSuccessors() {
    LOGGER.info("testEndResourceSuccessors");
    try {
        prepare(4);
        FakeAllocatableAction instance0 = new FakeAllocatableAction(fao, 0);
        instance0.assignResource(rs);
        FakeAllocatableAction instance1 = new FakeAllocatableAction(fao, 1);
        instance1.assignResource(rs);
        FakeAllocatableAction instance2 = new FakeAllocatableAction(fao, 2);
        instance2.assignResource(rs);
        FakeAllocatableAction instance3 = new FakeAllocatableAction(fao, 3);
        instance3.assignResource(rs);
        addResourceDependency(instance0, instance1);
        instance0.tryToLaunch();
        completed(instance0);
        checkExecutions(new int[] { 1, 1, 0, 0 });
    } catch (Throwable e) {
        LOGGER.error(e);
        fail(e.getMessage());
    }
}
Also used : FakeAllocatableAction(es.bsc.compss.types.fake.FakeAllocatableAction)

Example 13 with FakeAllocatableAction

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

the class AllocatableActionTest method testEndTwoResourcesPredecessors.

private void testEndTwoResourcesPredecessors() {
    LOGGER.info("testEndTwoResourcesPredecessors");
    try {
        prepare(4);
        FakeAllocatableAction instance0 = new FakeAllocatableAction(fao, 0);
        instance0.assignResource(rs);
        FakeAllocatableAction instance1 = new FakeAllocatableAction(fao, 1);
        instance1.assignResource(rs);
        FakeAllocatableAction instance2 = new FakeAllocatableAction(fao, 2);
        instance2.assignResource(rs);
        FakeAllocatableAction instance3 = new FakeAllocatableAction(fao, 3);
        instance3.assignResource(rs);
        addResourceDependency(instance0, instance2);
        addResourceDependency(instance1, instance2);
        instance0.tryToLaunch();
        completed(instance0);
        checkExecutions(new int[] { 1, 0, 0, 0 });
        instance1.tryToLaunch();
        completed(instance1);
        checkExecutions(new int[] { 1, 1, 1, 0 });
    } catch (Throwable e) {
        LOGGER.error(e);
        fail(e.getMessage());
    }
}
Also used : FakeAllocatableAction(es.bsc.compss.types.fake.FakeAllocatableAction)

Example 14 with FakeAllocatableAction

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

the class AllocatableActionTest method testEndTwoResourceSuccessors.

private void testEndTwoResourceSuccessors() {
    LOGGER.info("testEndTwoDataSuccessors");
    try {
        prepare(4);
        FakeAllocatableAction instance0 = new FakeAllocatableAction(fao, 0);
        instance0.assignResource(rs);
        FakeAllocatableAction instance1 = new FakeAllocatableAction(fao, 1);
        instance1.assignResource(rs);
        FakeAllocatableAction instance2 = new FakeAllocatableAction(fao, 2);
        instance2.assignResource(rs);
        FakeAllocatableAction instance3 = new FakeAllocatableAction(fao, 3);
        instance3.assignResource(rs);
        addResourceDependency(instance0, instance1);
        addResourceDependency(instance0, instance2);
        instance0.tryToLaunch();
        completed(instance0);
        checkExecutions(new int[] { 1, 1, 1, 0 });
    } catch (Throwable e) {
        LOGGER.error(e);
        fail(e.getMessage());
    }
}
Also used : FakeAllocatableAction(es.bsc.compss.types.fake.FakeAllocatableAction)

Example 15 with FakeAllocatableAction

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

the class AllocatableActionTest method testEndTwoDataSuccessors.

private void testEndTwoDataSuccessors() {
    LOGGER.info("testEndTwoDataSuccessors");
    try {
        prepare(4);
        FakeAllocatableAction instance0 = new FakeAllocatableAction(fao, 0);
        instance0.assignResource(rs);
        FakeAllocatableAction instance1 = new FakeAllocatableAction(fao, 1);
        instance1.assignResource(rs);
        FakeAllocatableAction instance2 = new FakeAllocatableAction(fao, 2);
        instance2.assignResource(rs);
        FakeAllocatableAction instance3 = new FakeAllocatableAction(fao, 3);
        instance3.assignResource(rs);
        instance1.addDataPredecessor(instance0);
        instance2.addDataPredecessor(instance0);
        instance0.tryToLaunch();
        completed(instance0);
        checkExecutions(new int[] { 1, 1, 1, 0 });
    } catch (Throwable e) {
        LOGGER.error(e);
        fail(e.getMessage());
    }
}
Also used : FakeAllocatableAction(es.bsc.compss.types.fake.FakeAllocatableAction)

Aggregations

FakeAllocatableAction (es.bsc.compss.types.fake.FakeAllocatableAction)20 FailedActionException (es.bsc.compss.scheduler.exceptions.FailedActionException)2 AllocatableAction (es.bsc.compss.scheduler.types.AllocatableAction)2 FakeResourceScheduler (es.bsc.compss.types.fake.FakeResourceScheduler)2 BlockedActionException (es.bsc.compss.scheduler.exceptions.BlockedActionException)1 InvalidSchedulingException (es.bsc.compss.scheduler.exceptions.InvalidSchedulingException)1 UnassignedActionException (es.bsc.compss.scheduler.exceptions.UnassignedActionException)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 Test (org.junit.Test)1