[ HPF Home | Versions | Compilers | Projects | Publications | Applications | Benchmarks | Events | Contact ] |
If the INHERIT directive is not used, explicit alignment of a dummy argument may be necessary to insure that no remapping takes place at the subprogram boundary. Here is an example:
LOGICAL FRUG(128) !HPF$ DISTRIBUTE (BLOCK) ONTO DANCE_FLOOR::FRUG CALL TERPSICHORE(FRUG(1:40:3))
The array section FRUG(1:40:3) is mapped onto abstract processors in the following manner:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 25 10 34 19 4 28 13 37 22 7 31 16 40
Suppose first that the interface to the subroutine TERPSICHORE looks like this:
SUBROUTINE TERPSICHORE(FOXTROT) LOGICAL FOXTROT(:) !HPF$ INHERIT FOXTROT
The template of FOXTROT is a copy of the 128 element template of the whole array FRUG. The template is mapped like this:
FOXTROT(I) is aligned with element 3*I-2 of the template.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 9 17 25 33 41 49 57 65 73 81 89 97 105 113 121 2 10 18 26 34 42 50 58 66 74 82 90 98 106 114 122 3 11 19 27 35 43 51 59 67 75 83 91 99 107 115 123 4 12 20 28 36 44 52 60 68 76 84 92 100 108 116 124 5 13 21 29 37 45 53 61 69 77 85 93 101 109 117 125 6 14 22 30 38 46 54 62 70 78 86 94 102 110 118 126 7 15 23 31 39 47 55 63 71 79 87 95 103 111 119 127 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128
Suppose, on the other hand, that the interface to TERPSICHORE were to look like this instead:
SUBROUTINE TERPSICHORE(FOXTROT) LOGICAL FOXTROT(:) !HPF$ DISTRIBUTE FOXTROT(BLOCK)
In this case, the template of FOXTROT is its natural template; it has the same size 14 as FOXTROT itself. The actual argument, FRUG(1:40:3) is mapped to the 16 processors in this manner:
processor | of FRUG |
---|---|
1 | 1,2,3 |
2 | 4,5,6 |
3 | 7,8 |
4 | 9,10,11 |
5 | 12,13,14 |
6-16 | none |
That is, the original positions (in the template of the actual argument) of the elements of the dummy are as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 9 4 12 7 2 10 5 13 8 3 11 6 14
This layout (3 elements on the first processor, 3 on the second, 2 on the third, 3 on the fourth, ...) cannot properly be described as a BLOCK distribution. Therefore, remapping will take place at the call.
Remapping can be avoided without using INHERIT by explicitly aligning the dummy to a declared template of size 128 distributed BLOCK:
SUBROUTINE TERPSICHORE(FOXTROT) LOGICAL FOXTROT(:) !HPF$ TEMPLATE, DISTRIBUTE(BLOCK) ONTO DANCE_FLOOR::GURF(128) !HPF$ ALIGN FOXTROT(I) WITH GURF(3*I-2)
©2000-2006 Rice University | [ Contact Us | HiPerSoft | Computer Science ] |