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();
}
}
Aggregations