- Timestamp:
- 2020-11-27T17:26:33+01:00 (4 years ago)
- Location:
- NEMO/branches/2020/tickets_icb_1900
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/tickets_icb_1900
- Property svn:externals
-
NEMO/branches/2020/tickets_icb_1900/src/OCE/do_loop_substitute.h90
r12377 r13899 8 8 ! between version 4.0 and 4.2. The primary aim of these macros is to assist in future applications of tiling 9 9 ! to improve performance. This is expected to be achieved by alternative versions of these macros in selected 10 ! locations. The initial introduction of these macros simply replace sall identifiable nested 2D- and 3D-loops11 ! with single line statements (and adjusts indenting accordingly). Do loops are identifiable if they comform10 ! locations. The initial introduction of these macros simply replaced all identifiable nested 2D- and 3D-loops 11 ! with single line statements (and adjusts indenting accordingly). Do loops were identifiable if they comformed 12 12 ! to either: 13 13 ! DO jk = .... … … 21 21 ! and white-space variants thereof. 22 22 ! 23 ! Additionally, only loops with recognised jj and ji loops limits are treated; these are:23 ! Additionally, only loops with recognised jj and ji loops limits were treated; these were: 24 24 ! Lower limits of 1, 2 or fs_2 25 25 ! Upper limits of jpi, jpim1 or fs_jpim1 (for ji) or jpj, jpjm1 or fs_jpjm1 (for jj) 26 26 ! 27 ! The macro naming convention takes the form: DO_2D _BT_LRwhere:27 ! The macro naming convention takes the form: DO_2D( B, T, L, R) where: 28 28 ! B is the Bottom offset from the PE's inner domain; 29 29 ! T is the Top offset from the PE's inner domain; … … 42 42 ! with: 43 43 ! 44 ! DO_2D _01_1044 ! DO_2D( 0, 1, 1, 0 ) 45 45 ! . 46 46 ! . 47 47 ! END_2D 48 48 ! 49 ! similar conventions apply to the 3D loops macros. jk loop limits are retained through macro arguments and are not restricted. This 50 ! includes the possibility of strides for which an extra set of DO_3DS macros are defined. 49 ! similar conventions apply to the 3D loops macros. jk loop limits are retained through macro arguments 50 ! and are not restricted. This includes the possibility of strides for which an extra set of DO_3DS 51 ! macros are defined. 51 52 ! 52 ! In the following definitions the inner PE domain is defined by start indices of (___kIs_, __kJs_) and end indices of (__kIe_, __kJe_) 53 ! The following macros are defined just below: ___kIs_, __kJs_, ___kIsm1_, __kJsm1_, ___kIe_, __kJe_, ___kIep1_, __kJep1_. 54 ! These names are chosen to, hopefully, avoid any future, unintended matches elsewhere in the code. 53 ! In the following definitions the inner PE domain is defined by start indices of (Nis0, Njs0) and end 54 ! indices of (Nie0, Nje0) where: 55 55 ! 56 ! Nis0 = 1 + nn_hls Njs0 = 1 + nn_hls 57 ! Nie0 = jpi - nn_hls Nje0 = jpj - nn_hls 58 ! 56 59 #endif 57 #define __kIs_ 258 #define __kJs_ 259 #define __kIsm1_ 160 #define __kJsm1_ 161 60 62 #define __kIe_ jpim1 63 #define __kJe_ jpjm1 64 #define __kIep1_ jpi 65 #define __kJep1_ jpj 61 #define DO_2D(B, T, L, R) DO jj = Njs0-(B), Nje0+(T) ; DO ji = Nis0-(L), Nie0+(R) 66 62 67 #define DO_2D_00_00 DO jj = __kJs_, __kJe_ ; DO ji = __kIs_, __kIe_ 68 #define DO_2D_00_01 DO jj = __kJs_, __kJe_ ; DO ji = __kIs_, __kIep1_ 69 #define DO_2D_00_10 DO jj = __kJs_, __kJe_ ; DO ji = __kIsm1_, __kIe_ 70 #define DO_2D_00_11 DO jj = __kJs_, __kJe_ ; DO ji = __kIsm1_, __kIep1_ 71 72 #define DO_2D_01_00 DO jj = __kJs_, __kJep1_ ; DO ji = __kIs_, __kIe_ 73 #define DO_2D_01_01 DO jj = __kJs_, __kJep1_ ; DO ji = __kIs_, __kIep1_ 74 #define DO_2D_01_10 DO jj = __kJs_, __kJep1_ ; DO ji = __kIsm1_, __kIe_ 75 #define DO_2D_01_11 DO jj = __kJs_, __kJep1_ ; DO ji = __kIsm1_, __kIep1_ 76 77 #define DO_2D_10_00 DO jj = __kJsm1_, __kJe_ ; DO ji = __kIs_, __kIe_ 78 #define DO_2D_10_10 DO jj = __kJsm1_, __kJe_ ; DO ji = __kIsm1_, __kIe_ 79 #define DO_2D_10_11 DO jj = __kJsm1_, __kJe_ ; DO ji = __kIsm1_, __kIep1_ 80 81 #define DO_2D_11_00 DO jj = __kJsm1_, __kJep1_ ; DO ji = __kIs_, __kIe_ 82 #define DO_2D_11_01 DO jj = __kJsm1_, __kJep1_ ; DO ji = __kIs_, __kIep1_ 83 #define DO_2D_11_10 DO jj = __kJsm1_, __kJep1_ ; DO ji = __kIsm1_, __kIe_ 84 #define DO_2D_11_11 DO jj = __kJsm1_, __kJep1_ ; DO ji = __kIsm1_, __kIep1_ 63 #define DO_3D(B, T, L, R, ks, ke) DO jk = ks, ke ; DO_2D(B, T, L, R) 85 64 86 #define DO_3D_00_00(ks,ke) DO jk = ks, ke ; DO_2D_00_00 87 #define DO_3D_00_10(ks,ke) DO jk = ks, ke ; DO_2D_00_10 88 89 #define DO_3D_01_01(ks,ke) DO jk = ks, ke ; DO_2D_01_01 90 91 #define DO_3D_10_00(ks,ke) DO jk = ks, ke ; DO_2D_10_00 92 #define DO_3D_10_10(ks,ke) DO jk = ks, ke ; DO_2D_10_10 93 #define DO_3D_10_11(ks,ke) DO jk = ks, ke ; DO_2D_10_11 94 95 #define DO_3D_11_11(ks,ke) DO jk = ks, ke ; DO_2D_11_11 96 97 #define DO_3DS_00_00(ks,ke,ki) DO jk = ks, ke, ki ; DO_2D_00_00 98 #define DO_3DS_01_01(ks,ke,ki) DO jk = ks, ke, ki ; DO_2D_01_01 99 #define DO_3DS_10_10(ks,ke,ki) DO jk = ks, ke, ki ; DO_2D_10_10 100 #define DO_3DS_11_11(ks,ke,ki) DO jk = ks, ke, ki ; DO_2D_11_11 65 #define DO_3DS(B, T, L, R, ks, ke, ki) DO jk = ks, ke, ki ; DO_2D(B, T, L, R) 101 66 102 67 #define END_2D END DO ; END DO
Note: See TracChangeset
for help on using the changeset viewer.