use of edu.iu.dsc.tws.api.comms.channel.TWSChannel in project twister2 by DSC-SPIDAL.
the class TaskUtils method execute.
public static void execute(Config config, int workerID, ComputeGraph graph, IWorkerController workerController) {
RoundRobinTaskScheduler roundRobinTaskScheduler = new RoundRobinTaskScheduler();
roundRobinTaskScheduler.initialize(config);
List<JobMasterAPI.WorkerInfo> workerList = null;
try {
workerList = workerController.getAllWorkers();
} catch (TimeoutException timeoutException) {
LOG.log(Level.SEVERE, timeoutException.getMessage(), timeoutException);
return;
}
WorkerPlan workerPlan = createWorkerPlan(workerList);
TaskSchedulePlan taskSchedulePlan = roundRobinTaskScheduler.schedule(graph, workerPlan);
TWSChannel network = Network.initializeChannel(config, workerController);
ExecutionPlanBuilder executionPlanBuilder = new ExecutionPlanBuilder(workerID, workerList, new Communicator(config, network), workerController.getCheckpointingClient());
ExecutionPlan plan = executionPlanBuilder.build(config, graph, taskSchedulePlan);
ExecutorFactory executor = new ExecutorFactory(config, workerID, network);
executor.getExecutor(config, plan, graph.getOperationMode()).execute();
}
use of edu.iu.dsc.tws.api.comms.channel.TWSChannel in project twister2 by DSC-SPIDAL.
the class TaskUtils method executeBatch.
public static void executeBatch(Config config, int workerID, ComputeGraph graph, IWorkerController workerController) {
RoundRobinTaskScheduler roundRobinTaskScheduler = new RoundRobinTaskScheduler();
roundRobinTaskScheduler.initialize(config);
WorkerPlan workerPlan = null;
List<JobMasterAPI.WorkerInfo> workerList = null;
try {
workerList = workerController.getAllWorkers();
} catch (TimeoutException timeoutException) {
LOG.log(Level.SEVERE, timeoutException.getMessage(), timeoutException);
return;
}
workerPlan = createWorkerPlan(workerList);
TaskSchedulePlan taskSchedulePlan = roundRobinTaskScheduler.schedule(graph, workerPlan);
TWSChannel network = Network.initializeChannel(config, workerController);
ExecutionPlanBuilder executionPlanBuilder = new ExecutionPlanBuilder(workerID, workerList, new Communicator(config, network), workerController.getCheckpointingClient());
ExecutionPlan plan = executionPlanBuilder.build(config, graph, taskSchedulePlan);
ExecutorFactory executor = new ExecutorFactory(config, workerID, network);
executor.getExecutor(config, plan, graph.getOperationMode()).execute();
}
use of edu.iu.dsc.tws.api.comms.channel.TWSChannel in project twister2 by DSC-SPIDAL.
the class WordCountWorker method setupNetwork.
private void setupNetwork(IWorkerController controller) {
TWSChannel twsChannel = Network.initializeChannel(config, controller);
this.channel = new Communicator(config, twsChannel);
}
Aggregations