Search in sources :

Example 36 with TaskSchedulePlan

use of edu.iu.dsc.tws.api.compute.schedule.elements.TaskSchedulePlan in project twister2 by DSC-SPIDAL.

the class TaskSchedulerTest method testUniqueSchedules1.

@Test
public void testUniqueSchedules1() {
    int parallel = 2;
    ComputeGraph graph = createStreamingGraph(parallel);
    TaskScheduler scheduler = new TaskScheduler();
    Config config = getConfig();
    scheduler.initialize(config);
    WorkerPlan workerPlan = createWorkPlan(parallel);
    if (graph.getOperationMode().equals("STREAMING")) {
        Assert.assertEquals(scheduler.getClass(), TaskSchedulerContext.streamingTaskSchedulingClass(config));
    }
    TaskSchedulePlan plan1 = scheduler.schedule(graph, workerPlan);
    Assert.assertNotNull(plan1);
}
Also used : TaskSchedulePlan(edu.iu.dsc.tws.api.compute.schedule.elements.TaskSchedulePlan) ComputeGraph(edu.iu.dsc.tws.api.compute.graph.ComputeGraph) Config(edu.iu.dsc.tws.api.config.Config) WorkerPlan(edu.iu.dsc.tws.api.compute.schedule.elements.WorkerPlan) TaskSchedulerClassTest(edu.iu.dsc.tws.tsched.utils.TaskSchedulerClassTest) Test(org.junit.Test)

Aggregations

TaskSchedulePlan (edu.iu.dsc.tws.api.compute.schedule.elements.TaskSchedulePlan)36 WorkerPlan (edu.iu.dsc.tws.api.compute.schedule.elements.WorkerPlan)28 WorkerSchedulePlan (edu.iu.dsc.tws.api.compute.schedule.elements.WorkerSchedulePlan)27 ComputeGraph (edu.iu.dsc.tws.api.compute.graph.ComputeGraph)25 TaskInstancePlan (edu.iu.dsc.tws.api.compute.schedule.elements.TaskInstancePlan)25 Map (java.util.Map)25 TaskSchedulerClassTest (edu.iu.dsc.tws.tsched.utils.TaskSchedulerClassTest)23 Test (org.junit.Test)23 Config (edu.iu.dsc.tws.api.config.Config)12 Vertex (edu.iu.dsc.tws.api.compute.graph.Vertex)7 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)7 List (java.util.List)7 Resource (edu.iu.dsc.tws.api.compute.schedule.elements.Resource)6 TaskInstanceId (edu.iu.dsc.tws.api.compute.schedule.elements.TaskInstanceId)6 Worker (edu.iu.dsc.tws.api.compute.schedule.elements.Worker)6 TaskInstanceMapCalculation (edu.iu.dsc.tws.tsched.spi.taskschedule.TaskInstanceMapCalculation)6 LinkedHashMap (java.util.LinkedHashMap)5 LinkedHashSet (java.util.LinkedHashSet)5 HashSet (java.util.HashSet)4