use of es.bsc.compss.types.implementations.AbstractMethodImplementation.MethodType 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();
}
}
use of es.bsc.compss.types.implementations.AbstractMethodImplementation.MethodType in project compss by bsc-wdc.
the class COMPSsRuntimeImpl method registerCoreElement.
/**
* Registers a new CoreElement in the COMPSs Runtime
*/
@Override
public void registerCoreElement(String coreElementSignature, String implSignature, String implConstraints, String implType, String... implTypeArgs) {
LOGGER.info("Registering CoreElement " + coreElementSignature);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("\t - Implementation: " + implSignature);
LOGGER.debug("\t - Constraints : " + implConstraints);
LOGGER.debug("\t - Type : " + implType);
LOGGER.debug("\t - ImplTypeArgs : ");
for (String implTypeArg : implTypeArgs) {
LOGGER.debug("\t\t Arg: " + implTypeArg);
}
}
MethodResourceDescription mrd = new MethodResourceDescription(implConstraints);
MethodType mt;
switch(implType) {
case "METHOD":
mt = MethodType.METHOD;
break;
case "MPI":
mt = MethodType.MPI;
break;
case "DECAF":
mt = MethodType.DECAF;
break;
case "BINARY":
mt = MethodType.BINARY;
break;
case "OMPSS":
mt = MethodType.OMPSS;
break;
case "OPENCL":
mt = MethodType.OPENCL;
break;
default:
ErrorManager.error("Unrecognised method type " + implType);
return;
}
td.registerNewCoreElement(coreElementSignature, implSignature, mrd, mt, implTypeArgs);
}
Aggregations