Search in sources :

Example 1 with MPIWorkerManager

use of edu.iu.dsc.tws.rsched.worker.MPIWorkerManager in project twister2 by DSC-SPIDAL.

the class MPIWorkerStarter method startWorker.

/**
 * start the Worker class specified in conf files
 */
public static boolean startWorker(IWorkerController workerController, IPersistentVolume pv, String podName) {
    IWorker worker = JobUtils.initializeIWorker(job);
    K8sVolatileVolume volatileVolume = null;
    if (computeResource.getDiskGigaBytes() > 0) {
        volatileVolume = new K8sVolatileVolume(jobID, workerID);
    }
    MPIWorkerManager mpiWorkerManager = new MPIWorkerManager();
    return mpiWorkerManager.execute(config, job, workerController, pv, volatileVolume, worker);
}
Also used : MPIWorkerManager(edu.iu.dsc.tws.rsched.worker.MPIWorkerManager) IWorker(edu.iu.dsc.tws.api.resource.IWorker) K8sVolatileVolume(edu.iu.dsc.tws.rsched.schedulers.k8s.worker.K8sVolatileVolume)

Example 2 with MPIWorkerManager

use of edu.iu.dsc.tws.rsched.worker.MPIWorkerManager in project twister2 by DSC-SPIDAL.

the class NomadWorkerStarter method startWorker.

private void startWorker() {
    LOG.log(Level.INFO, "A worker process is starting...");
    // lets create the resource plan
    this.workerController = createWorkerController();
    JobMasterAPI.WorkerInfo workerNetworkInfo = workerController.getWorkerInfo();
    try {
        LOG.log(Level.INFO, "Worker IP..:" + Inet4Address.getLocalHost().getHostAddress());
    } catch (UnknownHostException e) {
        e.printStackTrace();
    }
    try {
        List<JobMasterAPI.WorkerInfo> workerInfos = workerController.getAllWorkers();
    } catch (TimeoutException timeoutException) {
        LOG.log(Level.SEVERE, timeoutException.getMessage(), timeoutException);
        return;
    }
    IWorker worker = JobUtils.initializeIWorker(job);
    MPIWorkerManager workerManager = new MPIWorkerManager();
    workerManager.execute(config, job, workerController, null, null, worker);
}
Also used : JobMasterAPI(edu.iu.dsc.tws.proto.jobmaster.JobMasterAPI) UnknownHostException(java.net.UnknownHostException) MPIWorkerManager(edu.iu.dsc.tws.rsched.worker.MPIWorkerManager) IWorker(edu.iu.dsc.tws.api.resource.IWorker) TimeoutException(edu.iu.dsc.tws.api.exceptions.TimeoutException)

Example 3 with MPIWorkerManager

use of edu.iu.dsc.tws.rsched.worker.MPIWorkerManager in project twister2 by DSC-SPIDAL.

the class MPIWorkerStarter method startWorker.

/**
 * Start the worker
 *
 * @param intracomm communication
 */
private void startWorker(Intracomm intracomm) {
    try {
        // initialize the logger
        initWorkerLogger(config, intracomm.getRank());
        // now create the worker
        IWorkerController wc = WorkerRuntime.getWorkerController();
        IPersistentVolume persistentVolume = initPersistenceVolume(config, globalRank);
        MPIContext.addRuntimeObject("comm", intracomm);
        IWorker worker = JobUtils.initializeIWorker(job);
        MPIWorkerManager workerManager = new MPIWorkerManager();
        workerManager.execute(config, job, wc, persistentVolume, null, worker);
    } catch (MPIException e) {
        LOG.log(Level.SEVERE, "Failed to synchronize the workers at the start");
        throw new RuntimeException(e);
    }
}
Also used : IPersistentVolume(edu.iu.dsc.tws.api.resource.IPersistentVolume) MPIException(mpi.MPIException) Twister2RuntimeException(edu.iu.dsc.tws.api.exceptions.Twister2RuntimeException) MPIWorkerManager(edu.iu.dsc.tws.rsched.worker.MPIWorkerManager) IWorkerController(edu.iu.dsc.tws.api.resource.IWorkerController) IWorker(edu.iu.dsc.tws.api.resource.IWorker)

Aggregations

IWorker (edu.iu.dsc.tws.api.resource.IWorker)3 MPIWorkerManager (edu.iu.dsc.tws.rsched.worker.MPIWorkerManager)3 TimeoutException (edu.iu.dsc.tws.api.exceptions.TimeoutException)1 Twister2RuntimeException (edu.iu.dsc.tws.api.exceptions.Twister2RuntimeException)1 IPersistentVolume (edu.iu.dsc.tws.api.resource.IPersistentVolume)1 IWorkerController (edu.iu.dsc.tws.api.resource.IWorkerController)1 JobMasterAPI (edu.iu.dsc.tws.proto.jobmaster.JobMasterAPI)1 K8sVolatileVolume (edu.iu.dsc.tws.rsched.schedulers.k8s.worker.K8sVolatileVolume)1 UnknownHostException (java.net.UnknownHostException)1 MPIException (mpi.MPIException)1