Search in sources :

Example 6 with ExternalFunctionInvocationInstruction

use of org.apache.sysml.udf.ExternalFunctionInvocationInstruction in project incubator-systemml by apache.

the class ExternalFunctionProgramBlockCP method execute.

/**
	 * Method to be invoked to execute instructions for the external function
	 * invocation
	 */
@Override
public void execute(ExecutionContext ec) throws DMLRuntimeException {
    _runID = _idSeq.getNextID();
    ExternalFunctionInvocationInstruction inst = null;
    // execute package function
    for (int i = 0; i < _inst.size(); i++) {
        try {
            inst = (ExternalFunctionInvocationInstruction) _inst.get(i);
            inst._namespace = _namespace;
            inst._functionName = _functionName;
            executeInstruction(ec, inst);
        } catch (Exception e) {
            throw new DMLRuntimeException(this.printBlockErrorLocation() + "Error evaluating instruction " + i + " in external function programBlock. inst: " + inst.toString(), e);
        }
    }
    // check return values
    checkOutputParameters(ec.getVariables());
}
Also used : ExternalFunctionInvocationInstruction(org.apache.sysml.udf.ExternalFunctionInvocationInstruction) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException)

Aggregations

DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)6 ExternalFunctionInvocationInstruction (org.apache.sysml.udf.ExternalFunctionInvocationInstruction)6 Instruction (org.apache.sysml.runtime.instructions.Instruction)3 MRJobInstruction (org.apache.sysml.runtime.instructions.MRJobInstruction)3 VariableCPInstruction (org.apache.sysml.runtime.instructions.cp.VariableCPInstruction)3 PackageFunction (org.apache.sysml.udf.PackageFunction)3 CPOperand (org.apache.sysml.runtime.instructions.cp.CPOperand)2 ArrayList (java.util.ArrayList)1 DataIdentifier (org.apache.sysml.parser.DataIdentifier)1 CacheException (org.apache.sysml.runtime.controlprogram.caching.CacheException)1 MatrixObject (org.apache.sysml.runtime.controlprogram.caching.MatrixObject)1 BooleanObject (org.apache.sysml.runtime.instructions.cp.BooleanObject)1 CPInstruction (org.apache.sysml.runtime.instructions.cp.CPInstruction)1 Data (org.apache.sysml.runtime.instructions.cp.Data)1 DoubleObject (org.apache.sysml.runtime.instructions.cp.DoubleObject)1 FunctionCallCPInstruction (org.apache.sysml.runtime.instructions.cp.FunctionCallCPInstruction)1 IntObject (org.apache.sysml.runtime.instructions.cp.IntObject)1 ScalarObject (org.apache.sysml.runtime.instructions.cp.ScalarObject)1 SpoofCPInstruction (org.apache.sysml.runtime.instructions.cp.SpoofCPInstruction)1 StringObject (org.apache.sysml.runtime.instructions.cp.StringObject)1