next up previous
Next: Example source file Up: Usage of Polaris Previous: Usage of Polaris

KAP specialty directives

The following two directives make assertions about immediately following loops. The loop referenced is that of a lexically succeeding DO statement.

CSRD$SERIAL
The loop in question will always be serialized; KAP will make no attempt to analyse it. If inner loops exist, no inferrence is made about them.

CSRD$PARALLEL
The loop in question may be made parallel without error. If inner loops exist, no inferrence is made about them.

KAP assumes that any subroutine calls within the scope of such a loop have no side effects which could prevent concurrentization.

KAP builds a list of all out-symbols appearing in the loop; any symbols which are also mentioned in a CSRD$LASTVALUE, CSRD$PRIVATE, or CSRD$REDUCTION directive of that loop are removed from that list. KAP assumes that no inter-iteration dependences exist for any symbols in the remaining list.

If two or more loops of a nest are marked as potentially parallel, KAP will choose which to make parallel in the output.

The following two sets of directives make assertions about the loops they appear in. The loop referenced is that of a lexically preceeding DO statement. The scope of the directive is the entire loop, regardless of placement of the directive within the loop.

The first set applies to loops which have been, or could have been, marked with a CSRD$PARALLEL directive. If no CSRD$PARALLEL directive was found, one will be assumed and the actions mentioned above will take effect.

CSRD$LASTVALUE < comma-separated list of objects >
CSRD$PRIVATE < comma-separated list of objects >
CSRD$REDUCTION < comma-separated list of objects >

CSRD$& < continuation of comma-separated list >

The objects are variables, array names, or array elements. For the CSRD$PRIVATE directive, a common block name (delimited by slashes) is an allowed object; all members of the common become part of the list of objects. Multiple instances of a single directive type may appear within a loop; KAP concatenates the objects lists.

The object list may be optionally enclosed in parentheses. If enclosing parens appear, the list may be empty. Using a directive with a nil list is an indirect means of marking a loop as parallelizable.

The CSRD$PRIVATE directive asserts that the objects are to be on the "private", or "local" list in a parallel implementation.

The CSRD$LASTVALUE and CSRD$REDUCTION directives currently only assert that KAP should not assume inter-iteration independences for the listed objects.

Examples:

CSRD$PRIVATE ( a_scalar,
CSRD$&         b_array )

CSRD$PRIVATE c_array( 2 ), d_array( i ), / com /

CSRD$PRIVATE ( )

The second set of directives are assertions which may be helpful in deciding whether a loop may be made parallel.

CSRD$ASSERT < comma-separated list of relations >

A relation is of the form

``Expression_1 Relational_operator Expression_2'',

where Relational_operator is one of .GT. , .GE. , .LE. , .LT. , .EQ. , or .NE. .

For the present, KAP will only use relations between two integer scalar variables or an integer scalar variable and an integer constant.

Example:

CSRD$ASSERT a_scalar .lt. 1, (b_scalar ** 2) .gt. index

CSRD$INRANGE < comma-separated list of range assertions >
CSRD$ALLINRANGE < comma-separated list of range assertions >

A range assertion is of the form

``Scalar_symbol( Lower_bound_expression, Upper_bound_expression)''.

The CSRD$INRANGE directive states that, within the scope of the loop, ``Scalar_symbol'' is guaranteed to take on no values outside of the indicated range.

The CSRD$ALLINRANGE directive states that, within the scope of the loop, ``Scalar_symbol'' will take on all values in the indicated range and none outside of that range.

For the present, KAP will only decompose these directives to the form

CSRD$ASSERT Scalar_symbol .GE. Lower_bound_expression CSRD$ASSERT Scalar_symbol .LE. Upper_bound_expression

KAP will then attempt to use each of the derived directives.

Examples:

CSRD$INRANGE a_scalar( a_array(1), index_1 + index_2 )

CSRD$ALLINRANGE b_scalar( -128, 127 ), CSRD$& b_array( 1 ) ( 111, idx )



next up previous
Next: Example source file Up: Usage of Polaris Previous: Usage of Polaris



Jay Hoeflinger
Mon Apr 21 11:52:18 CDT 1997