/[MITgcm]/MITgcm/pkg/exch2/exch2_send_rx1.template
ViewVC logotype

Contents of /MITgcm/pkg/exch2/exch2_send_rx1.template

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


Revision 1.13 - (show annotations) (download)
Tue Sep 4 00:45:25 2012 UTC (11 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63s, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.12: +3 -3 lines
rename "exch2_tProc" to "W2_tileProc"

1 C $Header: /u/gcmpack/MITgcm/pkg/exch2/exch2_send_rx1.template,v 1.12 2010/04/23 20:21:07 jmc Exp $
2 C $Name: $
3
4 #include "CPP_EEOPTIONS.h"
5 #include "W2_OPTIONS.h"
6
7 CBOP 0
8 C !ROUTINE: EXCH2_SEND_RX1
9
10 C !INTERFACE:
11 SUBROUTINE EXCH2_SEND_RX1 (
12 I thisTile, nN,
13 I e2BufrRecSize,
14 I iBufr,
15 I e2Bufr1_RX,
16 O e2_msgHandle,
17 I commSetting, myThid )
18
19 C !DESCRIPTION:
20 C Scalar field (1 component) Exchange:
21 C Send buffer to the target Process.
22 C buffer has been previously filled with interior data point
23 C corresponding to the target-neighbour-edge overlap region.
24
25 C !USES:
26 IMPLICIT NONE
27
28 #include "SIZE.h"
29 #include "EEPARAMS.h"
30 #include "EESUPPORT.h"
31 #include "W2_EXCH2_SIZE.h"
32 #include "W2_EXCH2_TOPOLOGY.h"
33
34 C !INPUT/OUTPUT PARAMETERS:
35 C === Routine arguments ===
36 C thisTile :: sending tile Id. number
37 C nN :: Neighbour entry that we are processing
38 C e2BufrRecSize :: Number of elements in each entry of e2Bufr1_RX
39 C iBufr :: number of buffer elements to transfer
40 C e2Bufr1_RX :: Data transport buffer array. This array is used in one of
41 C :: two ways. For PUT communication the entry in the buffer
42 C :: associated with the source for this receive (determined
43 C :: from the opposing_send index) is read.
44 C :: For MSG communication the entry in the buffer associated
45 C :: with this neighbor of this tile is used as a receive
46 C :: location for loading a linear stream of bytes.
47 C e2_msgHandles :: Synchronization and coordination data structure used to
48 C :: coordinate access to e2Bufr1_RX or to regulate message
49 C :: buffering. In PUT communication sender will increment
50 C :: handle entry once data is ready in buffer. Receiver will
51 C :: decrement handle once data is consumed from buffer.
52 C :: For MPI MSG communication MPI_Wait uses handle to check
53 C :: Isend has cleared. This is done in routine after receives.
54 C commSetting :: Mode of communication used to exchange with this neighbor
55 C myThid :: my Thread Id. number
56
57 INTEGER thisTile, nN
58 INTEGER e2BufrRecSize
59 INTEGER iBufr
60 _RX e2Bufr1_RX( e2BufrRecSize )
61 INTEGER e2_msgHandle(1)
62 CHARACTER commSetting
63 INTEGER myThid
64 CEOP
65
66 #ifdef ALLOW_USE_MPI
67 C !LOCAL VARIABLES:
68 C == Local variables ==
69 C tgT :: Target tile
70 INTEGER tgT
71
72 C MPI setup
73 INTEGER theTag, theType, theHandle
74 INTEGER sProc, tProc, mpiRc
75 #ifdef W2_E2_DEBUG_ON
76 CHARACTER*(MAX_LEN_MBUF) msgBuf
77 #endif
78
79 tgT = exch2_neighbourId(nN, thisTile )
80
81 C Do data transport depending on communication mechanism between
82 C source and target tile
83 IF ( commSetting .EQ. 'M' ) THEN
84 C Setup MPI stuff here
85 theTag = (thisTile-1)*W2_maxNeighbours + nN
86 tProc = W2_tileProc(tgT)-1
87 sProc = W2_tileProc(thisTile)-1
88 theType = _MPI_TYPE_RX
89 #ifdef W2_E2_DEBUG_ON
90 WRITE(msgBuf,'(A,I5,A,I5,A)')
91 & ' SEND FROM TILE=', thisTile, ' (proc =',sProc,')'
92 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
93 I SQUEEZE_RIGHT, myThid)
94 WRITE(msgBuf,'(A,I5,A,I5,A)')
95 & ' TO TILE=', tgT ' (proc =',tProc,')'
96 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
97 I SQUEEZE_RIGHT, myThid)
98 WRITE(msgBuf,'(A,I10)') ' TAG=', theTag
99 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
100 I SQUEEZE_RIGHT, myThid)
101 WRITE(msgBuf,'(A,I4)') ' NEL=', iBufr
102 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
103 I SQUEEZE_RIGHT, myThid)
104 #endif /* W2_E2_DEBUG_ON */
105 CALL MPI_Isend( e2Bufr1_RX, iBufr, theType,
106 I tProc, theTag, MPI_COMM_MODEL,
107 O theHandle, mpiRc )
108 C Store MPI_Wait token in messageHandle.
109 e2_msgHandle(1) = theHandle
110 ENDIF
111 #endif /* ALLOW_USE_MPI */
112
113 RETURN
114 END
115
116 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
117
118 CEH3 ;;; Local Variables: ***
119 CEH3 ;;; mode:fortran ***
120 CEH3 ;;; End: ***

  ViewVC Help
Powered by ViewVC 1.1.22