Search in sources :

Example 16 with JobConfig

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

the class MemoryManagerByteKeyedGatherJob method main.

public static void main(String[] args) {
    // first load the configurations from command line and config files
    Config config = ResourceAllocator.loadConfig(new HashMap<>());
    // build JobConfig
    JobConfig jobConfig = new JobConfig();
    // build the job
    BasicJob basicJob = BasicJob.newBuilder().setName("basic-gather-batch-MM").setContainerClass(BasicMemoryManagerByteKeyedGatherCommunication.class.getName()).setRequestResource(new ResourceContainer(2, 1024), 4).setConfig(jobConfig).build();
    // now submit the job
    Twister2Submitter.submitContainerJob(basicJob, config);
}
Also used : BasicJob(edu.iu.dsc.tws.api.basic.job.BasicJob) Config(edu.iu.dsc.tws.common.config.Config) JobConfig(edu.iu.dsc.tws.api.JobConfig) JobConfig(edu.iu.dsc.tws.api.JobConfig) ResourceContainer(edu.iu.dsc.tws.rsched.spi.resource.ResourceContainer)

Example 17 with JobConfig

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

the class MemoryManagerKeyedGatherJob method main.

public static void main(String[] args) {
    // first load the configurations from command line and config files
    Config config = ResourceAllocator.loadConfig(new HashMap<>());
    // build JobConfig
    JobConfig jobConfig = new JobConfig();
    // build the job
    BasicJob basicJob = BasicJob.newBuilder().setName("basic-gather-batch-MM").setContainerClass(BasicMemoryManagerKeyedGatherCommunication.class.getName()).setRequestResource(new ResourceContainer(2, 1024), 4).setConfig(jobConfig).build();
    // now submit the job
    Twister2Submitter.submitContainerJob(basicJob, config);
}
Also used : BasicJob(edu.iu.dsc.tws.api.basic.job.BasicJob) Config(edu.iu.dsc.tws.common.config.Config) JobConfig(edu.iu.dsc.tws.api.JobConfig) JobConfig(edu.iu.dsc.tws.api.JobConfig) ResourceContainer(edu.iu.dsc.tws.rsched.spi.resource.ResourceContainer)

Example 18 with JobConfig

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

the class MultiTaskGraphJob method main.

public static void main(String[] args) {
    // first load the configurations from command line and config files
    Config config = ResourceAllocator.loadConfig(new HashMap<>());
    // build JobConfig
    JobConfig jobConfig = new JobConfig();
    // build the job
    BasicJob basicJob = BasicJob.newBuilder().setName("multitaskgraph-example").setContainerClass(MultiTaskGraphExample.class.getName()).setRequestResource(new ResourceContainer(2, 1024), 4).setConfig(jobConfig).build();
    // now submit the job
    Twister2Submitter.submitContainerJob(basicJob, config);
}
Also used : BasicJob(edu.iu.dsc.tws.api.basic.job.BasicJob) Config(edu.iu.dsc.tws.common.config.Config) JobConfig(edu.iu.dsc.tws.api.JobConfig) JobConfig(edu.iu.dsc.tws.api.JobConfig) ResourceContainer(edu.iu.dsc.tws.rsched.spi.resource.ResourceContainer)

Example 19 with JobConfig

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

the class KMeansJob method main.

public static void main(String[] args) {
    // first load the configurations from command line and config files
    Config config = ResourceAllocator.loadConfig(new HashMap<>());
    // build JobConfig
    JobConfig jobConfig = new JobConfig();
    BasicJob.BasicJobBuilder jobBuilder = BasicJob.newBuilder();
    jobBuilder.setName("basic-wordcount");
    jobBuilder.setContainerClass(KMeansContainer.class.getName());
    jobBuilder.setRequestResource(new ResourceContainer(2, 1024), 4);
    jobBuilder.setConfig(jobConfig);
    // now submit the job
    Twister2Submitter.submitContainerJob(jobBuilder.build(), config);
}
Also used : BasicJob(edu.iu.dsc.tws.api.basic.job.BasicJob) Config(edu.iu.dsc.tws.common.config.Config) JobConfig(edu.iu.dsc.tws.api.JobConfig) JobConfig(edu.iu.dsc.tws.api.JobConfig) ResourceContainer(edu.iu.dsc.tws.rsched.spi.resource.ResourceContainer)

Example 20 with JobConfig

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

the class BasicAuroraJob method main.

public static void main(String[] args) {
    // first load the configurations from command line and config files
    Config config = ResourceAllocator.loadConfig(new HashMap<>());
    System.out.println("read config values: " + config.size());
    System.out.println(config);
    int cpus = Integer.parseInt(AuroraContext.cpusPerContainer(config));
    int ramMegaBytes = AuroraContext.ramPerContainer(config) / (1024 * 1024);
    int diskMegaBytes = AuroraContext.diskPerContainer(config) / (1024 * 1024);
    int containers = Integer.parseInt(AuroraContext.numberOfContainers(config));
    String jobName = SchedulerContext.jobName(config);
    ResourceContainer resourceContainer = new ResourceContainer(cpus, ramMegaBytes, diskMegaBytes);
    // build JobConfig
    JobConfig jobConfig = new JobConfig();
    String containerClass = SchedulerContext.containerClass(config);
    // build the job
    BasicJob basicJob = BasicJob.newBuilder().setName(jobName).setContainerClass(containerClass).setRequestResource(resourceContainer, containers).setConfig(jobConfig).build();
    // now submit the job
    Twister2Submitter.submitContainerJob(basicJob, config);
    // now terminate the job
    terminateJob(config);
// jobWriteTest(basicJob);
// jobReadTest();
}
Also used : BasicJob(edu.iu.dsc.tws.api.basic.job.BasicJob) Config(edu.iu.dsc.tws.common.config.Config) JobConfig(edu.iu.dsc.tws.api.JobConfig) JobConfig(edu.iu.dsc.tws.api.JobConfig) ResourceContainer(edu.iu.dsc.tws.rsched.spi.resource.ResourceContainer)

Aggregations

JobConfig (edu.iu.dsc.tws.api.JobConfig)33 BasicJob (edu.iu.dsc.tws.api.basic.job.BasicJob)31 ResourceContainer (edu.iu.dsc.tws.rsched.spi.resource.ResourceContainer)31 Config (edu.iu.dsc.tws.common.config.Config)30 Twister2Job (edu.iu.dsc.tws.api.Twister2Job)2 Config (edu.iu.dsc.tws.api.config.Config)2 Twister2JobState (edu.iu.dsc.tws.api.scheduler.Twister2JobState)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 Twister2RuntimeException (edu.iu.dsc.tws.api.exceptions.Twister2RuntimeException)1 PTransformOverride (org.apache.beam.sdk.runners.PTransformOverride)1