Search in sources :

Example 1 with CostEstimatorHops

use of org.apache.sysml.runtime.controlprogram.parfor.opt.CostEstimatorHops in project incubator-systemml by apache.

the class ParForProgramBlock method getMinMemory.

private long getMinMemory(ExecutionContext ec) {
    long ret = -1;
    //if forced remote exec and single node
    if (DMLScript.rtplatform == RUNTIME_PLATFORM.SINGLE_NODE && _execMode == PExecMode.REMOTE_MR && _optMode == POptMode.NONE) {
        try {
            ParForStatementBlock sb = (ParForStatementBlock) getStatementBlock();
            OptTree tree = OptTreeConverter.createAbstractOptTree(-1, -1, sb, this, new HashSet<String>(), ec);
            CostEstimator est = new CostEstimatorHops(OptTreeConverter.getAbstractPlanMapping());
            double mem = est.getEstimate(TestMeasure.MEMORY_USAGE, tree.getRoot());
            ret = (long) (mem * (1d / OptimizerUtils.MEM_UTIL_FACTOR));
        } catch (Exception e) {
            LOG.error("Failed to analyze minmum memory requirements.", e);
        }
    }
    return ret;
}
Also used : CostEstimatorHops(org.apache.sysml.runtime.controlprogram.parfor.opt.CostEstimatorHops) OptTree(org.apache.sysml.runtime.controlprogram.parfor.opt.OptTree) CostEstimator(org.apache.sysml.runtime.controlprogram.parfor.opt.CostEstimator) ParForStatementBlock(org.apache.sysml.parser.ParForStatementBlock) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException) IOException(java.io.IOException) CacheException(org.apache.sysml.runtime.controlprogram.caching.CacheException)

Aggregations

IOException (java.io.IOException)1 ParForStatementBlock (org.apache.sysml.parser.ParForStatementBlock)1 DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)1 CacheException (org.apache.sysml.runtime.controlprogram.caching.CacheException)1 CostEstimator (org.apache.sysml.runtime.controlprogram.parfor.opt.CostEstimator)1 CostEstimatorHops (org.apache.sysml.runtime.controlprogram.parfor.opt.CostEstimatorHops)1 OptTree (org.apache.sysml.runtime.controlprogram.parfor.opt.OptTree)1