/[MITgcm]/MITgcm/eesupp/inc/CPP_EEOPTIONS.h
ViewVC logotype

Contents of /MITgcm/eesupp/inc/CPP_EEOPTIONS.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Wed Apr 22 19:15:30 1998 UTC (26 years ago) by cnh
Branch: MAIN
Branch point for: cnh
File MIME type: text/plain
Initial revision

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

  ViewVC Help
Powered by ViewVC 1.1.22