Warning, /pkg/exch2/exch2_recv_rx1.template is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit b9dadda2 on 2020-07-28 16:49:33 UTC
7dde890654 Jean*0001 #include "CPP_EEOPTIONS.h"
0002 #include "W2_OPTIONS.h"
046fd16d1c Andr*0003
ed81d0a43c Jean*0004 CBOP 0
0005 C !ROUTINE: EXCH2_RECV_RX1
0006
0007 C !INTERFACE:
046fd16d1c Andr*0008 SUBROUTINE EXCH2_RECV_RX1(
ed81d0a43c Jean*0009 I thisTile, nN,
0010 I e2BufrRecSize,
0011 I iBufr,
0012 O e2Bufr1_RX,
0013 I commSetting, myThid )
0014
0015 C !DESCRIPTION:
0016 C Scalar field (1 component) Exchange:
0017 C Receive into buffer exchanged data from the source Process.
0018 C buffer data will be used to fill in the tile-edge overlap region.
046fd16d1c Andr*0019
ed81d0a43c Jean*0020 C !USES:
046fd16d1c Andr*0021 IMPLICIT NONE
0022
7dde890654 Jean*0023 #include "SIZE.h"
0024 #include "EEPARAMS.h"
0025 #include "EESUPPORT.h"
90219e5912 Jean*0026 #include "W2_EXCH2_SIZE.h"
046fd16d1c Andr*0027 #include "W2_EXCH2_TOPOLOGY.h"
0028
ed81d0a43c Jean*0029 C !INPUT/OUTPUT PARAMETERS:
046fd16d1c Andr*0030 C === Routine arguments ===
d6ea3164dc Jean*0031 C thisTile :: receiving tile Id. number
ed81d0a43c Jean*0032 C nN :: Neighbour entry that we are processing
0033 C e2BufrRecSize :: Number of elements in each entry of e2Bufr1_RX
d6ea3164dc Jean*0034 C iBufr :: number of buffer elements to transfer
ed81d0a43c Jean*0035 C e2Bufr1_RX :: Data transport buffer array. This array is used in one of
0036 C :: two ways. For PUT communication the entry in the buffer
0037 C :: associated with the source for this receive (determined
0038 C :: from the opposing_send index) is read.
0039 C :: For MSG communication the entry in the buffer associated
0040 C :: with this neighbor of this tile is used as a receive
0041 C :: location for loading a linear stream of bytes.
0042 C commSetting :: Mode of communication used to exchange with this neighbor
0043 C myThid :: my Thread Id. number
0044
0045 INTEGER thisTile, nN
92307680ae Jean*0046 INTEGER e2BufrRecSize
ed81d0a43c Jean*0047 INTEGER iBufr
0048 _RX e2Bufr1_RX( e2BufrRecSize )
046fd16d1c Andr*0049 CHARACTER commSetting
ed81d0a43c Jean*0050 INTEGER myThid
0051 CEOP
046fd16d1c Andr*0052
ed81d0a43c Jean*0053 #ifdef ALLOW_USE_MPI
0054 C !LOCAL VARIABLES:
046fd16d1c Andr*0055 C == Local variables ==
ed81d0a43c Jean*0056 C soT :: Source tile Id. number
0057 C oNb :: Opposing send record number
0058 INTEGER soT
0059 INTEGER oNb
046fd16d1c Andr*0060
0061 C MPI setup
026642cc3c Jean*0062 INTEGER theTag, theType
0063 INTEGER sProc, tProc
046fd16d1c Andr*0064 INTEGER mpiStatus(MPI_STATUS_SIZE), mpiRc
026642cc3c Jean*0065 #ifdef W2_E2_DEBUG_ON
ed81d0a43c Jean*0066 CHARACTER*(MAX_LEN_MBUF) msgBuf
026642cc3c Jean*0067 #endif
046fd16d1c Andr*0068
ed81d0a43c Jean*0069 soT = exch2_neighbourId(nN, thisTile )
0070 oNb = exch2_opposingSend(nN, thisTile )
046fd16d1c Andr*0071
ed81d0a43c Jean*0072 C Handle receive end data transport according to communication mechanism
0073 C between source and target tile
0074 IF ( commSetting .EQ. 'M' ) THEN
046fd16d1c Andr*0075 C Setup MPI stuff here
ed81d0a43c Jean*0076 theTag = (soT-1)*W2_maxNeighbours + oNb
0b153c4cea Jean*0077 tProc = W2_tileProc(thisTile)-1
0078 sProc = W2_tileProc(soT)-1
92307680ae Jean*0079 theType = _MPI_TYPE_RX
ed81d0a43c Jean*0080 CALL MPI_Recv( e2Bufr1_RX, iBufr, theType, sProc,
0081 & theTag, MPI_COMM_MODEL, mpiStatus, mpiRc )
046fd16d1c Andr*0082 #ifdef W2_E2_DEBUG_ON
b9dadda204 Mart*0083 WRITE(msgBuf,'(A,I8,A,I8,A)')
ed81d0a43c Jean*0084 & ' RECV FROM TILE=', soT, ' (proc = ',sProc,')'
0085 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0086 I SQUEEZE_RIGHT, myThid )
b9dadda204 Mart*0087 WRITE(msgBuf,'(A,I8,A,I8,A)')
ed81d0a43c Jean*0088 & ' INTO TILE=', thisTile, ' (proc = ',tProc,')'
0089 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0090 I SQUEEZE_RIGHT, myThid )
0091 WRITE(msgBuf,'(A,I10)') ' TAG=', theTag
0092 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0093 I SQUEEZE_RIGHT, myThid )
b9dadda204 Mart*0094 WRITE(msgBuf,'(A,I8)') ' NEL=', iBufr
ed81d0a43c Jean*0095 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0096 I SQUEEZE_RIGHT, myThid )
046fd16d1c Andr*0097 #endif /* W2_E2_DEBUG_ON */
0098 ENDIF
ed81d0a43c Jean*0099 #endif /* ALLOW_USE_MPI */
92307680ae Jean*0100
046fd16d1c Andr*0101 RETURN
0102 END
2ad152b417 Ed H*0103
0104 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
0105
0106 CEH3 ;;; Local Variables: ***
0107 CEH3 ;;; mode:fortran ***
0108 CEH3 ;;; End: ***