/[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.7 - (hide annotations) (download)
Fri Sep 21 03:54:35 2001 UTC (22 years, 7 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint51k_post, checkpoint47e_post, checkpoint52l_pre, checkpoint44e_post, hrcube4, hrcube5, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, release1_p13_pre, checkpoint50c_post, checkpoint46f_post, checkpoint52d_pre, checkpoint48e_post, checkpoint50c_pre, checkpoint44f_post, checkpoint46b_post, checkpoint52j_pre, checkpoint43a-release1mods, checkpoint51o_pre, ecco_c50_e32, ecco_c50_e33, ecco_c50_e30, ecco_c50_e31, release1_p13, checkpoint51l_post, checkpoint48i_post, checkpoint46l_pre, checkpoint52l_post, checkpoint52k_post, chkpt44d_post, checkpoint51, checkpoint50, checkpoint52, release1_p8, release1_p9, checkpoint50d_post, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint52f_post, checkpoint50b_pre, checkpoint44e_pre, checkpoint51f_post, release1_b1, ecco_c51_e34d, ecco_c51_e34e, ecco_c51_e34f, ecco_c51_e34g, ecco_c51_e34a, ecco_c51_e34b, ecco_c51_e34c, checkpoint48b_post, checkpoint43, checkpoint51d_post, checkpoint48c_pre, checkpoint47d_pre, checkpoint51t_post, checkpoint51n_post, release1_chkpt44d_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint47a_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint52e_pre, release1_p11, checkpoint52e_post, checkpoint51n_pre, checkpoint47d_post, icebear5, icebear4, icebear3, icebear2, checkpoint46d_pre, checkpoint48d_post, release1-branch_tutorials, checkpoint48f_post, checkpoint45d_post, checkpoint52b_pre, checkpoint46j_pre, checkpoint51l_pre, checkpoint52m_post, chkpt44a_post, checkpoint44h_pre, checkpoint48h_post, checkpoint51q_post, ecco_c50_e29, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, checkpoint52b_post, checkpoint52c_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, ecco_c50_e28, chkpt44c_pre, checkpoint48a_post, checkpoint45a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint52f_pre, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, release1_p12, release1_p10, release1_p16, release1_p17, release1_p14, release1_p15, checkpoint47j_post, ecco_c50_e33a, branch-exfmods-tag, checkpoint44g_post, branchpoint-genmake2, checkpoint46e_pre, checkpoint51r_post, checkpoint48c_post, checkpoint45b_post, checkpoint46b_pre, checkpoint51i_post, release1-branch-end, release1_final_v1, checkpoint51b_post, checkpoint51c_post, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint44b_post, ecco_c51_e34, checkpoint46h_pre, checkpoint52d_post, checkpoint46m_post, checkpoint46a_pre, checkpoint50g_post, checkpoint45c_post, ecco_ice2, ecco_ice1, checkpoint44h_post, checkpoint46g_post, release1_p12_pre, checkpoint52a_pre, ecco_c44_e22, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, ecco_c44_e25, checkpoint51i_pre, checkpoint52h_pre, checkpoint52j_post, checkpoint47f_post, checkpoint50e_post, chkpt44a_pre, checkpoint46i_post, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, checkpoint46c_post, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, branch-netcdf, checkpoint50d_pre, checkpoint46e_post, release1_beta1, checkpoint51e_post, checkpoint44b_pre, checkpoint42, checkpoint41, checkpoint47, checkpoint44, checkpoint45, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint51o_post, checkpoint51f_pre, chkpt44c_post, checkpoint48g_post, checkpoint47h_post, checkpoint52a_post, checkpoint44f_pre, checkpoint51g_post, ecco_c52_e35, checkpoint46d_post, checkpoint50b_post, release1-branch_branchpoint, checkpoint51m_post, checkpoint51a_post, checkpoint51p_post, checkpoint51u_post
Branch point for: c24_e25_ice, branch-exfmods-curt, release1_final, release1-branch, branch-genmake2, release1, branch-nonh, tg2-branch, ecco-branch, release1_50yr, netcdf-sm0, icebear, checkpoint51n_branch, release1_coupled
Changes since 1.6: +12 -6 lines
File MIME type: text/plain
Starting to bring comments up to date and format comments
for document extraction of "prototypes".

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

  ViewVC Help
Powered by ViewVC 1.1.22