45 1 IFQ,INACTI,NSNFIOLD,INTTH,ITYP,STFNS, NSV,
47 2 ITIED,NMN,INTER_STRUCT,SORT_COMM, GOT_PREVIEW)
69 USE spmd_comm_world_mod,
ONLY : spmd_comm_world
70#include "implicit_f.inc"
81#include "timeri_c.inc"
85 TYPE(timer_) :: TIMERS
86 INTEGER NIN, IFQ, INACTI, IGAP,INTTH,,NSNR,
89 . isendto(ninter+1,nspmd+1), ircvfrom(ninter+1,nspmd+1),
91 INTEGER :: GOT_PREVIEW
93 TYPE(inter_struct_type),
DIMENSION(NINTER),
INTENT(inout) :: INTER_STRUCT
94 TYPE(),
DIMENSION(NINTER),
INTENT(inout) :: SORT_COMM
103 INTEGER MSGTYP, LOC_PROC, P, IDEB,
105 . STATUS(MPI_STATUS_SIZE),IERROR,
109 . rsiz, isiz, req_rd2(nspmd),
114 INTEGER :: OFFSET(NSPMD)
126 IF(inacti==5.OR.inacti==6.OR.inacti==7.OR.ifq>0
127 . .OR.itied/=0.OR.ityp==23.OR.ityp==24
130 nsnfiold(p) = inter_struct(nin)%NSNFIOLD(p)
133 nsnr = sort_comm(nin)%NSNR
134 offset(1:nspmd) = nsnr+1
137 IF(.NOT. (ircvfrom(nin,loc_proc)==0.AND.isendto(nin,loc_proc)==0))
THEN
139 IF (imonm > 0)
CALL startime(timers,25)
144 IF(ircvfrom(nin,loc_proc)/=0)
THEN
146 rsiz = sort_comm(nin)%RSIZ
147 isiz = sort_comm(nin)%ISIZ
151 ALLOCATE(xrem(rsiz,nsnr),stat=ierror)
152 ALLOCATE(
irem(isiz,nsnr),stat=ierror)
156 CALL ancmsg(msgid=20,anmode=aninfo)
160 DO l = 1, sort_comm(nin)%NBIRECV
161 p = sort_comm(nin)%ISINDEXI(l)
162 len =
nsnfi(nin)%P(p)*rsiz
166 1 xrem(1,ideb),len,real,it_spmd(p),
167 2 msgtyp,spmd_comm_world,req_rd(l),ierror)
169 len2 =
nsnfi(nin)%P(p)*isiz
172 1
irem(1,ideb),len2,mpi_integer,it_spmd(p),
173 2 msgtyp,spmd_comm_world,req_rd2(l),ierror)
174 ideb = ideb +
nsnfi(nin)%P(p)
184 IF(sort_comm(nin)%NB(p)/=0 )
THEN
186 size_s = sort_comm(nin)%NB(p) * sort_comm(nin)%RSIZ
188 1 sort_comm(nin)%DATA_PROC(p)%RBUF(1),size_s,real,it_spmd(p),msgtyp,
189 2 spmd_comm_world,sort_comm(nin)%REQ_SD2(p),ierror)
191 size_s = sort_comm(nin)%NB(p) * sort_comm(nin)%ISIZ
193 1 sort_comm(nin)%DATA_PROC(p)%IBUF(1),size_s,mpi_integer,
195 3 spmd_comm_world,sort_comm(nin)%REQ_SD3(p),ierror)
202 if(got_preview == 1)
THEN
204 CALL fill_voxel_local_partial(nsn,nsv,nsnr,nrtm,numnod,x,stfns,inter_struct(nin),dummy,0)
210 IF(ircvfrom(nin,loc_proc)/=0)
THEN
212 DO l = 1, sort_comm(nin)%NBIRECV
213 CALL mpi_waitany(sort_comm(nin)%NBIRECV,req_rd,indexi,status,ierror)
217 if(got_preview==1)
then
218 call fill_voxel_remote(
220 . offset(indexi+1)-1,
223 . inter_struct(nin)%nbx,
224 . inter_struct(nin)%nby,
225 . inter_struct(nin)%nbz,
227 . inter_struct(nin)%voxel,
228 . inter_struct(nin)%next_nod,
229 . inter_struct(nin)%size_node,
230 . inter_struct(nin)%nb_voxel_on,
231 . inter_struct(nin)%list_nb_voxel_on,
232 . inter_struct(nin)%last_nod,
234 . inter_struct(nin)%box_limit_main)
236 CALL mpi_wait(req_rd2(indexi),status,ierror)
250 IF(isendto(nin,loc_proc)/=0)
THEN
252 IF(ircvfrom(nin,p)/=0)
THEN
254 IF(sort_comm(nin)%NB(p)/=0)
THEN
256 CALL mpi_wait(sort_comm(nin)%REQ_SD2(p),status,ierror)
257 DEALLOCATE(sort_comm(nin)%DATA_PROC(p)%RBUF)
259 CALL mpi_wait(sort_comm(nin)%REQ_SD3(p),status,ierror)
260 DEALLOCATE(sort_comm(nin)%DATA_PROC(p)%IBUF)
261 sort_comm(nin)%NB(p) = 0
271 if(got_preview == 1)
THEN
273 CALL fill_voxel_local_partial(nsn,nsv,nsnr,nrtm,numnod,x,stfns,inter_struct(nin),dummy,0)
278 IF (imonm > 0)
CALL stoptime(timers,25)
subroutine spmd_cell_exchange(timers, nin, isendto, ircvfrom, nsn, nsnr, igap, ifq, inacti, nsnfiold, intth, ityp, stfns, nsv, nrtm, x, itied, nmn, inter_struct, sort_comm, got_preview)
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)