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,NSN,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
103 INTEGER MSGTYP,INFO,I,NOD, DT_CST, LOC_PROC,P,IDEB,
104 . SIZ,J, L, BUFSIZ, LEN, NB, IERROR1, IAD,
105 . STATUS(MPI_STATUS_SIZE),IERROR,REQ_SB(NSPMD),
106 . req_rb(nspmd),kk,nbirecv,irindexi(nspmd),
107 . req_rd(nspmd),req_sd(nspmd),
108 . req_rc(nspmd),req_sc(nspmd),
109 . indexi,isindexi(nspmd),
110 . msgoff, msgoff2, msgoff3, msgoff4, msgoff5,
111 . rsiz, isiz, l2, req_rd2(nspmd),
112 . len2, rshift, ishift, nd, jdeb, q, nbb
121 . xmaxb,ymaxb,zmaxb,xminb,yminb,zminb
123 INTEGER,
DIMENSION(:),
ALLOCATABLE :: ITAGNSNFI
124 my_real,
DIMENSION(:,:),
ALLOCATABLE :: XTMP
125 INTEGER :: ADRESS, LOCAL_RANK
127 INTEGER :: OFFSET(NSPMD)
139 IF(inacti==5.OR.inacti==6.OR.inacti==7.OR.ifq>0
140 . .OR.itied/=0.OR.ityp==23.OR.ityp==24
143 nsnfiold(p) = inter_struct(nin)%NSNFIOLD(p)
146 nsnr = sort_comm(nin)%NSNR
147 offset(1:nspmd) = nsnr+1
150 IF(.NOT. (ircvfrom(nin,loc_proc)==0.AND.isendto(nin,loc_proc)==0))
THEN
152 IF (imonm > 0)
CALL startime(timers,25)
157 IF(ircvfrom(nin,loc_proc)/=0)
THEN
159 rsiz = sort_comm(nin)%RSIZ
160 isiz = sort_comm(nin)%ISIZ
164 ALLOCATE(xrem(rsiz,nsnr),stat=ierror)
165 ALLOCATE(
irem(isiz,nsnr),stat=ierror)
169 CALL ancmsg(msgid=20,anmode=aninfo)
173 DO l = 1, sort_comm(nin)%NBIRECV
174 p = sort_comm(nin)%ISINDEXI(l)
175 len =
nsnfi(nin)%P(p)*rsiz
179 1 xrem(1,ideb),len,real,it_spmd(p),
180 2 msgtyp,spmd_comm_world,req_rd(l),ierror)
182 len2 =
nsnfi(nin)%P(p)*isiz
185 1
irem(1,ideb),len2,mpi_integer,it_spmd(p),
186 2 msgtyp,spmd_comm_world,req_rd2(l),ierror)
187 ideb = ideb +
nsnfi(nin)%P(p)
197 IF(sort_comm(nin)%NB(p)/=0 )
THEN
199 size_s = sort_comm(nin)%NB(p) * sort_comm(nin)%RSIZ
201 1 sort_comm(nin)%DATA_PROC(p)%RBUF(1),size_s,real,it_spmd(p),msgtyp,
202 2 spmd_comm_world,sort_comm(nin)%REQ_SD2(p),ierror)
204 size_s = sort_comm(nin)%NB(p) * sort_comm(nin)%ISIZ
206 1 sort_comm(nin)%DATA_PROC(p)%IBUF(1),size_s,mpi_integer,
208 3 spmd_comm_world,sort_comm(nin)%REQ_SD3(p),ierror)
215 if(got_preview == 1)
THEN
217 CALL fill_voxel_local_partial(nsn,nsv,nsnr,nrtm,numnod,x,stfns,inter_struct(nin),dummy,0)
223 IF(ircvfrom(nin,loc_proc)/=0)
THEN
225 DO l = 1, sort_comm(nin)%NBIRECV
226 CALL mpi_waitany(sort_comm(nin)%NBIRECV,req_rd,indexi,status,ierror)
230 if(got_preview==1)
then
231 call fill_voxel_remote(
233 . offset(indexi+1)-1,
236 . inter_struct(nin)%nbx,
237 . inter_struct(nin)%nby,
238 . inter_struct(nin)%nbz,
240 . inter_struct(nin)%voxel,
241 . inter_struct(nin)%next_nod,
242 . inter_struct(nin)%size_node,
243 . inter_struct(nin)%nb_voxel_on,
244 . inter_struct(nin)%list_nb_voxel_on,
245 . inter_struct(nin)%last_nod,
247 . inter_struct(nin)%box_limit_main)
263 IF(isendto(nin,loc_proc)/=0)
THEN
265 IF(ircvfrom(nin,p)/=0)
THEN ! nmn >0
267 IF(sort_comm(nin)%NB(p)/=0)
THEN
269 CALL mpi_wait(sort_comm(nin)%REQ_SD2(p),status,ierror)
270 DEALLOCATE(sort_comm(nin)%DATA_PROC(p)%RBUF)
272 CALL mpi_wait(sort_comm(nin)%REQ_SD3(p),status,ierror)
273 DEALLOCATE(sort_comm(nin)%DATA_PROC(p)%IBUF)
274 sort_comm(nin)%NB(p) = 0
284 if(got_preview == 1)
THEN
286 CALL fill_voxel_local_partial(nsn,nsv,nsnr,nrtm,numnod,x,stfns,inter_struct(nin),dummy,0)
291 IF (imonm > 0)
CALL stoptime(timers,25)
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)