How can I control Polaris passes at a fine level?
Polaris internal directives:
There are quite a few directives that you can manually insert into the code to control what Polaris does with a statement or a block of statements. These directives are not all created with an end user in mind. Most are simply internal directives used to pass information from one compiler pass to another. However, the user attempting to parallelize a code or a developer of Polaris may find these directives useful at times.
- CSRD$ PRIVATE var1, var2, ...
- Must be within a do-loop or a block. Takes a list of assignable variables.
- CSRD$ ASSERT expr1, expr2, ...
- Takes a list of expressions.
- CSRD$ SAFE CONDITION
- Takes a list of expressions.
The AssertSafeCondition class is meant to provide a specific class for
representing a Boolean condition under which the Polaris analysis can
be considered "safe". That is, the Polaris analysis ran into some condition
which it could not prove to be true, but which had to be true for the
analysis to be correct. Such conditions are noted on the AssertSafeCondition
assertion. It is intended that such assertions be turned into code guarded by
an IF (condition) THEN version1 ELSE version2 ENDIF construct in the
Polaris-generated source.
- CSRD$ SERIAL [ ( var1 ) ( var2 ) ... ]
- Appears immediately before a loop. Prevents the ddtest pass from parallelizing the loop.
- CSRD$ CRITICAL [ ( var1 ) , ( var2 ) , ... ]
- CSRD$ BEGIN BLOCK
- CSRD$ BEGIN PARALLEL ( var1 )
- Appears within a do-loop.
- CSRD$ END
- CSRD$ LAST VALUE var1, var2, ...
- Immediately follows a do-loop. Takes a list of assignable variables.
- CSRD$ FIRST VALUE var1, var2, ...
- Immediately preceeds a do-loop. Takes a list of assignable variables.
The AssertFirstValue class is meant to provide a specific class for assertions
about the first value calculations for variables. These are variables which
are made private, with the stipulation that at least part of it be copied into
the loop prior to loop execution. The portion to be copied in is specified
on the AssertFirstValue assertion.
- CSRD$ FORWARD expr1, expr2, ...
-
The AssertForward class is meant to provide a specific class for assertions
about forwarding
- CSRD$ DYN LAST VALUE var1, var2, ...
- Appears within a do-loop. Takes a list of assignable variables.
The AssertDynLastValue class is meant to provide a specific class for assertions
about the dynamic last value calculations for variables. This is meant for
situations in which it cannot be proven that the last value for a variable
is assigned in the last iteration of a loop.
- CSRD$ VARRANGE var, lb, ub
- This directive is translated into an assertion that indicates that the variable, var, takes on values between lb and ub.
- CSRD$ RANGE WRITTEN var1, var2, ...
- Immediately follows a do-loop. Takes a list of assignable variables.
The AssertRangeWritten class is meant to provide a specific class for assertions
about the range written to an array during an entire loop execution.
- CSRD$ PARALLEL [ ( var1 ) ( var2 ) ... ]
- CSRD$ REDUCTION var1, var2, ...
- Appears within a do-loop. Takes a list of assignable variables.
- CSRD$ LOOPLABEL
- This directive gives a label for the following loop. The label will be used by the instrumentation pass to determine which loops to instrument and how to output the timings. The label also appears in the compiler output if you specify that Polaris should output loop scheduling data.
- CSRD$ SCHEDULE string
- Immediately preceeds a do-loop.
-
The AssertSchedule class is meant to provide a specific class for
specifying the execution schedule for a loop.
The possible values are:
- SIMPLE
The default schedule for a given machine. Whatever
schedule is given without any special instruction
on the target machine.
- INTERLEAVED
Block cyclic, or horizontally scheduled.
- CSRD$ SHARED var1, var2, ...
- Appears within a do-loop or a block. Takes a list of assignable variables.
The AssertShared class is meant to provide a specific class for
assertions about variables that are meant to be shared between
processors.
- CSRD$ INDUCTION expr1, expr2, ...
- CSRD$ PARALLEL CONDITION expression
-
The AssertParallelCondition class is meant to provide a specific class holding
an expression, which if evaluated as .TRUE., could allow the loop to be executed in parallel.
- CSRD$ NOMOD var1, var2, ...
- Takes a list of assignable variables.
- CSRD$ MAYMOD var1, var2, ...
- Takes a list of assignable variables.
The AssertMayMod class is meant to provide a specific class for
assertions about the expressions which may be modified in the
course of calling a given routine (the invocation of the routine
occurs in the statement to which this assertion is attached).
- CSRD$ PRIVATE_REFS ( expr1 ) , ( expr2 ) , ...
- Appears within a do-loop or a block.
- CSRD$ READ_ONLY_REFS ( expr1 ) , ( expr2 ), ...
- Appears within a do-loop or a block.
- CSRD$ SHARED_REFS ( expr1 ) , ( expr2 ), ...
- Appears within a do-loop or a block.
- CSRD$ PREAMBLE
- CSRD$ POSTAMBLE
- CSRD$ INSTRUMENT
- CSRD$ RT SHADOW var1, var2, ...
- Takes a list of assignable variables.
This forces the runtime pass to shadow the specified array.
- CSRD$ INLINE
- Force inlining of the following subroutine call.
- CSRD$ RECURSIVE INLINE
-
The AssertRecursiveInline class is meant to provide a means to instruct the
inliner to inline all the routine calls (subroutine and/or function calls)
recursively in the following statement or loop.
- CSRD$ NO PUTGET
- CSRD$ NO INLINE
- Appears immediately before a call to a subroutine. Prevents the inlining pass from inlining the subroutine call.
- CSRD$ RUN_TIME_TEST
-
The AssertRunTimeTest class is meant to instruct the run-time pass
to insert code into the loop to which this assertion is attached.
- CSRD$ NO DEPENDENCE ( var1, var2, ... )
- Appears within a do-loop or block.
The AssertNoDependence class is meant to provide a specific class for declaring
that there is no dependence between certain variables.
- CSRD$ SIDE_EFFECT_FREE
-
The AssertSideEffectFree class is meant to provide a specific class for asserting
that certain routines may be called in parallel.
- CSRD$ DEP_IO
-
The AssertDepIO class is meant to provide a means to record the presence
of a dependence solely due to at least one I/O statement in a loop.