Search in sources :

Example 16 with TimeoutException

use of edu.iu.dsc.tws.api.exceptions.TimeoutException in project twister2 by DSC-SPIDAL.

the class KeyedBenchWorker method execute.

@Override
public void execute(WorkerEnvironment workerEnvironment) {
    this.workerEnv = workerEnvironment;
    workerId = workerEnv.getWorkerId();
    Config cfg = workerEnv.getConfig();
    Timing.setDefaultTimingUnit(TimingUnit.NANO_SECONDS);
    this.resultsRecorder = new BenchmarkResultsRecorder(cfg, workerId == 0);
    // create the job parameters
    this.jobParameters = JobParameters.build(cfg);
    // lets create the task plan
    this.logicalPlan = Utils.createStageLogicalPlan(workerEnv, jobParameters.getTaskStages());
    this.inputDataArray = DataGenerator.generateIntData(jobParameters.getSize());
    // collect experiment data
    experimentData = new ExperimentData();
    // now lets execute
    compute(workerEnv);
    // now progress
    progress();
    // wait for the sync
    try {
        workerEnv.getWorkerController().waitOnBarrier();
    } catch (TimeoutException timeoutException) {
        LOG.log(Level.SEVERE, timeoutException.getMessage(), timeoutException);
    }
    // let allows the specific example to close
    close();
    // lets terminate the communicator
    workerEnv.close();
}
Also used : Config(edu.iu.dsc.tws.api.config.Config) BenchmarkResultsRecorder(edu.iu.dsc.tws.examples.utils.bench.BenchmarkResultsRecorder) ExperimentData(edu.iu.dsc.tws.examples.verification.ExperimentData) TimeoutException(edu.iu.dsc.tws.api.exceptions.TimeoutException)

Example 17 with TimeoutException

use of edu.iu.dsc.tws.api.exceptions.TimeoutException in project twister2 by DSC-SPIDAL.

the class BenchWorker method execute.

@Override
public void execute(WorkerEnvironment workerEnvironment) {
    this.workerEnv = workerEnvironment;
    workerId = workerEnv.getWorkerId();
    Config cfg = workerEnv.getConfig();
    Timing.setDefaultTimingUnit(TimingUnit.NANO_SECONDS);
    // create the job parameters
    this.jobParameters = JobParameters.build(cfg);
    this.resultsRecorder = new BenchmarkResultsRecorder(cfg, workerId == 0);
    // lets create the task plan
    this.logicalPlan = Utils.createStageLogicalPlan(workerEnv, jobParameters.getTaskStages());
    // todo collect experiment data : will be removed
    experimentData = new ExperimentData();
    if (jobParameters.isStream()) {
        experimentData.setOperationMode(OperationMode.STREAMING);
    } else {
        experimentData.setOperationMode(OperationMode.BATCH);
    }
    // todo above will be removed
    this.inputDataArray = generateData();
    // todo below will be removed
    experimentData.setInput(this.inputDataArray);
    experimentData.setTaskStages(jobParameters.getTaskStages());
    experimentData.setIterations(jobParameters.getIterations());
    // todo above will be removed
    // now lets execute
    compute(workerEnv);
    // now communicationProgress
    progress();
    // wait for the sync
    try {
        workerEnv.getWorkerController().waitOnBarrier();
    } catch (TimeoutException timeoutException) {
        LOG.log(Level.SEVERE, timeoutException, () -> timeoutException.getMessage());
    }
    // let allows the specific example to close
    close();
    // lets terminate the communicator
    workerEnv.close();
}
Also used : Config(edu.iu.dsc.tws.api.config.Config) BenchmarkResultsRecorder(edu.iu.dsc.tws.examples.utils.bench.BenchmarkResultsRecorder) ExperimentData(edu.iu.dsc.tws.examples.verification.ExperimentData) TimeoutException(edu.iu.dsc.tws.api.exceptions.TimeoutException)

Aggregations

TimeoutException (edu.iu.dsc.tws.api.exceptions.TimeoutException)17 JobMasterAPI (edu.iu.dsc.tws.proto.jobmaster.JobMasterAPI)6 JobFaultyException (edu.iu.dsc.tws.api.exceptions.JobFaultyException)5 Twister2RuntimeException (edu.iu.dsc.tws.api.exceptions.Twister2RuntimeException)4 Communicator (edu.iu.dsc.tws.api.comms.Communicator)3 TWSChannel (edu.iu.dsc.tws.api.comms.channel.TWSChannel)2 ExecutionPlan (edu.iu.dsc.tws.api.compute.executor.ExecutionPlan)2 TaskSchedulePlan (edu.iu.dsc.tws.api.compute.schedule.elements.TaskSchedulePlan)2 WorkerPlan (edu.iu.dsc.tws.api.compute.schedule.elements.WorkerPlan)2 Config (edu.iu.dsc.tws.api.config.Config)2 Twister2Exception (edu.iu.dsc.tws.api.exceptions.Twister2Exception)2 ISenderToDriver (edu.iu.dsc.tws.api.resource.ISenderToDriver)2 IWorker (edu.iu.dsc.tws.api.resource.IWorker)2 BenchmarkResultsRecorder (edu.iu.dsc.tws.examples.utils.bench.BenchmarkResultsRecorder)2 ExperimentData (edu.iu.dsc.tws.examples.verification.ExperimentData)2 ExecutionPlanBuilder (edu.iu.dsc.tws.executor.core.ExecutionPlanBuilder)2 ExecutorFactory (edu.iu.dsc.tws.executor.threading.ExecutorFactory)2 JobAPI (edu.iu.dsc.tws.proto.system.job.JobAPI)2 RoundRobinTaskScheduler (edu.iu.dsc.tws.tsched.streaming.roundrobin.RoundRobinTaskScheduler)2 UnknownHostException (java.net.UnknownHostException)2