/[MITgcm]/MITgcm/verification/hs94.128x64x5/code/CPP_EEOPTIONS.h
ViewVC logotype

Diff of /MITgcm/verification/hs94.128x64x5/code/CPP_EEOPTIONS.h

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

revision 1.1 by adcroft, Wed Jan 24 17:07:08 2001 UTC revision 1.2 by adcroft, Fri Feb 2 21:36:33 2001 UTC
# Line 0  Line 1 
1    C $Header$
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 do not 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    #undef  ALLOW_USE_MPI
102    #undef  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    #undef  LETS_MAKE_JAM
115    #undef  JAM_WITH_TWO_PROCS_PER_NODE
116    #ifdef LETS_MAKE_JAM
117    #define _JAMEXT _jam
118    #else
119    #define _JAMEXT
120    #endif
121    
122    C--   Control storage of floating point operands
123    C     On many systems it improves performance only to use
124    C     8-byte precision for time stepped variables.
125    C     Constant in time terms ( geometric factors etc.. )
126    C     can use 4-byte precision, reducing memory utilisation and
127    C     boosting performance because of a smaller working
128    C     set size. However, on vector CRAY systems this degrades
129    C     performance.
130    #define REAL4_IS_SLOW
131    
132    #ifdef REAL4_IS_SLOW
133    #define _RS  Real*8
134    #define _RL  Real*8
135    #define RS_IS_REAL8
136    #define _EXCH_XY_R4(a,b)       CALL EXCH_XY_R8 _JAMEXT ( a, b )
137    #define _EXCH_XYZ_R4(a,b)      CALL EXCH_XYZ_R8 _JAMEXT ( a, b )
138    #define _GLOBAL_SUM_R4(a,b)    CALL GLOBAL_SUM_R8 _JAMEXT ( a, b )
139    #define _GLOBAL_MAX_R4(a,b)    CALL GLOBAL_MAX_R8 ( a, b )
140    #endif
141    
142    #ifndef REAL4_IS_SLOW
143    #define _RS  Real*4
144    #define _RL  Real*8
145    #define RS_IS_REAL4
146    #define _EXCH_XY_R4(a,b)       CALL EXCH_XY_R4 ( a, b )
147    #define _EXCH_XYZ_R4(a,b)      CALL EXCH_XYZ_R4 ( a, b )
148    #define _GLOBAL_SUM_R4(a,b)    CALL GLOBAL_SUM_R4( a, b )
149    #define _GLOBAL_MAX_R4(a,b)    CALL GLOBAL_MAX_R4( a, b )
150    #endif
151    
152    #define _EXCH_XY_R8(a,b)       CALL EXCH_XY_R8 _JAMEXT ( a, b )
153    #define _EXCH_XYZ_R8(a,b)      CALL EXCH_XYZ_R8 _JAMEXT ( a, b )
154    #define _GLOBAL_SUM_R8(a,b)    CALL GLOBAL_SUM_R8 _JAMEXT ( a, b )
155    #define _GLOBAL_MAX_R8(a,b)    CALL GLOBAL_MAX_R8 ( a, b )
156    
157    C--   Control use of "double" precision constants.
158    C     Use D0 where it means REAL*8 but not where it means REAL*16
159    #define D0 d0
160    #ifdef REAL_D0_IS_16BYTES
161    #define D0
162    #endif
163    
164    C--   Control XY periodicity in processor to grid mappings
165    C     Note: Model code does not need to know whether a domain is
166    C           periodic because it has overlap regions for every box.
167    C           Model assume that these values have been
168    C           filled in some way.
169    #undef  ALWAYS_PREVENT_X_PERIODICITY
170    #undef  ALWAYS_PREVENT_Y_PERIODICITY
171    #define CAN_PREVENT_X_PERIODICITY
172    #define CAN_PREVENT_Y_PERIODICITY
173    
174    C--   Substitue for 1.D variables
175    C     Sun compilers do not use 8-byte precision for literals
176    C     unless .Dnn is specified. CRAY vector machines use 16-byte
177    C     precision when they see .Dnn which runs very slowly!
178    #ifdef REAL_D0_IS_16BYTES
179    #define _d
180    #define _F64( a ) a
181    #endif
182    #ifndef REAL_D0_IS_16BYTES
183    #define _d D
184    #define _F64( a ) DFLOAT( a )
185    #endif
186    
187    #endif /* _CPP_EEOPTIONS_H_ */

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22