38 | | {{{#!box width=55em help |
39 | | Using previous parts, define the main changes to be done in the NEMO literature |
40 | | (manuals, guide, web pages, …). |
| 36 | {{{ |
| 37 | The primary aim of these macros is to assist in future applications of tiling |
| 38 | to improve performance. This is expected to be achieved by alternative versions of these macros in selected |
| 39 | locations. The initial introduction of these macros simply replaced all identifiable nested 2D- and 3D-loops |
| 40 | with single line statements (and adjusts indenting accordingly). Do loops were identifiable if they comformed |
| 41 | to either: |
| 42 | DO jk = .... |
| 43 | DO jj = .... DO jj = ... |
| 44 | DO ji = .... DO ji = ... |
| 45 | . OR . |
| 46 | . . |
| 47 | END DO END DO |
| 48 | END DO END DO |
| 49 | END DO |
| 50 | and white-space variants thereof. |
| 51 | |
| 52 | Additionally, only loops with recognised jj and ji loops limits were treated; these were: |
| 53 | Lower limits of 1, 2 or fs_2 |
| 54 | Upper limits of jpi, jpim1 or fs_jpim1 (for ji) or jpj, jpjm1 or fs_jpjm1 (for jj) |
| 55 | |
| 56 | The macro naming convention takes the form: DO_2D( B, T, L, R) where: |
| 57 | B is the Bottom offset from the PE's inner domain; |
| 58 | T is the Top offset from the PE's inner domain; |
| 59 | L is the Left offset from the PE's inner domain; |
| 60 | R is the Right offset from the PE's inner domain |
| 61 | |
| 62 | So, given an inner domain of 2,jpim1 and 2,jpjm1, a typical example would replace: |
| 63 | |
| 64 | DO jj = 2, jpj |
| 65 | DO ji = 1, jpim1 |
| 66 | . |
| 67 | . |
| 68 | END DO |
| 69 | END DO |
| 70 | |
| 71 | with: |
| 72 | |
| 73 | DO_2D( 0, 1, 1, 0 ) |
| 74 | . |
| 75 | . |
| 76 | END_2D |
| 77 | |
| 78 | similar conventions apply to the 3D loops macros. jk loop limits are retained through macro arguments |
| 79 | and are not restricted. This includes the possibility of strides for which an extra set of DO_3DS |
| 80 | macros are defined. |
| 81 | |
| 82 | In the following definitions the inner PE domain is defined by start indices of (Nis0, Njs0) and end |
| 83 | indices of (Nie0, Nje0) where: |
| 84 | |
| 85 | Nis0 = 1 + nn_hls Njs0 = 1 + nn_hls |
| 86 | Nie0 = jpi - nn_hls Nje0 = jpj - nn_hls |
| 87 | |
| 88 | #endif |
| 89 | #define DO_2D(B, T, L, R) DO jj = Njs0-(B), Nje0+(T) ; DO ji = Nis0-(L), Nie0+(R) |
| 90 | #define DO_3D(B, T, L, R, ks, ke) DO jk = ks, ke ; DO_2D(B, T, L, R) |
| 91 | #define DO_3DS(B, T, L, R, ks, ke, ki) DO jk = ks, ke, ki ; DO_2D(B, T, L, R) |
| 92 | #define END_2D END DO ; END DO |
| 93 | #define END_3D END DO ; END DO ; END DO |