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;
}
Aggregations