Search in sources :

Example 6 with ForProgramBlock

use of org.apache.sysml.runtime.controlprogram.ForProgramBlock in project incubator-systemml by apache.

the class SpoofCompiler method generateCodeFromProgramBlock.

public static void generateCodeFromProgramBlock(ProgramBlock current) {
    if (current instanceof FunctionProgramBlock) {
        FunctionProgramBlock fsb = (FunctionProgramBlock) current;
        for (ProgramBlock pb : fsb.getChildBlocks()) generateCodeFromProgramBlock(pb);
    } else if (current instanceof WhileProgramBlock) {
        WhileProgramBlock wpb = (WhileProgramBlock) current;
        WhileStatementBlock wsb = (WhileStatementBlock) wpb.getStatementBlock();
        if (wsb != null && wsb.getPredicateHops() != null)
            wpb.setPredicate(generateCodeFromHopDAGsToInst(wsb.getPredicateHops()));
        for (ProgramBlock sb : wpb.getChildBlocks()) generateCodeFromProgramBlock(sb);
    } else if (current instanceof IfProgramBlock) {
        IfProgramBlock ipb = (IfProgramBlock) current;
        IfStatementBlock isb = (IfStatementBlock) ipb.getStatementBlock();
        if (isb != null && isb.getPredicateHops() != null)
            ipb.setPredicate(generateCodeFromHopDAGsToInst(isb.getPredicateHops()));
        for (ProgramBlock pb : ipb.getChildBlocksIfBody()) generateCodeFromProgramBlock(pb);
        for (ProgramBlock pb : ipb.getChildBlocksElseBody()) generateCodeFromProgramBlock(pb);
    } else if (// incl parfor
    current instanceof ForProgramBlock) {
        ForProgramBlock fpb = (ForProgramBlock) current;
        ForStatementBlock fsb = (ForStatementBlock) fpb.getStatementBlock();
        if (fsb != null && fsb.getFromHops() != null)
            fpb.setFromInstructions(generateCodeFromHopDAGsToInst(fsb.getFromHops()));
        if (fsb != null && fsb.getToHops() != null)
            fpb.setToInstructions(generateCodeFromHopDAGsToInst(fsb.getToHops()));
        if (fsb != null && fsb.getIncrementHops() != null)
            fpb.setIncrementInstructions(generateCodeFromHopDAGsToInst(fsb.getIncrementHops()));
        for (ProgramBlock pb : fpb.getChildBlocks()) generateCodeFromProgramBlock(pb);
    } else // generic (last-level)
    {
        StatementBlock sb = current.getStatementBlock();
        current.setInstructions(generateCodeFromHopDAGsToInst(sb, sb.getHops()));
    }
}
Also used : FunctionProgramBlock(org.apache.sysml.runtime.controlprogram.FunctionProgramBlock) IfProgramBlock(org.apache.sysml.runtime.controlprogram.IfProgramBlock) ForStatementBlock(org.apache.sysml.parser.ForStatementBlock) ForProgramBlock(org.apache.sysml.runtime.controlprogram.ForProgramBlock) FunctionProgramBlock(org.apache.sysml.runtime.controlprogram.FunctionProgramBlock) WhileProgramBlock(org.apache.sysml.runtime.controlprogram.WhileProgramBlock) ForProgramBlock(org.apache.sysml.runtime.controlprogram.ForProgramBlock) IfProgramBlock(org.apache.sysml.runtime.controlprogram.IfProgramBlock) ProgramBlock(org.apache.sysml.runtime.controlprogram.ProgramBlock) WhileProgramBlock(org.apache.sysml.runtime.controlprogram.WhileProgramBlock) WhileStatementBlock(org.apache.sysml.parser.WhileStatementBlock) FunctionStatementBlock(org.apache.sysml.parser.FunctionStatementBlock) IfStatementBlock(org.apache.sysml.parser.IfStatementBlock) WhileStatementBlock(org.apache.sysml.parser.WhileStatementBlock) ForStatementBlock(org.apache.sysml.parser.ForStatementBlock) StatementBlock(org.apache.sysml.parser.StatementBlock) IfStatementBlock(org.apache.sysml.parser.IfStatementBlock)

Example 7 with ForProgramBlock

use of org.apache.sysml.runtime.controlprogram.ForProgramBlock in project incubator-systemml by apache.

the class ProgramConverter method rFindSerializationCandidates.

private static void rFindSerializationCandidates(ArrayList<ProgramBlock> pbs, HashSet<String> cand) {
    for (ProgramBlock pb : pbs) {
        if (pb instanceof WhileProgramBlock) {
            WhileProgramBlock wpb = (WhileProgramBlock) pb;
            rFindSerializationCandidates(wpb.getChildBlocks(), cand);
        } else if (pb instanceof ForProgramBlock || pb instanceof ParForProgramBlock) {
            ForProgramBlock fpb = (ForProgramBlock) pb;
            rFindSerializationCandidates(fpb.getChildBlocks(), cand);
        } else if (pb instanceof IfProgramBlock) {
            IfProgramBlock ipb = (IfProgramBlock) pb;
            rFindSerializationCandidates(ipb.getChildBlocksIfBody(), cand);
            if (ipb.getChildBlocksElseBody() != null)
                rFindSerializationCandidates(ipb.getChildBlocksElseBody(), cand);
        } else // all generic program blocks
        {
            for (Instruction inst : pb.getInstructions()) if (inst instanceof FunctionCallCPInstruction) {
                FunctionCallCPInstruction fci = (FunctionCallCPInstruction) inst;
                String fkey = DMLProgram.constructFunctionKey(fci.getNamespace(), fci.getFunctionName());
                if (// memoization for multiple calls, recursion
                !cand.contains(fkey)) {
                    // add to candidates
                    cand.add(fkey);
                    // investigate chains of function calls
                    FunctionProgramBlock fpb = pb.getProgram().getFunctionProgramBlock(fci.getNamespace(), fci.getFunctionName());
                    rFindSerializationCandidates(fpb.getChildBlocks(), cand);
                }
            }
        }
    }
}
Also used : IfProgramBlock(org.apache.sysml.runtime.controlprogram.IfProgramBlock) FunctionProgramBlock(org.apache.sysml.runtime.controlprogram.FunctionProgramBlock) ExternalFunctionProgramBlock(org.apache.sysml.runtime.controlprogram.ExternalFunctionProgramBlock) FunctionCallCPInstruction(org.apache.sysml.runtime.instructions.cp.FunctionCallCPInstruction) ForProgramBlock(org.apache.sysml.runtime.controlprogram.ForProgramBlock) ParForProgramBlock(org.apache.sysml.runtime.controlprogram.ParForProgramBlock) FunctionProgramBlock(org.apache.sysml.runtime.controlprogram.FunctionProgramBlock) WhileProgramBlock(org.apache.sysml.runtime.controlprogram.WhileProgramBlock) ExternalFunctionProgramBlock(org.apache.sysml.runtime.controlprogram.ExternalFunctionProgramBlock) ForProgramBlock(org.apache.sysml.runtime.controlprogram.ForProgramBlock) IfProgramBlock(org.apache.sysml.runtime.controlprogram.IfProgramBlock) ProgramBlock(org.apache.sysml.runtime.controlprogram.ProgramBlock) ParForProgramBlock(org.apache.sysml.runtime.controlprogram.ParForProgramBlock) WhileProgramBlock(org.apache.sysml.runtime.controlprogram.WhileProgramBlock) GPUInstruction(org.apache.sysml.runtime.instructions.gpu.GPUInstruction) MRJobInstruction(org.apache.sysml.runtime.instructions.MRJobInstruction) CPInstruction(org.apache.sysml.runtime.instructions.cp.CPInstruction) ExternalFunctionInvocationInstruction(org.apache.sysml.udf.ExternalFunctionInvocationInstruction) SpoofCPInstruction(org.apache.sysml.runtime.instructions.cp.SpoofCPInstruction) Instruction(org.apache.sysml.runtime.instructions.Instruction) SPInstruction(org.apache.sysml.runtime.instructions.spark.SPInstruction) VariableCPInstruction(org.apache.sysml.runtime.instructions.cp.VariableCPInstruction) FunctionCallCPInstruction(org.apache.sysml.runtime.instructions.cp.FunctionCallCPInstruction) MRInstruction(org.apache.sysml.runtime.instructions.mr.MRInstruction) ParForProgramBlock(org.apache.sysml.runtime.controlprogram.ParForProgramBlock)

Example 8 with ForProgramBlock

use of org.apache.sysml.runtime.controlprogram.ForProgramBlock in project incubator-systemml by apache.

the class ProgramConverter method rSerializeProgramBlock.

private static String rSerializeProgramBlock(ProgramBlock pb, HashMap<String, byte[]> clsMap) {
    StringBuilder sb = new StringBuilder();
    // handle header
    if (pb instanceof WhileProgramBlock)
        sb.append(PARFOR_PB_WHILE);
    else if (pb instanceof ForProgramBlock && !(pb instanceof ParForProgramBlock))
        sb.append(PARFOR_PB_FOR);
    else if (pb instanceof ParForProgramBlock)
        sb.append(PARFOR_PB_PARFOR);
    else if (pb instanceof IfProgramBlock)
        sb.append(PARFOR_PB_IF);
    else if (pb instanceof FunctionProgramBlock && !(pb instanceof ExternalFunctionProgramBlock))
        sb.append(PARFOR_PB_FC);
    else if (pb instanceof ExternalFunctionProgramBlock)
        sb.append(PARFOR_PB_EFC);
    else
        // all generic program blocks
        sb.append(PARFOR_PB_BEGIN);
    // handle body
    if (pb instanceof WhileProgramBlock) {
        WhileProgramBlock wpb = (WhileProgramBlock) pb;
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(wpb.getPredicate(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(wpb.getExitInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_PBS_BEGIN);
        sb.append(rSerializeProgramBlocks(wpb.getChildBlocks(), clsMap));
        sb.append(PARFOR_PBS_END);
    } else if (pb instanceof ForProgramBlock && !(pb instanceof ParForProgramBlock)) {
        ForProgramBlock fpb = (ForProgramBlock) pb;
        sb.append(fpb.getIterVar());
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(fpb.getFromInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(fpb.getToInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(fpb.getIncrementInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(fpb.getExitInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_PBS_BEGIN);
        sb.append(rSerializeProgramBlocks(fpb.getChildBlocks(), clsMap));
        sb.append(PARFOR_PBS_END);
    } else if (pb instanceof ParForProgramBlock) {
        ParForProgramBlock pfpb = (ParForProgramBlock) pb;
        // check for nested remote ParFOR
        if (PExecMode.valueOf(pfpb.getParForParams().get(ParForStatementBlock.EXEC_MODE)) == PExecMode.REMOTE_MR)
            throw new DMLRuntimeException(NOT_SUPPORTED_MR_PARFOR);
        sb.append(pfpb.getIterVar());
        sb.append(COMPONENTS_DELIM);
        sb.append(serializeResultVariables(pfpb.getResultVariables()));
        sb.append(COMPONENTS_DELIM);
        // parameters of nested parfor
        sb.append(serializeStringHashMap(pfpb.getParForParams()));
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(pfpb.getFromInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(pfpb.getToInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(pfpb.getIncrementInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(pfpb.getExitInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_PBS_BEGIN);
        sb.append(rSerializeProgramBlocks(pfpb.getChildBlocks(), clsMap));
        sb.append(PARFOR_PBS_END);
    } else if (pb instanceof IfProgramBlock) {
        IfProgramBlock ipb = (IfProgramBlock) pb;
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(ipb.getPredicate(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(ipb.getExitInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_PBS_BEGIN);
        sb.append(rSerializeProgramBlocks(ipb.getChildBlocksIfBody(), clsMap));
        sb.append(PARFOR_PBS_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_PBS_BEGIN);
        sb.append(rSerializeProgramBlocks(ipb.getChildBlocksElseBody(), clsMap));
        sb.append(PARFOR_PBS_END);
    } else if (pb instanceof FunctionProgramBlock && !(pb instanceof ExternalFunctionProgramBlock)) {
        FunctionProgramBlock fpb = (FunctionProgramBlock) pb;
        sb.append(serializeDataIdentifiers(fpb.getInputParams()));
        sb.append(COMPONENTS_DELIM);
        sb.append(serializeDataIdentifiers(fpb.getOutputParams()));
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(fpb.getInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_PBS_BEGIN);
        sb.append(rSerializeProgramBlocks(fpb.getChildBlocks(), clsMap));
        sb.append(PARFOR_PBS_END);
        sb.append(COMPONENTS_DELIM);
    } else if (pb instanceof ExternalFunctionProgramBlock) {
        if (!(pb instanceof ExternalFunctionProgramBlockCP)) {
            throw new DMLRuntimeException(NOT_SUPPORTED_EXTERNALFUNCTION_PB);
        }
        ExternalFunctionProgramBlockCP fpb = (ExternalFunctionProgramBlockCP) pb;
        sb.append(serializeDataIdentifiers(fpb.getInputParams()));
        sb.append(COMPONENTS_DELIM);
        sb.append(serializeDataIdentifiers(fpb.getOutputParams()));
        sb.append(COMPONENTS_DELIM);
        sb.append(serializeStringHashMap(fpb.getOtherParams()));
        sb.append(COMPONENTS_DELIM);
        sb.append(fpb.getBaseDir());
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_INST_BEGIN);
        // create on construction anyway
        sb.append(PARFOR_INST_END);
        sb.append(COMPONENTS_DELIM);
        sb.append(PARFOR_PBS_BEGIN);
        sb.append(rSerializeProgramBlocks(fpb.getChildBlocks(), clsMap));
        sb.append(PARFOR_PBS_END);
    } else // all generic program blocks
    {
        sb.append(PARFOR_INST_BEGIN);
        sb.append(serializeInstructions(pb.getInstructions(), clsMap));
        sb.append(PARFOR_INST_END);
    }
    // handle end
    sb.append(PARFOR_PB_END);
    return sb.toString();
}
Also used : IfProgramBlock(org.apache.sysml.runtime.controlprogram.IfProgramBlock) FunctionProgramBlock(org.apache.sysml.runtime.controlprogram.FunctionProgramBlock) ExternalFunctionProgramBlock(org.apache.sysml.runtime.controlprogram.ExternalFunctionProgramBlock) ForProgramBlock(org.apache.sysml.runtime.controlprogram.ForProgramBlock) ParForProgramBlock(org.apache.sysml.runtime.controlprogram.ParForProgramBlock) ExternalFunctionProgramBlock(org.apache.sysml.runtime.controlprogram.ExternalFunctionProgramBlock) WhileProgramBlock(org.apache.sysml.runtime.controlprogram.WhileProgramBlock) ExternalFunctionProgramBlockCP(org.apache.sysml.runtime.controlprogram.ExternalFunctionProgramBlockCP) ParForProgramBlock(org.apache.sysml.runtime.controlprogram.ParForProgramBlock) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException)

Example 9 with ForProgramBlock

use of org.apache.sysml.runtime.controlprogram.ForProgramBlock in project incubator-systemml by apache.

the class OptTreeConverter method rCreateOptNode.

public static OptNode rCreateOptNode(ProgramBlock pb, LocalVariableMap vars, boolean topLevel, boolean storeObjs) {
    OptNode node = null;
    if (pb instanceof IfProgramBlock) {
        IfProgramBlock ipb = (IfProgramBlock) pb;
        node = new OptNode(NodeType.IF);
        if (storeObjs)
            _rtMap.putMapping(ipb, node);
        node.setExecType(ExecType.CP);
        // process if condition
        OptNode ifn = new OptNode(NodeType.GENERIC);
        node.addChilds(createOptNodes(ipb.getPredicate(), vars, storeObjs));
        node.addChild(ifn);
        for (ProgramBlock lpb : ipb.getChildBlocksIfBody()) ifn.addChild(rCreateOptNode(lpb, vars, topLevel, storeObjs));
        // process else condition
        if (ipb.getChildBlocksElseBody() != null && ipb.getChildBlocksElseBody().size() > 0) {
            OptNode efn = new OptNode(NodeType.GENERIC);
            node.addChild(efn);
            for (ProgramBlock lpb : ipb.getChildBlocksElseBody()) efn.addChild(rCreateOptNode(lpb, vars, topLevel, storeObjs));
        }
    } else if (pb instanceof WhileProgramBlock) {
        WhileProgramBlock wpb = (WhileProgramBlock) pb;
        node = new OptNode(NodeType.WHILE);
        if (storeObjs)
            _rtMap.putMapping(wpb, node);
        node.setExecType(ExecType.CP);
        // process predicate instruction
        node.addChilds(createOptNodes(wpb.getPredicate(), vars, storeObjs));
        // process body
        for (ProgramBlock lpb : wpb.getChildBlocks()) node.addChild(rCreateOptNode(lpb, vars, topLevel, storeObjs));
    } else if (pb instanceof ForProgramBlock && !(pb instanceof ParForProgramBlock)) {
        ForProgramBlock fpb = (ForProgramBlock) pb;
        node = new OptNode(NodeType.FOR);
        if (storeObjs)
            _rtMap.putMapping(fpb, node);
        node.setExecType(ExecType.CP);
        // determine number of iterations
        long N = OptimizerUtils.getNumIterations(fpb, vars, CostEstimator.FACTOR_NUM_ITERATIONS);
        node.addParam(ParamType.NUM_ITERATIONS, String.valueOf(N));
        node.addChilds(createOptNodes(fpb.getFromInstructions(), vars, storeObjs));
        node.addChilds(createOptNodes(fpb.getToInstructions(), vars, storeObjs));
        node.addChilds(createOptNodes(fpb.getIncrementInstructions(), vars, storeObjs));
        // process body
        for (ProgramBlock lpb : fpb.getChildBlocks()) node.addChild(rCreateOptNode(lpb, vars, topLevel, storeObjs));
    } else if (pb instanceof ParForProgramBlock) {
        ParForProgramBlock fpb = (ParForProgramBlock) pb;
        node = new OptNode(NodeType.PARFOR);
        if (storeObjs)
            _rtMap.putMapping(fpb, node);
        node.setK(fpb.getDegreeOfParallelism());
        long N = fpb.getNumIterations();
        node.addParam(ParamType.NUM_ITERATIONS, (N != -1) ? String.valueOf(N) : String.valueOf(CostEstimator.FACTOR_NUM_ITERATIONS));
        switch(fpb.getExecMode()) {
            case LOCAL:
                node.setExecType(ExecType.CP);
                break;
            case REMOTE_MR:
            case REMOTE_MR_DP:
                node.setExecType(ExecType.MR);
                break;
            case REMOTE_SPARK:
            case REMOTE_SPARK_DP:
                node.setExecType(ExecType.SPARK);
                break;
            default:
                node.setExecType(null);
        }
        if (!topLevel) {
            node.addChilds(createOptNodes(fpb.getFromInstructions(), vars, storeObjs));
            node.addChilds(createOptNodes(fpb.getToInstructions(), vars, storeObjs));
            node.addChilds(createOptNodes(fpb.getIncrementInstructions(), vars, storeObjs));
        }
        // process body
        for (ProgramBlock lpb : fpb.getChildBlocks()) node.addChild(rCreateOptNode(lpb, vars, false, storeObjs));
    // parameters, add required parameters
    } else // last level program block
    {
        node = new OptNode(NodeType.GENERIC);
        if (storeObjs)
            _rtMap.putMapping(pb, node);
        node.addChilds(createOptNodes(pb.getInstructions(), vars, storeObjs));
        node.setExecType(ExecType.CP);
    }
    return node;
}
Also used : IfProgramBlock(org.apache.sysml.runtime.controlprogram.IfProgramBlock) ForProgramBlock(org.apache.sysml.runtime.controlprogram.ForProgramBlock) ParForProgramBlock(org.apache.sysml.runtime.controlprogram.ParForProgramBlock) ForProgramBlock(org.apache.sysml.runtime.controlprogram.ForProgramBlock) IfProgramBlock(org.apache.sysml.runtime.controlprogram.IfProgramBlock) FunctionProgramBlock(org.apache.sysml.runtime.controlprogram.FunctionProgramBlock) ProgramBlock(org.apache.sysml.runtime.controlprogram.ProgramBlock) WhileProgramBlock(org.apache.sysml.runtime.controlprogram.WhileProgramBlock) ParForProgramBlock(org.apache.sysml.runtime.controlprogram.ParForProgramBlock) WhileProgramBlock(org.apache.sysml.runtime.controlprogram.WhileProgramBlock) ParForProgramBlock(org.apache.sysml.runtime.controlprogram.ParForProgramBlock)

Example 10 with ForProgramBlock

use of org.apache.sysml.runtime.controlprogram.ForProgramBlock in project incubator-systemml by apache.

the class OptimizerRuleBased method removeRecursiveParFor.

protected int removeRecursiveParFor(OptNode n, HashSet<ParForProgramBlock> recPBs) {
    int count = 0;
    if (!n.isLeaf()) {
        for (OptNode sub : n.getChilds()) {
            if (sub.getNodeType() == NodeType.PARFOR) {
                long id = sub.getID();
                Object[] progobj = OptTreeConverter.getAbstractPlanMapping().getMappedProg(id);
                ParForStatementBlock pfsb = (ParForStatementBlock) progobj[0];
                ParForProgramBlock pfpb = (ParForProgramBlock) progobj[1];
                if (recPBs.contains(pfpb)) {
                    // create for pb as replacement
                    Program prog = pfpb.getProgram();
                    ForProgramBlock fpb = ProgramConverter.createShallowCopyForProgramBlock(pfpb, prog);
                    // replace parfor with for, and update objectmapping
                    OptTreeConverter.replaceProgramBlock(n, sub, pfpb, fpb, false);
                    // update link to statement block
                    fpb.setStatementBlock(pfsb);
                    // update node
                    sub.setNodeType(NodeType.FOR);
                    sub.setK(1);
                    count++;
                }
            }
            count += removeRecursiveParFor(sub, recPBs);
        }
    }
    return count;
}
Also used : DMLProgram(org.apache.sysml.parser.DMLProgram) Program(org.apache.sysml.runtime.controlprogram.Program) ForProgramBlock(org.apache.sysml.runtime.controlprogram.ForProgramBlock) ParForProgramBlock(org.apache.sysml.runtime.controlprogram.ParForProgramBlock) ParForStatementBlock(org.apache.sysml.parser.ParForStatementBlock) MatrixObject(org.apache.sysml.runtime.controlprogram.caching.MatrixObject) RDDObject(org.apache.sysml.runtime.instructions.spark.data.RDDObject) ParForProgramBlock(org.apache.sysml.runtime.controlprogram.ParForProgramBlock)

Aggregations

ForProgramBlock (org.apache.sysml.runtime.controlprogram.ForProgramBlock)69 IfProgramBlock (org.apache.sysml.runtime.controlprogram.IfProgramBlock)61 WhileProgramBlock (org.apache.sysml.runtime.controlprogram.WhileProgramBlock)61 FunctionProgramBlock (org.apache.sysml.runtime.controlprogram.FunctionProgramBlock)53 ProgramBlock (org.apache.sysml.runtime.controlprogram.ProgramBlock)47 ParForProgramBlock (org.apache.sysml.runtime.controlprogram.ParForProgramBlock)43 ForStatementBlock (org.apache.sysml.parser.ForStatementBlock)28 IfStatementBlock (org.apache.sysml.parser.IfStatementBlock)26 StatementBlock (org.apache.sysml.parser.StatementBlock)26 WhileStatementBlock (org.apache.sysml.parser.WhileStatementBlock)26 ExternalFunctionProgramBlock (org.apache.sysml.runtime.controlprogram.ExternalFunctionProgramBlock)22 ArrayList (java.util.ArrayList)21 Instruction (org.apache.sysml.runtime.instructions.Instruction)20 MRJobInstruction (org.apache.sysml.runtime.instructions.MRJobInstruction)12 DMLProgram (org.apache.sysml.parser.DMLProgram)10 ParForStatementBlock (org.apache.sysml.parser.ParForStatementBlock)10 Program (org.apache.sysml.runtime.controlprogram.Program)10 FunctionCallCPInstruction (org.apache.sysml.runtime.instructions.cp.FunctionCallCPInstruction)10 Hop (org.apache.sysml.hops.Hop)9 DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)9