Search in sources :

Example 1 with JavaInvoker

use of es.bsc.compss.nio.worker.executors.util.JavaInvoker in project compss by bsc-wdc.

the class JavaExecutor method executeTask.

@Override
public void executeTask(NIOWorker nw, NIOTask nt, String outputsBasename, File taskSandboxWorkingDir, int[] assignedCoreUnits, int[] assignedGPUs) throws JobExecutionException {
    /* Register outputs **************************************** */
    NIOWorker.registerOutputs(outputsBasename);
    /* TRY TO PROCESS THE TASK ******************************** */
    System.out.println("[JAVA EXECUTOR] executeTask - Begin task execution");
    try {
        MethodType methodType = nt.getMethodType();
        Invoker invoker = null;
        switch(methodType) {
            case METHOD:
                invoker = new JavaInvoker(nw, nt, taskSandboxWorkingDir, assignedCoreUnits);
                break;
            case MPI:
                invoker = new MPIInvoker(nw, nt, taskSandboxWorkingDir, assignedCoreUnits);
                break;
            case DECAF:
                invoker = new DecafInvoker(nw, nt, taskSandboxWorkingDir, assignedCoreUnits);
                break;
            case OMPSS:
                invoker = new OmpSsInvoker(nw, nt, taskSandboxWorkingDir, assignedCoreUnits);
                break;
            case OPENCL:
                invoker = new OpenCLInvoker(nw, nt, taskSandboxWorkingDir, assignedCoreUnits);
                break;
            case BINARY:
                invoker = new BinaryInvoker(nw, nt, taskSandboxWorkingDir, assignedCoreUnits);
                break;
            default:
                throw new JobExecutionException("Unrecognised method type");
        }
        invoker.processTask();
    } catch (JobExecutionException jee) {
        System.out.println("[JAVA EXECUTOR] executeTask - Error in task execution");
        System.err.println("[JAVA EXECUTOR] executeTask - Error in task execution");
        jee.printStackTrace();
        throw jee;
    } finally {
        System.out.println("[JAVA EXECUTOR] executeTask - End task execution");
        NIOWorker.unregisterOutputs();
    }
}
Also used : MethodType(es.bsc.compss.types.implementations.AbstractMethodImplementation.MethodType) OmpSsInvoker(es.bsc.compss.nio.worker.executors.util.OmpSsInvoker) JavaInvoker(es.bsc.compss.nio.worker.executors.util.JavaInvoker) JobExecutionException(es.bsc.compss.nio.exceptions.JobExecutionException) Invoker(es.bsc.compss.nio.worker.executors.util.Invoker) BinaryInvoker(es.bsc.compss.nio.worker.executors.util.BinaryInvoker) OpenCLInvoker(es.bsc.compss.nio.worker.executors.util.OpenCLInvoker) OmpSsInvoker(es.bsc.compss.nio.worker.executors.util.OmpSsInvoker) DecafInvoker(es.bsc.compss.nio.worker.executors.util.DecafInvoker) MPIInvoker(es.bsc.compss.nio.worker.executors.util.MPIInvoker) JavaInvoker(es.bsc.compss.nio.worker.executors.util.JavaInvoker) DecafInvoker(es.bsc.compss.nio.worker.executors.util.DecafInvoker) OpenCLInvoker(es.bsc.compss.nio.worker.executors.util.OpenCLInvoker) MPIInvoker(es.bsc.compss.nio.worker.executors.util.MPIInvoker) BinaryInvoker(es.bsc.compss.nio.worker.executors.util.BinaryInvoker)

Aggregations

JobExecutionException (es.bsc.compss.nio.exceptions.JobExecutionException)1 BinaryInvoker (es.bsc.compss.nio.worker.executors.util.BinaryInvoker)1 DecafInvoker (es.bsc.compss.nio.worker.executors.util.DecafInvoker)1 Invoker (es.bsc.compss.nio.worker.executors.util.Invoker)1 JavaInvoker (es.bsc.compss.nio.worker.executors.util.JavaInvoker)1 MPIInvoker (es.bsc.compss.nio.worker.executors.util.MPIInvoker)1 OmpSsInvoker (es.bsc.compss.nio.worker.executors.util.OmpSsInvoker)1 OpenCLInvoker (es.bsc.compss.nio.worker.executors.util.OpenCLInvoker)1 MethodType (es.bsc.compss.types.implementations.AbstractMethodImplementation.MethodType)1