59 TYPE(t_region
),
POINTER :: regions(:)
67 CHARACTER(CHRLEN) :: rcsidentstring
70 INTEGER :: statusplag(mpi_status_size)
73 INTEGER :: bctype, ilev, ipatchdes,iregdes, irequestplag, &
74 narv, naiv, nbuffi, nbuffr, nbuffsizesrc, ncont, &
75 ncv, ndimbuffsize, ndv, npatches,nsendbuffi, &
76 nsendbuffr, ntv, procdes, tagdes
78 TYPE(t_patch),
POINTER :: patchsrc, patchdes
79 TYPE(t_plag),
POINTER :: pplag
84 rcsidentstring =
'$RCSfile: PLAG_BufferSizeSend.F90,v $ $Revision: 1.4 $'
86 global => regions(ireg)%global
89 'PLAG_BufferSizeSend.F90' )
93 ncont = regions(ireg)%plagInput%nCont
94 ncv = cv_plag_last + ncont
101 nbuffr = 2*narv +4*ncv +ndv +ntv
104 ilev = regions(ireg)%currLevel
105 npatches = regions(ireg)%nPatches
107 pplag => regions(ireg)%levels(ilev)%plag
111 DO ipatch = 1, npatches
115 patchsrc => regions(ireg)%levels(ilev)%patches(ipatch)
117 bctype = patchsrc%bcType
118 iregdes = patchsrc%srcRegion
119 ipatchdes = patchsrc%srcPatch
123 IF ( (bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
124 (bctype>=bc_regionint .AND. bctype<=bc_regionint +bc_range) .OR. &
125 (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range) .OR. &
126 (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
127 (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range) )
THEN
129 IF ( regions(iregdes)%procid /= global%myProcid )
THEN
130 patchdes => regions(iregdes)%levels(ilev)%patches(ipatchdes)
132 nbuffsizesrc = patchsrc%bufferPlag%nBuffSize
134 nsendbuffi = nbuffi *nbuffsizesrc
135 nsendbuffr = nbuffr *nbuffsizesrc
137 patchsrc%bufferPlag%nSendBuffI = nsendbuffi
138 patchsrc%bufferPlag%nSendBuffR = nsendbuffr
140 irequestplag = patchsrc%bufferPlag%iRequest
142 #ifdef PLAG_MPI_DEBUG
143 IF( nbuffsizesrc /= 0 ) &
144 WRITE(stdout,*)
' PLAG_BufferSizeSend: iReg, nBuffSizeSrc, nDimBuffSize, iRequestPlag = ',&
145 ireg, nbuffsizesrc, ndimbuffsize, irequestplag
149 procdes = regions(iregdes)%procid
150 tagdes = regions(iregdes)%localNumber &
151 + plag_tag_shift +mpi_patchoff*ipatchdes*iregdes + procdes
153 IF(tagdes .gt. global%mpiTagMax) tagdes = mod(tagdes,global%mpiTagMax)
155 #ifdef PLAG_MPI_DEBUG
156 IF( nbuffsizesrc /= 0 ) &
157 WRITE(stdout,*)
' PLAG_BufferSizeSend: iReg, iRegDes, procDes, tagDes = ',&
158 ireg, iregdes, procdes,tagdes
161 CALL mpi_isend( patchsrc%bufferPlag%nBuffSize, &
162 ndimbuffsize,mpi_integer, &
163 procdes,tagdes,global%mpiComm, &
164 pplag%requests(irequestplag),global%mpierr )
166 IF (global%mpierr /= err_none) &
167 CALL
errorstop( global,err_mpi_trouble,__line__ )
subroutine registerfunction(global, funName, fileName)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine plag_buffersizesend(regions, iReg)