Search in sources :

Example 6 with COVOperator

use of org.apache.sysml.runtime.matrix.operators.COVOperator in project incubator-systemml by apache.

the class CMCOVMRMapper method configure.

@Override
public void configure(JobConf job) {
    super.configure(job);
    try {
        CM_N_COVInstruction[] cmIns = MRJobConfiguration.getCM_N_COVInstructions(job);
        for (CM_N_COVInstruction ins : cmIns) {
            if (ins.getOperator() instanceof COVOperator)
                covTags.add(ins.input);
            else // CMOperator
            {
                cmTags.add(ins.input);
                cmFn.put(ins.input, CM.getCMFnObject(((CMOperator) ins.getOperator()).getAggOpType()));
            }
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    for (byte tag : cmTags) {
        cmNcovCache.holdPlace(tag, CM_N_COVCell.class);
    }
    for (byte tag : covTags) {
        cmNcovCache.holdPlace(tag, CM_N_COVCell.class);
    }
}
Also used : CM_N_COVInstruction(org.apache.sysml.runtime.instructions.mr.CM_N_COVInstruction) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException) COVOperator(org.apache.sysml.runtime.matrix.operators.COVOperator) CMOperator(org.apache.sysml.runtime.matrix.operators.CMOperator) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException) IOException(java.io.IOException)

Example 7 with COVOperator

use of org.apache.sysml.runtime.matrix.operators.COVOperator in project incubator-systemml by apache.

the class CMCOVMRReducer method configure.

@Override
public void configure(JobConf job) {
    super.configure(job);
    try {
        cmNcovInstructions = MRJobConfiguration.getCM_N_COVInstructions(job);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    rlens = new HashMap<>();
    clens = new HashMap<>();
    for (CM_N_COVInstruction ins : cmNcovInstructions) {
        if (ins.getOperator() instanceof COVOperator)
            covTags.add(ins.input);
        else
            // CMOperator
            cmFn.put(ins.input, CM.getCMFnObject(((CMOperator) ins.getOperator()).getAggOpType()));
        outputIndexesMapping.put(ins.output, getOutputIndexes(ins.output));
        rlens.put(ins.input, MRJobConfiguration.getNumRows(job, ins.input));
        clens.put(ins.input, MRJobConfiguration.getNumColumns(job, ins.input));
    }
    zeroObj = new CM_COV_Object();
    zeroObj.w = 1;
}
Also used : CM_N_COVInstruction(org.apache.sysml.runtime.instructions.mr.CM_N_COVInstruction) CM_COV_Object(org.apache.sysml.runtime.instructions.cp.CM_COV_Object) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException) COVOperator(org.apache.sysml.runtime.matrix.operators.COVOperator) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException) IOException(java.io.IOException)

Aggregations

COVOperator (org.apache.sysml.runtime.matrix.operators.COVOperator)7 DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)5 IOException (java.io.IOException)2 CM_COV_Object (org.apache.sysml.runtime.instructions.cp.CM_COV_Object)2 CM_N_COVInstruction (org.apache.sysml.runtime.instructions.mr.CM_N_COVInstruction)2 MatrixBlock (org.apache.sysml.runtime.matrix.data.MatrixBlock)2 CMOperator (org.apache.sysml.runtime.matrix.operators.CMOperator)2 SparkExecutionContext (org.apache.sysml.runtime.controlprogram.context.SparkExecutionContext)1 CPOperand (org.apache.sysml.runtime.instructions.cp.CPOperand)1 DoubleObject (org.apache.sysml.runtime.instructions.cp.DoubleObject)1 MatrixIndexes (org.apache.sysml.runtime.matrix.data.MatrixIndexes)1 AggregateOperationTypes (org.apache.sysml.runtime.matrix.operators.CMOperator.AggregateOperationTypes)1