Class ParForProgramBlock
- java.lang.Object
- 
- org.apache.sysds.runtime.controlprogram.ProgramBlock
- 
- org.apache.sysds.runtime.controlprogram.ForProgramBlock
- 
- org.apache.sysds.runtime.controlprogram.ParForProgramBlock
 
 
 
- 
- All Implemented Interfaces:
- ParseInfo
 
 public class ParForProgramBlock extends ForProgramBlock The ParForProgramBlock has the same execution semantics as a ForProgamBlock but executes the independent iterations in parallel. See ParForStatementBlock for the loop dependency analysis. At runtime level, iterations are guaranteed to be completely independent. NEW FUNCTIONALITIES TODO: reduction variables (operations: +=, -=, /=, *=, min, max) TODO: papply(A,1:2,FUN) language construct (compiled to ParFOR) via DML function repository => modules OK, but second-order functions required
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classParForProgramBlock.PartitionFormatConvenience class to package PDataPartitionFormat and its parameters.static classParForProgramBlock.PDataPartitionerstatic classParForProgramBlock.PDataPartitionFormatstatic classParForProgramBlock.PExecModestatic classParForProgramBlock.POptModestatic classParForProgramBlock.PResultMergestatic classParForProgramBlock.PTaskPartitioner
 - 
Field SummaryFields Modifier and Type Field Description static booleanALLOW_BROADCAST_INPUTSstatic booleanALLOW_NESTED_PARALLELISMstatic booleanALLOW_REUSE_PARTITION_VARSstatic booleanCONVERT_NESTED_REMOTE_PARFORstatic booleanCOPY_EVAL_FUNCTIONSstatic booleanCREATE_UNSCOPED_RESULTVARSstatic booleanFORCE_CP_ON_REMOTE_SPARKstatic booleanLIVEVAR_AWARE_EXPORTstatic intMAX_RETRYS_ON_ERRORstatic booleanOPTIMIZEstatic StringPARFOR_COUNTER_GROUP_NAMEstatic StringPARFOR_DATAPARTITIONS_FNAMEstatic StringPARFOR_FNAME_PREFIXstatic StringPARFOR_MR_RESULT_TMP_FNAMEstatic StringPARFOR_MR_RESULTMERGE_FNAMEstatic StringPARFOR_MR_TASKS_TMP_FNAMEstatic booleanRESET_RECOMPILATION_FLAGsstatic booleanUSE_PARALLEL_RESULT_MERGEstatic booleanUSE_PARALLEL_RESULT_MERGE_REMOTEstatic booleanUSE_PB_CACHEstatic booleanUSE_RANGE_TASKS_IF_USEFULstatic booleanUSE_STREAMING_TASK_CREATIONstatic intWRITE_REPLICATION_FACTOR- 
Fields inherited from class org.apache.sysds.runtime.controlprogram.ProgramBlock_beginColumn, _beginLine, _endColumn, _endLine, _filename, _text, PRED_VAR
 
- 
 - 
Constructor SummaryConstructors Constructor Description ParForProgramBlock(int ID, Program prog, String iterPredVar, HashMap<String,String> params, ArrayList<ParForStatementBlock.ResultVar> resultVars)ParForProgramBlock constructor.ParForProgramBlock(Program prog, String iterPredVar, HashMap<String,String> params, ArrayList<ParForStatementBlock.ResultVar> resultVars)
 - 
Method Summary- 
Methods inherited from class org.apache.sysds.runtime.controlprogram.ForProgramBlockaddProgramBlock, getChildBlocks, getFromInstructions, getIncrementInstructions, getIterVar, getToInstructions, isNested, setChildBlocks, setFromInstructions, setIncrementInstructions, setToInstructions
 - 
Methods inherited from class org.apache.sysds.runtime.controlprogram.ProgramBlockexecutePredicate, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getExitInstruction, getFilename, getProgram, getStatementBlock, getText, getThreadID, hasThreadID, isThreadID, setBeginColumn, setBeginLine, setEndColumn, setEndLine, setExitInstruction, setFilename, setParseInfo, setProgram, setStatementBlock, setText, setThreadID
 
- 
 
- 
- 
- 
Field Detail- 
OPTIMIZEpublic static final boolean OPTIMIZE - See Also:
- Constant Field Values
 
 - 
USE_PB_CACHEpublic static final boolean USE_PB_CACHE - See Also:
- Constant Field Values
 
 - 
USE_RANGE_TASKS_IF_USEFULpublic static final boolean USE_RANGE_TASKS_IF_USEFUL - See Also:
- Constant Field Values
 
 - 
USE_STREAMING_TASK_CREATIONpublic static final boolean USE_STREAMING_TASK_CREATION - See Also:
- Constant Field Values
 
 - 
ALLOW_NESTED_PARALLELISMpublic static final boolean ALLOW_NESTED_PARALLELISM - See Also:
- Constant Field Values
 
 - 
CONVERT_NESTED_REMOTE_PARFORpublic static final boolean CONVERT_NESTED_REMOTE_PARFOR - See Also:
- Constant Field Values
 
 - 
USE_PARALLEL_RESULT_MERGEpublic static final boolean USE_PARALLEL_RESULT_MERGE - See Also:
- Constant Field Values
 
 - 
USE_PARALLEL_RESULT_MERGE_REMOTEpublic static final boolean USE_PARALLEL_RESULT_MERGE_REMOTE - See Also:
- Constant Field Values
 
 - 
CREATE_UNSCOPED_RESULTVARSpublic static final boolean CREATE_UNSCOPED_RESULTVARS - See Also:
- Constant Field Values
 
 - 
ALLOW_REUSE_PARTITION_VARSpublic static boolean ALLOW_REUSE_PARTITION_VARS 
 - 
WRITE_REPLICATION_FACTORpublic static final int WRITE_REPLICATION_FACTOR - See Also:
- Constant Field Values
 
 - 
MAX_RETRYS_ON_ERRORpublic static int MAX_RETRYS_ON_ERROR 
 - 
FORCE_CP_ON_REMOTE_SPARKpublic static final boolean FORCE_CP_ON_REMOTE_SPARK - See Also:
- Constant Field Values
 
 - 
LIVEVAR_AWARE_EXPORTpublic static final boolean LIVEVAR_AWARE_EXPORT - See Also:
- Constant Field Values
 
 - 
RESET_RECOMPILATION_FLAGspublic static final boolean RESET_RECOMPILATION_FLAGs - See Also:
- Constant Field Values
 
 - 
ALLOW_BROADCAST_INPUTSpublic static boolean ALLOW_BROADCAST_INPUTS 
 - 
COPY_EVAL_FUNCTIONSpublic static final boolean COPY_EVAL_FUNCTIONS - See Also:
- Constant Field Values
 
 - 
PARFOR_FNAME_PREFIXpublic static final String PARFOR_FNAME_PREFIX - See Also:
- Constant Field Values
 
 - 
PARFOR_MR_TASKS_TMP_FNAMEpublic static final String PARFOR_MR_TASKS_TMP_FNAME - See Also:
- Constant Field Values
 
 - 
PARFOR_MR_RESULT_TMP_FNAMEpublic static final String PARFOR_MR_RESULT_TMP_FNAME - See Also:
- Constant Field Values
 
 - 
PARFOR_MR_RESULTMERGE_FNAMEpublic static final String PARFOR_MR_RESULTMERGE_FNAME - See Also:
- Constant Field Values
 
 - 
PARFOR_DATAPARTITIONS_FNAMEpublic static final String PARFOR_DATAPARTITIONS_FNAME - See Also:
- Constant Field Values
 
 - 
PARFOR_COUNTER_GROUP_NAMEpublic static final String PARFOR_COUNTER_GROUP_NAME - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ParForProgramBlockpublic ParForProgramBlock(Program prog, String iterPredVar, HashMap<String,String> params, ArrayList<ParForStatementBlock.ResultVar> resultVars) 
 - 
ParForProgramBlockpublic ParForProgramBlock(int ID, Program prog, String iterPredVar, HashMap<String,String> params, ArrayList<ParForStatementBlock.ResultVar> resultVars)ParForProgramBlock constructor. It reads the specified parameter settings, where defaults for non-specified parameters have been set in ParForStatementBlock.validate(). Furthermore, it generates the IDs for the ParWorkers.- Parameters:
- ID- parfor program block id
- prog- runtime program
- iterPredVar- ?
- params- map of parameters
- resultVars- list of result variable names
 
 
- 
 - 
Method Detail- 
resetWorkerIDspublic static void resetWorkerIDs() 
 - 
getIDpublic long getID() 
 - 
getExecModepublic ParForProgramBlock.PExecMode getExecMode() 
 - 
getResultVariablespublic ArrayList<ParForStatementBlock.ResultVar> getResultVariables() 
 - 
disableOptimizationpublic void disableOptimization() 
 - 
getOptimizationModepublic ParForProgramBlock.POptMode getOptimizationMode() 
 - 
setOptimizationModepublic void setOptimizationMode(ParForProgramBlock.POptMode mode) 
 - 
getDegreeOfParallelismpublic int getDegreeOfParallelism() 
 - 
setDegreeOfParallelismpublic void setDegreeOfParallelism(int k) 
 - 
isDegreeOfParallelismFixedpublic boolean isDegreeOfParallelismFixed() 
 - 
setDegreeOfParallelismFixedpublic void setDegreeOfParallelismFixed(boolean flag) 
 - 
setCPCachingpublic void setCPCaching(boolean flag) 
 - 
setRuntimePiggybackingpublic void setRuntimePiggybacking(boolean flag) 
 - 
setExecModepublic void setExecMode(ParForProgramBlock.PExecMode mode) 
 - 
setTaskPartitionerpublic void setTaskPartitioner(ParForProgramBlock.PTaskPartitioner partitioner) 
 - 
setTaskSizepublic void setTaskSize(long tasksize) 
 - 
setDataPartitionerpublic void setDataPartitioner(ParForProgramBlock.PDataPartitioner partitioner) 
 - 
enableColocatedPartitionedMatrixpublic void enableColocatedPartitionedMatrix(String varname) 
 - 
setTransposeSparseColumnVectorpublic void setTransposeSparseColumnVector(boolean flag) 
 - 
setPartitionReplicationFactorpublic void setPartitionReplicationFactor(int rep) 
 - 
setExportReplicationFactorpublic void setExportReplicationFactor(int rep) 
 - 
disableJVMReusepublic void disableJVMReuse() 
 - 
disableMonitorReportpublic void disableMonitorReport() 
 - 
setResultMergepublic void setResultMerge(ParForProgramBlock.PResultMerge merge) 
 - 
setRecompileMemoryBudgetpublic void setRecompileMemoryBudget(double localMem) 
 - 
setSparkRepartitionVariablespublic void setSparkRepartitionVariables(Collection<String> vars) 
 - 
getSparkRepartitionVariablespublic Collection<String> getSparkRepartitionVariables() 
 - 
setSparkEagerCacheVariablespublic void setSparkEagerCacheVariables(Collection<String> vars) 
 - 
getNumIterationspublic long getNumIterations() 
 - 
hasFunctionspublic boolean hasFunctions() 
 - 
executepublic void execute(ExecutionContext ec) Description copied from class:ProgramBlockExecutes this program block (incl recompilation if required).- Overrides:
- executein class- ForProgramBlock
- Parameters:
- ec- execution context
 
 - 
printBlockErrorLocationpublic String printBlockErrorLocation() - Overrides:
- printBlockErrorLocationin class- ForProgramBlock
 
 
- 
 
-