54 USE moddatastruct, ONLY : t_dcell, t_dcelltransf, t_region, t_level
72 TYPE(t_region
),
POINTER :: regions(:)
74 INTEGER,
INTENT(IN) :: ireg
80 CHARACTER(CHRLEN) :: rcsidentstring
82 INTEGER :: dest,ilev,ir,iregdes,iregsrc,irequestplag,tagi,tagr
83 INTEGER :: nbuffsizecornsrc,nbuffsizeedgesrc,nbuffsizetotsrc
84 INTEGER :: narv,naiv,ncont,ncv,ndimi,ndimr,nsendbuffi,nsendbuffr
85 INTEGER,
POINTER,
DIMENSION(:) :: psendbuffi
87 REAL(RFREAL),
POINTER,
DIMENSION(:) :: psendbuffr
89 TYPE(t_dcelltransf
),
POINTER :: psendeccell
91 TYPE(t_level
),
POINTER :: plevelsrc
92 TYPE(t_plag),
POINTER :: pplag
93 TYPE(t_region
),
POINTER :: pregionsrc
99 rcsidentstring =
'$RCSfile: PLAG_CECellsSendData.F90,v $ $Revision: 1.4 $'
101 global => regions(ireg)%global
104 'PLAG_CECellsSendData.F90' )
110 ilev = regions(ireg)%currLevel
120 pregionsrc => regions(ireg)
121 plevelsrc => pregionsrc%levels(ilev)
122 pplag => plevelsrc%plag
133 ndimr = 2*narv +4*ncv
139 DO ir=1,global%nRegions
140 IF (regions(ir)%procid == global%myProcid) goto 999
142 IF ( plevelsrc%sendEcCells(ir)%nCells > 0 )
THEN
143 psendeccell => plevelsrc%sendEcCells(ir)
144 psendbuffi => psendeccell%buffplagI
145 psendbuffr => psendeccell%buffplagR
151 IF ( psendeccell%nBuffSizePlag == 0 ) goto 1999
170 nbuffsizetotsrc= nbuffsizecornsrc+nbuffsizeedgesrc
171 IF ( nbuffsizetotsrc /= psendeccell%nBuffSizePlag )
THEN
172 WRITE(stdout,*)
'PLAG_CECellsSendData: Error inconsistent buffer sizes'
173 WRITE(stdout,*)
' nBuffSizeEdgeSrc = ', nbuffsizeedgesrc
174 WRITE(stdout,*)
' nBuffSizeCornSrc = ', nbuffsizecornsrc
175 WRITE(stdout,*)
' nBuffSizeTotSrc = ', nbuffsizetotsrc
176 WRITE(stdout,*)
' pSendEcCell%nBuffSizePlag = ', psendeccell%nBuffSizePlag
181 CALL mpi_finalize(global%mpierr)
191 nsendbuffi = ndimi * psendeccell%nBuffSizePlag
192 nsendbuffr = ndimr * psendeccell%nBuffSizePlag
194 irequestplag = psendeccell%iRequestPlag
197 dest = regions(ir)%procid
203 tagi = regions(ir)%localNumber +plag_tag_shift +mpi_patchoff +2000
205 IF(tagi .gt. global%mpiTagMax) tagi = mod(tagi,global%mpiTagMax)
207 #ifdef PLAG_CECELLS_MPI_DEBUG
208 WRITE(stdout,
'(A,A,7(2X,I5))') &
209 ' PLAG_CECellsSendData-INT: iRegDes, iRegSrc, procDes, procSrc,',&
210 'tagSrc, nBuffSizePlag,nSendBuffI = ',&
211 ir, ireg, dest, global%myProcid,tagi, psendeccell%nBuffSizePlag,nsendbuffi
214 CALL mpi_isend( psendbuffi,nsendbuffi,mpi_integer, &
215 dest,tagi,global%mpiComm, &
216 pplag%requestsCECellsI(irequestplag),global%mpierr )
217 IF ( global%mpierr /= err_none ) &
218 CALL
errorstop( global,err_mpi_trouble,__line__ )
224 tagr = regions(ir)%localNumber +plag_tag_shift +mpi_patchoff +3000
225 IF(tagr .gt. global%mpiTagMax) tagr = mod(tagr,global%mpiTagMax)
227 #ifdef PLAG_CECELLS_MPI_DEBUG
228 WRITE(stdout,
'(A,A,7(2X,I5))') &
229 ' PLAG_CECellsSendData-REAL: iRegDes, iRegSrc, procDes, procSrc,',&
230 'tagSrc, nBuffSizePlag,nSendBuffR = ',&
231 ir, ireg, dest, global%myProcid,tagr, psendeccell%nBuffSizePlag,nsendbuffr
234 CALL mpi_isend( psendbuffr,nsendbuffr,mpi_rfreal, &
235 dest,tagr,global%mpiComm, &
236 pplag%requestsCECellsR(irequestplag),global%mpierr )
237 IF ( global%mpierr /= err_none ) &
238 CALL
errorstop( global,err_mpi_trouble,__line__ )
subroutine plag_edgecellsloadsendbuff(regions, iReg, ir, nBuffSizeEdge)
subroutine registerfunction(global, funName, fileName)
subroutine plag_cecellssenddata(regions, iReg)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine plag_corncellsloadsendbuff(regions, iReg, ir, nBuffSizeEdge, nBuffSizeCorn)