Search in sources :

Example 1 with ExperimentData

use of edu.iu.dsc.tws.examples.verification.ExperimentData in project twister2 by DSC-SPIDAL.

the class BaseTSetBatchWorker method execute.

@Override
public void execute(WorkerEnvironment workerEnv) {
    BatchEnvironment env = TSetEnvironment.initBatch(workerEnv);
    jobParameters = JobParameters.build(env.getConfig());
    experimentData = new ExperimentData();
    experimentData.setTaskStages(jobParameters.getTaskStages());
    if (jobParameters.isStream()) {
        throw new IllegalStateException("This worker does not support streaming, Please use" + "TSetStreamingWorker instead");
    } else {
        experimentData.setOperationMode(OperationMode.BATCH);
        experimentData.setIterations(jobParameters.getIterations());
    }
}
Also used : BatchEnvironment(edu.iu.dsc.tws.tset.env.BatchEnvironment) ExperimentData(edu.iu.dsc.tws.examples.verification.ExperimentData)

Example 2 with ExperimentData

use of edu.iu.dsc.tws.examples.verification.ExperimentData 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 3 with ExperimentData

use of edu.iu.dsc.tws.examples.verification.ExperimentData 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

ExperimentData (edu.iu.dsc.tws.examples.verification.ExperimentData)3 Config (edu.iu.dsc.tws.api.config.Config)2 TimeoutException (edu.iu.dsc.tws.api.exceptions.TimeoutException)2 BenchmarkResultsRecorder (edu.iu.dsc.tws.examples.utils.bench.BenchmarkResultsRecorder)2 BatchEnvironment (edu.iu.dsc.tws.tset.env.BatchEnvironment)1