In addition to the version of INDEPENDENT available from HPF, a new version of INDEPENDENT is included that incorporates the ON clause. There are a number of differences between the versions of INDEPENDENT with and without the ON clause.
The new version of the INDEPENDENT directive may be applied to the first of a group of tightly nested loops and may apply to more than one of them. This more easily facilitates the use of the ON clause. The current INDEPENDENT directive applies only to a single loop nest. The INDEPENDENT directive is extended so that multiple loop nests can be named. The general syntax for these new independent loops is as follows:
!HPF$ INDEPENDENT (I_1,I_2,...,I_n) ON array-name(h_1(I_1),h_2(I_2),...,h_n(I_n)) DO I_1 = L_1, U_1, S_1 DO I_2 = L_2, U_2, S_2 ... DO I_n = L_n, U_n, S_n ... END DO ... END DO END DO
The syntax and semantics of INDEPENDENT with the ON clause are different from its syntax and semantics without the ON clause. With the ON clause the directive states that there are no cross-processor dependencies, but there may be dependencies between iterations on a processor. There is an implicit barrier synchronization after an INDEPENDENT loop. Transfer of control into or out of an INDEPENDENT loop is prohibited.
The iteration space of an INDEPENDENT nest must be rectangular. That is, the lower loop bound, the upper loop bound, and the step expression for each loop indicated by the INDEPENDENT induction list must be invariant with regard to the INDEPENDENT nest. Each index expression of array-name in the ON clause (the functions h_i above,) must be one of the following two forms:
where a and b must be integer values; they can be expressions, constants, or variables. The values of a and b must be invariant with regard to the INDEPENDENT loop nest. For example, specifying A(I,J,K) is valid. Specifying A(3,I+J,K) is not valid. Specifying A(I,I,K) is not valid because I appears twice. Division is prohibited in any index expression of the ON clause.[ a * loop_control_variable + ] b [ a * loop_control_variable - ] b