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

Annotation of /MITgcm/eesupp/inc/EESUPPORT.h

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


Revision 1.6 - (hide annotations) (download)
Sun Feb 4 14:38:41 2001 UTC (23 years, 2 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint40pre3, checkpoint40pre1, checkpoint40pre7, checkpoint40pre6, checkpoint40pre9, checkpoint40pre8, checkpoint38, checkpoint40pre2, checkpoint40pre4, pre38tag1, c37_adj, pre38-close, checkpoint39, checkpoint37, checkpoint36, checkpoint35, checkpoint40pre5, checkpoint40
Branch point for: pre38
Changes since 1.5: +2 -1 lines
File MIME type: text/plain
Made sure each .F and .h file had
the CVS keywords Header and Name at its start.
Most had header but very few currently have Name, so
lots of changes!

1 cnh 1.6 C $Header: /u/gcmpack/models/MITgcmUV/eesupp/inc/EESUPPORT.h,v 1.5 1999/03/22 17:37:42 adcroft Exp $
2     C $Name: $
3 cnh 1.1 C
4     C /==========================================================\
5     C | EESUPPORT.h |
6     C |==========================================================|
7     C | Support data structures for the MITgcm UV "execution |
8     C | environment" code. This data should be private to the |
9     C | execution environment routines. Data which needs to be |
10     C | accessed directly by the numerical model goes in |
11     C | EEPARAMS.h. |
12     C \==========================================================/
13    
14     C ERROR_HEADER - String which prefixes error messages
15     CHARACTER*(*) ERROR_HEADER
16     PARAMETER ( ERROR_HEADER = ' *** ERROR ***' )
17     C PROCESS_HEADER - String which prefixes processor number
18     CHARACTER*(*) PROCESS_HEADER
19     PARAMETER ( PROCESS_HEADER = 'PID.TID' )
20    
21 cnh 1.4 C MAX_NUM_COMM_MODES - Maximum number of communication modes
22 cnh 1.1 C COMM_NONE - No edge communication
23 cnh 1.4 C COMM_MSG - Use messages to communicate edges
24     C COMM_PUT - Use put to communicate edges
25     C COMM_GET - Use get to communicate edges
26     C Note - commName holds an identifying name for each communication
27     C mode. The COMM_ parameters are used to index commName
28     C so the COMM_ parameters need to be in the range
29     C 1 : MAX_NUM_COMM_MODES.
30     INTEGER MAX_NUM_COMM_MODES
31     PARAMETER ( MAX_NUM_COMM_MODES = 4 )
32 cnh 1.1 INTEGER COMM_NONE
33 cnh 1.4 PARAMETER ( COMM_NONE = 1 )
34     INTEGER COMM_MSG
35     PARAMETER ( COMM_MSG = 2 )
36     INTEGER COMM_PUT
37     PARAMETER ( COMM_PUT = 3 )
38     INTEGER COMM_GET
39     PARAMETER ( COMM_GET = 4 )
40     COMMON /EESUPP_COMMNAME/ commName
41     CHARACTER*10 commName(MAX_NUM_COMM_MODES)
42    
43     C Tile identifiers
44     C Tiles have a number that is unique over the global domain.
45     C A tile that is not there has its number set to NULL_TILE
46     INTEGER NULL_TILE
47     PARAMETER ( NULL_TILE = -1 )
48    
49 cnh 1.1
50     C-- COMMON /EESUPP_C/ Execution environment support character variables
51     C myProcessStr - String identifying my process number
52     COMMON /EESUPP_C/ myProcessStr
53     CHARACTER*128 myProcessStr
54    
55     C-- COMMON /EESUPP_L/ Execution environment support logical variables
56     C initMPError - Flag indicating error during multi-processing
57     C initialisation.
58     C finMPError - Flag indicating error during multi-processing
59     C termination.
60     C ThError - Thread detected an error.
61     C usingMPI - Flag controlling use of MPI routines. This flag
62     C allows either MPI or threads to be used in a
63     C shared memory environment which can be a useful
64     C debugging/performance analysis tool.
65     C usingSyncMessages - Flag that causes blocking communication to be used
66     C if possible. When false non-blocking EXCH routines
67     C will be used if possible.
68     C notUsingXPeriodicity - Flag indicating no X/Y boundary wrap around
69     C notUsingYPeriodicity This affects the communication routines but
70     C is generally ignored in the numerical model
71     C code.
72     C threadIsRunning, threadIsComplete - Flags used to check for correct behaviour
73     C of multi-threaded code.
74     C threadIsRunning is used to check that the
75     C threads we need are running. This catches the
76     C situation where a program eedata file has nTthreads
77     C greater than the setenv PARALLEL or NCPUS variable.
78     C threadIsComplete is used to flag that a thread has
79     C reached the end of the model. This is used as a check to
80     C trap problems that might occur if one thread "escapes"
81     C the main.F master loop. This should not happen
82     C if the multi-threading compilation tools works right.
83     C But (see for example KAP) this is not always the case!
84 cnh 1.3 C printMapIncludesZeros - Flag that controls whether character constant map code ignores
85     C exact zero values.
86 cnh 1.1 COMMON /EESUPP_L/ thError, threadIsRunning, threadIsComplete,
87     & allMyEdgesAreSharedMemory, usingMPI, usingSyncMessages,
88 cnh 1.3 & notUsingXPeriodicity, notUsingYPeriodicity,
89     & printMapIncludesZeros
90 cnh 1.1 LOGICAL thError(MAX_NO_THREADS)
91     LOGICAL threadIsRunning(MAX_NO_THREADS)
92     LOGICAL threadIsComplete(MAX_NO_THREADS)
93     LOGICAL allMyEdgesAreSharedMemory(MAX_NO_THREADS)
94     LOGICAL usingMPI
95     LOGICAL usingSyncMessages
96     LOGICAL notUsingXPeriodicity
97     LOGICAL notUsingYPeriodicity
98 cnh 1.3 LOGICAL printMapIncludesZeros
99 cnh 1.1
100     C-- COMMON /EESUPP_I/ Parallel support integer globals
101 cnh 1.4 C pidW - Process ID of neighbor to West
102     C pidE - ditto East
103     C pidN - ditto North
104     C pidS - ditto South
105 cnh 1.1 C Note: pid[XY] is not necessairily the UNIX
106     C process id - it is just an identifying
107     C number.
108 cnh 1.4 C myPid - My own process id
109     C nProcs - Number of processes
110     C westCommunicationMode - Mode of communication for each tile face
111     C eastCommunicationMode
112     C northCommunicationMode
113     C southCommunicationMode
114     C bi0 - Low cartesian tile index for this process
115     C bj0 Note - In a tile distribution with holes bi0 and bj0
116     C are not useful. Neighboring tile indices must
117     C be derived some other way.
118     C tileNo - Tile identification number for my tile and
119     C tileNo[WENS] my N,S,E,W neighbor tiles.
120     C tilePid[WENS] - Process identification number for
121     C my N,S,E,W neighbor tiles.
122     C nTx, nTy - No. threads in X and Y. This assumes a simple
123     C cartesian gridding of the threads which is not
124     C required elsewhere but that makes it easier.
125 cnh 1.1 COMMON /EESUPP_I/
126 cnh 1.4 & myPid, nProcs, pidW, pidE, pidN, pidS,
127     & tileCommModeW, tileCommModeE,
128     & tileCommModeN, tileCommModeS,
129     & tileNo, tileNoW, tileNoE, tileNoS, tileNoN,
130     & tilePidW, tilePidE, tilePidS, tilePidN,
131     & tileBiW, tileBiE, tileBiS, tileBiN,
132     & tileBjW, tileBjE, tileBjS, tileBjN,
133     & tileTagSendW, tileTagSendE, tileTagSendS, tileTagSendN,
134     & tileTagRecvW, tileTagRecvE, tileTagRecvS, tileTagRecvN
135     INTEGER myPid
136     INTEGER nProcs
137 cnh 1.1 INTEGER pidW
138     INTEGER pidE
139 cnh 1.4 INTEGER pidN
140 cnh 1.1 INTEGER pidS
141 cnh 1.4 INTEGER tileCommModeW ( nSx, nSy )
142     INTEGER tileCommModeE ( nSx, nSy )
143     INTEGER tileCommModeN ( nSx, nSy )
144     INTEGER tileCommModeS ( nSx, nSy )
145     INTEGER tileNo( nSx, nSy )
146     INTEGER tileNoW( nSx, nSy )
147     INTEGER tileNoE( nSx, nSy )
148     INTEGER tileNoN( nSx, nSy )
149     INTEGER tileNoS( nSx, nSy )
150     INTEGER tilePidW( nSx, nSy )
151     INTEGER tilePidE( nSx, nSy )
152     INTEGER tilePidN( nSx, nSy )
153     INTEGER tilePidS( nSx, nSy )
154     INTEGER tileBiW( nSx, nSy )
155     INTEGER tileBiE( nSx, nSy )
156     INTEGER tileBiN( nSx, nSy )
157     INTEGER tileBiS( nSx, nSy )
158     INTEGER tileBjW( nSx, nSy )
159     INTEGER tileBjE( nSx, nSy )
160     INTEGER tileBjN( nSx, nSy )
161     INTEGER tileBjS( nSx, nSy )
162     INTEGER tileTagSendW( nSx, nSy )
163     INTEGER tileTagSendE( nSx, nSy )
164     INTEGER tileTagSendN( nSx, nSy )
165     INTEGER tileTagSendS( nSx, nSy )
166     INTEGER tileTagRecvW( nSx, nSy )
167     INTEGER tileTagRecvE( nSx, nSy )
168     INTEGER tileTagRecvN( nSx, nSy )
169     INTEGER tileTagRecvS( nSx, nSy )
170 cnh 1.1
171     #ifdef ALLOW_USE_MPI
172     C-- Include MPI standard Fortran header file
173     #include "mpif.h"
174     #define _mpiTRUE_ 1
175     #define _mpiFALSE_ 0
176    
177     C-- COMMON /EESUPP_MPI_I/ MPI parallel support integer globals
178     C mpiPidW - MPI process id for west neighbor.
179     C mpiPidE - MPI process id for east neighbor.
180     C mpiPidN - MPI process id for north neighbor.
181     C mpiPidS - MPI process id for south neighbor.
182     C mpiPidNW - MPI process id for northwest neighbor.
183     C mpiPidNE - MPI process id for northeast neighbor.
184     C mpiPidSW - MPI process id for southwest neighbor.
185     C mpiPidSE - MPI process id for southeast neighbor.
186     C mpiPidIO - MPI process to use for IO.
187     C mpiNprocs - No. of MPI processes.
188     C mpiMyId - MPI process id of me.
189     C mpiComm - MPI communicator to use.
190     C mpiPx - My MPI proc. grid X coord
191     C mpiPy - My MPI proc. grid Y coord
192     C mpiXGlobalLo - My bottom-left (south-west) x-coordinate in
193     C global domain.
194     C mpiYGlobalLo - My bottom-left (south-west) y-coordinate in
195     C global domain.
196     C mpiTypeXFaceBlock_xy_r4 - Primitives for communicating edge
197     C mpiTypeXFaceBlock_xy_r8 of a block.
198     C mpiTypeYFaceBlock_xy_r4 XFace is used in east-west transfer
199     C mpiTypeYFaceBlock_xy_r8 YFace is used in nrth-south transfer
200     C mpiTypeXFaceBlock_xyz_r4 xy is used in two-dimensional arrays
201     C mpiTypeXFaceBlock_xyz_r8 xyz is used with three-dimensional arrays
202     C mpiTypeYFaceBlock_xyz_r4 r4 is used for real*4 data
203     C mpiTypeYFaceBlock_xyz_r8 r8 is used for real*8 data
204     C mpiTypeXFaceThread_xy_r4 - Composites of the above primitives
205     C mpiTypeXFaceThread_xy_r8 for communicating edges of all blocks
206     C mpiTypeYFaceThread_xy_r4 owned by a thread.
207     C mpiTypeYFaceThread_xy_r8
208     C mpiTypeXFaceThread_xyz_r4
209     C mpiTypeXFaceThread_xyz_r8
210     C mpiTypeYFaceThread_xyz_r4
211     C mpiTypeYFaceBlock_xyz_r8
212     C mpiTagE - Tags are needed to mark requests when MPI is running
213     C mpiTagW between multithreaded processes or when the same process.
214     C mpiTagS is a neighbor in more than one direction. The tags ensure that
215     C mpiTagN a thread will get the message it is looking for.
216     C mpiTagSW The scheme adopted is to tag messages according to
217     C mpiTagSE the direction they are travelling. Thus a message
218     C mpiTagNW travelling east is tagged mpiTagE. However, in a
219     C mpiTagNE multi-threaded environemnt several messages could
220     C be travelling east from the same process at the
221     C same time. The tag is therefore modified to
222     C be mpiTag[EWS...]*nThreads+myThid. This requires that
223     C each thread also know the thread ids of its "neighbor"
224     C threads.
225     COMMON /EESUPP_MPI_I/
226     & mpiPidW, mpiPidE, mpiPidS, mpiPidN,
227     & mpiPidSE, mpiPidSW, mpiPidNE, mpiPidNW,
228     & mpiPidIo, mpiMyId, mpiNProcs, mpiComm,
229     & mpiPx, mpiPy, mpiXGlobalLo, mpiYGlobalLo,
230     & mpiTypeXFaceBlock_xy_r4, mpiTypeXFaceBlock_xy_r8,
231     & mpiTypeYFaceBlock_xy_r4, mpiTypeYFaceBlock_xy_r8,
232     & mpiTypeXFaceBlock_xyz_r4, mpiTypeXFaceBlock_xyz_r8,
233     & mpiTypeYFaceBlock_xyz_r4, mpiTypeYFaceBlock_xyz_r8,
234     & mpiTypeXFaceThread_xy_r4, mpiTypeXFaceThread_xy_r8,
235     & mpiTypeYFaceThread_xy_r4, mpiTypeYFaceThread_xy_r8,
236     & mpiTypeXFaceThread_xyz_r4, mpiTypeXFaceThread_xyz_r8,
237     & mpiTypeYFaceThread_xyz_r4, mpiTypeYFaceThread_xyz_r8,
238     & mpiTagE, mpiTagW, mpiTagN, mpiTagS,
239     & mpiTagSE, mpiTagSW, mpiTagNW, mpiTagNE
240    
241     INTEGER mpiPidW
242     INTEGER mpiPidE
243     INTEGER mpiPidS
244     INTEGER mpiPidN
245     INTEGER mpiPidSW
246     INTEGER mpiPidSE
247     INTEGER mpiPidNW
248     INTEGER mpiPidNE
249     INTEGER mpiPidIO
250     INTEGER mpiMyId
251     INTEGER mpiNProcs
252     INTEGER mpiComm
253     INTEGER mpiPx
254     INTEGER mpiPy
255     INTEGER mpiXGlobalLo
256     INTEGER mpiYGlobalLo
257     INTEGER mpiTypeXFaceBlock_xy_r4
258     INTEGER mpiTypeXFaceBlock_xy_r8
259     INTEGER mpiTypeYFaceBlock_xy_r4
260     INTEGER mpiTypeYFaceBlock_xy_r8
261     INTEGER mpiTypeXFaceBlock_xyz_r4
262     INTEGER mpiTypeXFaceBlock_xyz_r8
263     INTEGER mpiTypeYFaceBlock_xyz_r4
264     INTEGER mpiTypeYFaceBlock_xyz_r8
265     INTEGER mpiTypeXFaceThread_xy_r4(MAX_NO_THREADS)
266     INTEGER mpiTypeXFaceThread_xy_r8(MAX_NO_THREADS)
267     INTEGER mpiTypeYFaceThread_xy_r4(MAX_NO_THREADS)
268     INTEGER mpiTypeYFaceThread_xy_r8(MAX_NO_THREADS)
269     INTEGER mpiTypeXFaceThread_xyz_r4(MAX_NO_THREADS)
270     INTEGER mpiTypeXFaceThread_xyz_r8(MAX_NO_THREADS)
271     INTEGER mpiTypeYFaceThread_xyz_r4(MAX_NO_THREADS)
272     INTEGER mpiTypeYFaceThread_xyz_r8(MAX_NO_THREADS)
273     INTEGER mpiTagNW
274     INTEGER mpiTagNE
275     INTEGER mpiTagSW
276     INTEGER mpiTagSE
277     INTEGER mpiTagW
278     INTEGER mpiTagE
279     INTEGER mpiTagN
280     INTEGER mpiTagS
281 adcroft 1.5
282     C MPI communicator describing this model realization
283     COMMON /MPI_COMMS/
284     & MPI_COMM_MODEL
285     INTEGER MPI_COMM_MODEL
286 cnh 1.1 #endif /* ALLOW_USE_MPI */

  ViewVC Help
Powered by ViewVC 1.1.22