1 |
C $Header: /u/gcmpack/models/MITgcmUV/eesupp/inc/CPP_EEOPTIONS.h,v 1.4.2.2 1998/06/20 22:20:20 cnh Exp $ |
2 |
C |
3 |
C /==========================================================\ |
4 |
C | CPP_EEOPTIONS.h | |
5 |
C |==========================================================| |
6 |
C | C preprocessor "execution environment" supporting | |
7 |
C | flags. Use this file to set flags controlling the | |
8 |
C | execution environment in which a model runs - as opposed | |
9 |
C | to the dynamical problem the model solves. | |
10 |
C | Note: Many options are implemented with both compile time| |
11 |
C | and run-time switches. This allows options to be | |
12 |
C | removed altogether, made optional at run-time or | |
13 |
C | to be permanently enabled. This convention helps | |
14 |
C | with the data-dependence analysis performed by the | |
15 |
C | adjoint model compiler. This data dependency | |
16 |
C | analysis can be upset by runtime switches that it | |
17 |
C | is unable to recoginise as being fixed for the | |
18 |
C | duration of an integration. | |
19 |
C | A reasonable way to use these flags is to | |
20 |
C | set all options as selectable at runtime but then | |
21 |
C | once an experimental configuration has been | |
22 |
C | identified, rebuild the code with the appropriate | |
23 |
C | options set at compile time. | |
24 |
C \==========================================================/ |
25 |
|
26 |
#ifndef _CPP_EEOPTIONS_H_ |
27 |
#define _CPP_EEOPTIONS_H_ |
28 |
|
29 |
C In general the following convention applies: |
30 |
C ALLOW - indicates an feature will be included but it may |
31 |
C CAN have a run-time flag to allow it to be switched |
32 |
C on and off. |
33 |
C If ALLOW or CAN directives are "undef'd" this generally |
34 |
C means that the feature will not be available i.e. it |
35 |
C will not be included in the compiled code and so no |
36 |
C run-time option to use the feature will be available. |
37 |
C |
38 |
C ALWAYS - indicates the choice will be fixed at compile time |
39 |
C so no run-time option will be present |
40 |
|
41 |
C Flag used to indicate whether Fortran formatted write |
42 |
C and read are threadsafe. On SGI the routines can be thread |
43 |
C safe, on Sun it is not possible - if you are unsure then |
44 |
C undef this option. |
45 |
#undef FMTFTN_IO_THREADSAFE |
46 |
|
47 |
C Flag used to indicate which flavour of multi-threading |
48 |
C compiler directives to use. Only set one of these. |
49 |
C USE_SOLARIS_THREADING - Takes directives for SUN Workshop |
50 |
C compiler. |
51 |
C USE_KAP_THREADING - Takes directives for Kuck and |
52 |
C Associates multi-threading compiler |
53 |
C ( used on Digital platforms ). |
54 |
C USE_IRIX_THREADING - Takes directives for SGI MIPS |
55 |
C Pro Fortran compiler. |
56 |
C USE_EXEMPLAR_THREADING - Takes directives for HP SPP series |
57 |
C compiler. |
58 |
C USE_C90_THREADING - Takes directives for CRAY/SGI C90 |
59 |
C system F90 compiler. |
60 |
#ifdef TARGET_SUN |
61 |
#define USE_SOLARIS_THREADING |
62 |
#endif |
63 |
|
64 |
#ifdef TARGET_DEC |
65 |
#define USE_KAP_THREADING |
66 |
#endif |
67 |
|
68 |
#ifdef TARGET_SGI |
69 |
#define USE_IRIX_THREADING |
70 |
#endif |
71 |
|
72 |
#ifdef TARGET_HP |
73 |
#define USE_EXEMPLAR_THREADING |
74 |
#endif |
75 |
|
76 |
#ifdef TARGET_CRAY_VECTOR |
77 |
#define USE_C90_THREADING |
78 |
#endif |
79 |
|
80 |
C-- Define the mapping for the _BARRIER macro |
81 |
C On some systems low-level hardware support can be accessed through |
82 |
C compiler directives here. |
83 |
#define _BARRIER CALL BARRIER(myThid) |
84 |
|
85 |
C-- Define the mapping for the BEGIN_CRIT() and END_CRIT() macros. |
86 |
C On some systems we simply execute this section only using the |
87 |
C master thread i.e. its not really a critical section. We can |
88 |
C do this because we don't use critical sections in any critical |
89 |
C sections of our code! |
90 |
#define _BEGIN_CRIT(a) _BEGIN_MASTER(a) |
91 |
#define _END_CRIT(a) _END_MASTER(a) |
92 |
|
93 |
C-- Define the mapping for the BEGIN_MASTER_SECTION() and |
94 |
C END_MASTER_SECTION() macros. These are generally implemented by |
95 |
C simply choosing a particular thread to be "the master" and have |
96 |
C it alone execute the BEGIN_MASTER..., END_MASTER.. sections. |
97 |
#define _BEGIN_MASTER(a) IF ( a .EQ. 1 ) THEN |
98 |
#define _END_MASTER(a) ENDIF |
99 |
|
100 |
C-- Control MPI based parallel processing |
101 |
#define ALLOW_USE_MPI |
102 |
#define ALWAYS_USE_MPI |
103 |
|
104 |
C-- Control use of communication that might overlap computation. |
105 |
C Under MPI selects/deselects "non-blocking" sends and receives. |
106 |
#define ALLOW_ASYNC_COMMUNICATION |
107 |
#undef ALLOW_ASYNC_COMMUNICATION |
108 |
#undef ALWAYS_USE_ASYNC_COMMUNICATION |
109 |
C-- Control use of communication that is atomic to computation. |
110 |
C Under MPI selects/deselects "blocking" sends and receives. |
111 |
#define ALLOW_SYNC_COMMUNICATION |
112 |
#undef ALWAYS_USE_SYNC_COMMUNICATION |
113 |
|
114 |
C-- Control storage of floating point operands |
115 |
C On many systems it improves performance only to use |
116 |
C 8-byte precision for time stepped variables. |
117 |
C Constant in time terms ( geometric factors etc.. ) |
118 |
C can use 4-byte precision, reducing memory utilisation and |
119 |
C boosting performance because of a smaller working |
120 |
C set size. However, on vector CRAY systems this degrades |
121 |
C performance. |
122 |
#undef REAL4_IS_SLOW |
123 |
|
124 |
#ifdef REAL4_IS_SLOW |
125 |
#define real Real*8 |
126 |
#define REAL Real*8 |
127 |
#define _RS Real*8 |
128 |
#define _RL Real*8 |
129 |
#define _EXCH_XY_R4(a,b) CALL EXCH_XY_R8 ( a, b ) |
130 |
#define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_R8 ( a, b ) |
131 |
#define _GLOBAL_SUM_R4(a,b,c) CALL GLOBAL_SUM_R8( a, b , c) |
132 |
#define _GLOBAL_MAX_R4(a,b,c) CALL GLOBAL_MAX_R8( a, b , c) |
133 |
#endif |
134 |
|
135 |
#ifndef REAL4_IS_SLOW |
136 |
#define real Real*4 |
137 |
#define REAL Real*8 |
138 |
#define _RS Real*4 |
139 |
#define _RL Real*8 |
140 |
#define _EXCH_XY_R4(a,b) CALL EXCH_XY_R4 ( a, b ) |
141 |
#define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_R4 ( a, b ) |
142 |
#define _GLOBAL_SUM_R4(a,b,c) CALL GLOBAL_SUM_R4( a, b , c) |
143 |
#define _GLOBAL_MAX_R4(a,b,c) CALL GLOBAL_MAX_R4( a, b , c) |
144 |
#endif |
145 |
|
146 |
#define _EXCH_XY_R8(a,b) CALL EXCH_XY_R8 ( a, b ) |
147 |
#define _EXCH_XYZ_R8(a,b) CALL EXCH_XYZ_R8 ( a, b ) |
148 |
#define _GLOBAL_SUM_R8(a,b,c) CALL GLOBAL_SUM_R8( a, b , c) |
149 |
#define _GLOBAL_MAX_R8(a,b,c) CALL GLOBAL_MAX_R8( a, b , c) |
150 |
|
151 |
C-- Control use of "double" precision constants. |
152 |
C Use D0 where it means REAL*8 but not where it means REAL*16 |
153 |
#define D0 d0 |
154 |
#ifdef REAL_D0_IS_16BYTES |
155 |
#define D0 |
156 |
#endif |
157 |
|
158 |
C-- Control XY periodicity in processor to grid mappings |
159 |
C Note: Model code does not need to know whether a domain is |
160 |
C periodic because it has overlap regions for every box. |
161 |
C Model's simply assume that these values have been |
162 |
C filled in some way. |
163 |
#undef ALWAYS_PREVENT_X_PERIODICITY |
164 |
#undef ALWAYS_PREVENT_Y_PERIODICITY |
165 |
#define CAN_PREVENT_X_PERIODICITY |
166 |
#define CAN_PREVENT_Y_PERIODICITY |
167 |
|
168 |
C-- Substitue for 1.D variables |
169 |
C Sun compilers don't use 8-byte precision for literals |
170 |
C unless .Dnn is specified. CRAY vector machines use 16-byte |
171 |
C precision when they see .Dnn which runs very slowly! |
172 |
#ifdef REAL_D0_IS_16BYTES |
173 |
#define _d |
174 |
#endif |
175 |
#ifndef REAL_D0_IS_16BYTES |
176 |
#define _d D |
177 |
#endif |
178 |
|
179 |
#endif /* _CPP_EEOPTIONS_H_ */ |