private ExecutionContext executeUsingSimplifiedCompilationChain(String dmlScriptFilePath,boolean isFile,Map<String,String> argVals,boolean parsePyDML,String[] inputs,String[] outputs,LocalVariableMap inputSymbolTable,String configFilePath) throws IOException, DMLException {
  DMLConfig config=(configFilePath == null) ? new DMLConfig() : new DMLConfig(configFilePath);
  for (  Entry<String,String> param : _additionalConfigs.entrySet()) {
    config.setTextValue(param.getKey(),param.getValue());
  }
  ConfigurationManager.setGlobalConfig(config);
  CompilerConfig cconf=new CompilerConfig();
  cconf.set(ConfigType.IGNORE_UNSPECIFIED_ARGS,true);
  cconf.set(ConfigType.REJECT_READ_WRITE_UNKNOWNS,false);
  cconf.set(ConfigType.ALLOW_CSE_PERSISTENT_READS,false);
  ConfigurationManager.setGlobalConfig(cconf);
  String dmlScriptStr=DMLScript.readDMLScript(isFile ? "-f" : "-s",dmlScriptFilePath);
  if (_monitorUtils != null) {
    _monitorUtils.setDMLString(dmlScriptStr);
  }
  _rtprog=null;
  AParserWrapper parser=AParserWrapper.createParser(parsePyDML);
  DMLProgram prog;
  if (isFile) {
    prog=parser.parse(dmlScriptFilePath,null,argVals);
  }
 else {
    prog=parser.parse(null,dmlScriptStr,argVals);
  }
  DMLTranslator dmlt=new DMLTranslator(prog);
  dmlt.liveVariableAnalysis(prog);
  dmlt.validateParseTree(prog);
  dmlt.constructHops(prog);
  dmlt.rewriteHopsDAG(prog);
  Explain.explain(prog);
  if (inputSymbolTable != null) {
    RewriteRemovePersistentReadWrite rewrite=new RewriteRemovePersistentReadWrite(inputs,outputs,inputSymbolTable);
    ProgramRewriter rewriter2=new ProgramRewriter(rewrite);
    rewriter2.rewriteProgramHopDAGs(prog);
  }
  dmlt.constructLops(prog);
  _rtprog=prog.getRuntimeProgram(config);
  if (OptimizerUtils.isOptLevel(OptimizationLevel.O4_GLOBAL_TIME_MEMORY)) {
    _rtprog=GlobalOptimizerWrapper.optimizeProgram(prog,_rtprog);
  }
  ExplainCounts counts=Explain.countDistributedOperations(_rtprog);
  Statistics.resetNoOfCompiledJobs(counts.numJobs);
  DMLScript.initHadoopExecution(config);
  JMLCUtils.cleanupRuntimeProgram(_rtprog,outputs);
  ExecutionContext ec=ExecutionContextFactory.createContext(_rtprog);
  if (inputSymbolTable != null) {
    ec.setVariables(inputSymbolTable);
  }
  _rtprog.execute(ec);
  if (_monitorUtils != null)   _monitorUtils.setExplainOutput(Explain.explain(_rtprog));
  return ec;
}

private ExecutionContext executeUsingSimplifiedCompilationChain ( String dmlScriptFilePath , boolean isFile , Map < String , String > argVals , boolean parsePyDML , String [ ] inputs , String [ ] outputs , LocalVariableMap inputSymbolTable , String configFilePath ) throws IOException , DMLException { DMLConfig config = ( configFilePath == null ) ? new DMLConfig ( ) : new DMLConfig ( configFilePath ) ; for ( Entry < String , String > param : _additionalConfigs . entrySet ( ) ) { config . setTextValue ( param . getKey ( ) , param . getValue ( ) ) ; } ConfigurationManager . setGlobalConfig ( config ) ; CompilerConfig cconf = new CompilerConfig ( ) ; cconf . set ( ConfigType . IGNORE_UNSPECIFIED_ARGS , true ) ; cconf . set ( ConfigType . REJECT_READ_WRITE_UNKNOWNS , false ) ; cconf . set ( ConfigType . ALLOW_CSE_PERSISTENT_READS , false ) ; ConfigurationManager . setGlobalConfig ( cconf ) ; String dmlScriptStr = DMLScript . readDMLScript ( isFile ? "-f" : "-s" , dmlScriptFilePath ) ; if ( _monitorUtils != null ) { _monitorUtils . setDMLString ( dmlScriptStr ) ; } _rtprog = null ; AParserWrapper parser = AParserWrapper . createParser ( parsePyDML ) ; DMLProgram prog ; if ( isFile ) { prog = parser . parse ( dmlScriptFilePath , null , argVals ) ; } else { prog = parser . parse ( null , dmlScriptStr , argVals ) ; } DMLTranslator dmlt = new DMLTranslator ( prog ) ; dmlt . liveVariableAnalysis ( prog ) ; dmlt . validateParseTree ( prog ) ; dmlt . constructHops ( prog ) ; dmlt . rewriteHopsDAG ( prog ) ; Explain . explain ( prog ) ; if ( inputSymbolTable != null ) { RewriteRemovePersistentReadWrite rewrite = new RewriteRemovePersistentReadWrite ( inputs , outputs , inputSymbolTable ) ; ProgramRewriter rewriter2 = new ProgramRewriter ( rewrite ) ; rewriter2 . rewriteProgramHopDAGs ( prog ) ; } dmlt . constructLops ( prog ) ; _rtprog = prog . getRuntimeProgram ( config ) ; if ( OptimizerUtils . isOptLevel ( OptimizationLevel . O4_GLOBAL_TIME_MEMORY ) ) { _rtprog = GlobalOptimizerWrapper . optimizeProgram ( prog , _rtprog ) ; } ExplainCounts counts = Explain . countDistributedOperations ( _rtprog ) ; Statistics . resetNoOfCompiledJobs ( counts . numJobs ) ; DMLScript . initHadoopExecution ( config ) ; JMLCUtils . cleanupRuntimeProgram ( _rtprog , outputs ) ; ExecutionContext ec = ExecutionContextFactory . createContext ( _rtprog ) ; if ( inputSymbolTable != null ) { ec . setVariables ( inputSymbolTable ) ; } _rtprog . execute ( ec ) ; if ( _monitorUtils != null ) _monitorUtils . setExplainOutput ( Explain . explain ( _rtprog ) ) ; return ec ; }
this runs the dml script and returns the executioncontext for the caller to extract the output variables . the caller ( which is compileandexecutescript ) is expected to set inputsymboltable with appropriate matrix representation ( rdd , matrixobject ) .
