public static ArrayList<Instruction> createDeepCopyInstructionSet(ArrayList<Instruction> instSet,long pid,int IDPrefix,Program prog,HashSet<String> fnStack,HashSet<String> fnCreated,boolean plain,boolean cpFunctions) throws DMLRuntimeException {
  ArrayList<Instruction> tmp=new ArrayList<Instruction>();
  for (  Instruction inst : instSet) {
    if (inst instanceof FunctionCallCPInstruction && cpFunctions) {
      FunctionCallCPInstruction finst=(FunctionCallCPInstruction)inst;
      createDeepCopyFunctionProgramBlock(finst.getNamespace(),finst.getFunctionName(),pid,IDPrefix,prog,fnStack,fnCreated,plain);
    }
    tmp.add(cloneInstruction(inst,pid,plain,cpFunctions));
  }
  return tmp;
}

public static ArrayList < Instruction > createDeepCopyInstructionSet ( ArrayList < Instruction > instSet , long pid , int IDPrefix , Program prog , HashSet < String > fnStack , HashSet < String > fnCreated , boolean plain , boolean cpFunctions ) throws DMLRuntimeException { ArrayList < Instruction > tmp = new ArrayList < Instruction > ( ) ; for ( Instruction inst : instSet ) { if ( inst instanceof FunctionCallCPInstruction && cpFunctions ) { FunctionCallCPInstruction finst = ( FunctionCallCPInstruction ) inst ; createDeepCopyFunctionProgramBlock ( finst . getNamespace ( ) , finst . getFunctionName ( ) , pid , IDPrefix , prog , fnStack , fnCreated , plain ) ; } tmp . add ( cloneInstruction ( inst , pid , plain , cpFunctions ) ) ; } return tmp ; }
creates a deep copy of an array of instructions and replaces the placeholders of parworker ids with the concrete ids of this parfor instance . this is a helper method uses for generating deep copies of program blocks .
