public class ProfitableOMP extends CodeGenPass
Model-based approach (starts with -profitable-omp=1)
Symbolically computes the workload of each loop by counting loop iteration
and the child statements. If the workload is smaller than the given
threshold, it is serialized either at compile-time (if the workload is
integer literal) or at run-time (through OpenMP if clause).
Following sub options are allowed through command line:
threshold=N the threshold for serialization
costwhile=N the iteration count for while-like loops
costfcall=N the workload of a function call
runtime=0|1 when this value is zero OpenMP if clause is avoided
e.g., -profitable-omp=1:threshold=10000,costwhile=100,costfcall=100
Profile-based approach (starts with -profitable-omp=2)
This approach assumes the workload of a parallel loop does not change over
multiple invocations of the loop. The basic idea is to use profiled
runtime of a sequential execution and a parallel execution of a parallel
loop and to decide whether the loop should be executed in parallel after
the profiling. A parallel loop is executed in three different phases:
grace phase : the loop is executed in parallel
profile phase: the loop is profiled several times both in serial and
in parallel
stable phase : the loop is executed either in serial or in parallel
based on the profiled information
Users can vary the behavior of each phase by specifying the following sub
options:
grace=N : the length of grace phase (# invocations)
repeat=N : the number of profiled invocations in serial/parallel
interval=N: the interval between successive profiling within the
profile phase
usmin=N : threshold for eager serialization without profiling in
micro seconds
e.g., -profitable-omp=2:grace=50,repeat=5,interval=10,usmin=10
| Constructor and Description |
|---|
ProfitableOMP(Program program)
Constructs a new profitable code generator for OpenMP programs.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getPassName()
Returns the name of this code generation pass.
|
void |
start()
Starts the code generation for profitable loop parallelization.
|
runpublic ProfitableOMP(Program program)
program - the program to be processed.public java.lang.String getPassName()
getPassName in class CodeGenPasspublic void start()
start in class CodeGenPass