next up previous contents
Next: Strided Alignment Example Up: Alignment Syntax Previous: Simple 2D Alignment Example

 

Transposed Alignment Example

Here we are aligning a row of A with a column of B and vice-versa. The colon syntax cannot be used to specify this, we must also use the symbolic syntax. The statement:

    REAL, DIMENSION(10,10) :: A, B
!HPF$ ALIGN A(i,:) WITH B(:,i)

uses two symbols (a colon and i) to specify the first dimension of A is aligned with the second dimension of B (the symbol i) and the second dimension of A is aligned with the first dimension of B (the colon symbol). Again the colon implies conformance, in other words, the first dimension of B has the same extent as the second dimension of A. Effectively this says: tex2html_wrap_inline29494 i, j, elements A(i,j) and B(j,i) are local. This could also be written:

!HPF$ ALIGN A(:,j) WITH B(j,:)

this is similar to the first except that the symbol j is used and the conformance between dimensions is for the first dimension of A and the second dimension of B.

A further way of expressing this could be:

!HPF$ ALIGN A(i,j) WITH B(j,i)

Here i and j are ``symbols'' not variables and are used to match dimensions their value (if any) is unimportant. The only difference is that there is nothing implied about the extents of the dimensions.

Return to corresponding overview page gif

  Figure 43 is supposed to show how elements A(1,:) (the first row of A) and B(:,1) (the first column of B) are aligned with each other and so on. A is aligned with the transpose of B.

   figure15701
Figure 43: Visualisation of Transposed 2D Alignment

The two shaded blobs are also aligned and are therefore resident on the same processor.

This alignment is suitable for,

 A = A + TRANSPOSE(B)*A ! all local

Return to corresponding overview page gif


next up previous contents
Next: Strided Alignment Example Up: Alignment Syntax Previous: Simple 2D Alignment Example

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.