32 integer libuf, lrbuf, lptn
33 parameter(libuf = 5, lrbuf = 2*ldim, lptn=lx1*ly1*lz1*lelt)
34 integer ibuf(libuf,lptn)
37 common /scrmg/ ibuf, mid
43 $
write(6,*)
'Error: pts_rdst; insufficient buffer size'
54 mid(il) = tsrs_proc(il)
58 call pts_map_all(mid,lptn,tsrs_npts,tsrs_nptot,nptimb)
64 ibuf(2,il) = tsrs_ipts(il)
65 ibuf(3,il) = tsrs_proc(il)
66 ibuf(4,il) = tsrs_elid(il)
67 ibuf(5,il) = tsrs_rcode(il)
74 rbuf(1,il) = tsrs_pts(1,il)
75 rbuf(2,il) = tsrs_pts(2,il)
76 rbuf(3,il) = tsrs_pts(3,il)
77 rbuf(4,il) = tsrs_rst(itmp+1)
78 rbuf(5,il) = tsrs_rst(itmp+2)
79 rbuf(6,il) = tsrs_rst(itmp+3)
84 rbuf(1,il) = tsrs_pts(1,il)
85 rbuf(2,il) = tsrs_pts(2,il)
86 rbuf(3,il) = tsrs_rst(itmp+1)
87 rbuf(4,il) = tsrs_rst(itmp+2)
97 tsrs_ipts(il) = ibuf(2,il)
98 tsrs_proc(il) = ibuf(3,il)
99 tsrs_elid(il) = ibuf(4,il)
100 tsrs_rcode(il) = ibuf(5,il)
107 tsrs_pts(1,il) = rbuf(1,il)
108 tsrs_pts(2,il) = rbuf(2,il)
109 tsrs_pts(3,il) = rbuf(3,il)
110 tsrs_rst(itmp+1) = rbuf(4,il)
111 tsrs_rst(itmp+2) = rbuf(5,il)
112 tsrs_rst(itmp+3) = rbuf(6,il)
117 tsrs_pts(1,il) = rbuf(1,il)
118 tsrs_pts(2,il) = rbuf(2,il)
119 tsrs_rst(itmp+1) = rbuf(3,il)
120 tsrs_rst(itmp+2) = rbuf(4,il)
139 real rbuf(lrbuf,lpts)
140 integer ibuf(libuf,lpts)
141 integer lrbuf, libuf, lpts
150 real ltime1, ltime2, timemaxs, timemins
153 integer iglmin, iglmax
154 real dnekclock, glmax, glmin
160 call fgslib_crystal_tuple_transfer
161 $ (cr_h,npts,lpts,ibuf,libuf,vl,0,rbuf,lrbuf,1)
164 itmp1 = iglmin(npts,1)
165 itmp2 = iglmax(npts,1)
169 ltime2 = ltime2 - ltime1
170 timemaxs = glmax(ltime2,1)
171 timemins = glmin(ltime2,1)
176 write(6,*)
'Point redistribution; pts_transfer_min:'
177 write(6,
'(A22,I7,I7)')
'New loc pts nr min/max', itmp1, itmp2
178 write(6,
'(A22,g13.5,g13.5)')
'Sending time min/max ',
199 parameter(lptn=2*lx1*ly1*lz1*lelt)
200 integer npts_plist(lptn)
201 common /scrvh/ npts_plist
211 integer nptav, nptmod
213 common /istat_pts_avm/ nptav, nptmod, nptmax
215 integer nptgdone, nptgundone
216 integer nptldone, nptlundone
217 common /istat_pts_done/ nptgdone, nptgundone, nptldone,
220 integer nptover, nptempty, nptshift
221 common /istat_pts_oes/ nptover, nptempty, nptshift
229 integer nloop, nloopmod
239 real ltime1, ltime2, timemax, timemin
242 integer iglsum, iglmin, iglmax
243 real dnekclock, glmax, glmin
255 nptmod = mod(npoints,np)
256 if (nptmod.gt.0)
then
264 nptmax = min(nptav1 + nptimb,lhis)
267 if (nptav1.gt.lhis) ierr = 1
270 if(nio.eq.0)
write(6,*)
271 $
'Error: pts_map_all; wrong nptav'
293 nloopmod = mod(np,lptn)
301 npts_plist(ipr) = ipr-1
312 $ npts_plist,lptn,npts,nplist)
316 if (nptgdone.ne.npoints)
then
317 if(nio.eq.0)
write(6,*)
318 $
'Error: pts_map_all; not all points redist.'
324 if (nptldone.ne.npts) ierr = 1
327 if(nio.eq.0)
write(6,*)
328 $
'Error: pts_map_all; wrong nptldone'
333 if(nptover.ne.0)
then
334 if(nio.eq.0)
write(6,*)
335 $
'Error: pts_map_all; global overflow'
341 if (istatus.gt.0) ierr = istatus
344 if(nio.eq.0)
write(6,*)
345 $
'Error: pts_map_all; node overflow'
350 ipr = iglmin(indasg,1)
351 ipt = iglmax(indasg,1)
354 if(nio.eq.0)
write(6,*)
355 $
'Error: pts_map_all; untuched nodes'
366 if(nio.eq.0)
write(6,*)
367 $
'Error: pts_map_all unsupported option'
374 ltime1 = ltime2 - ltime1
375 timemax = glmax(ltime1,1)
376 timemin = glmin(ltime1,1)
379 ierr = iglmin(npts,1)
380 itmp = iglmax(npts,1)
385 write(6,*)
'Point redistribution; pts_map_all:'
386 write(6,
'(A22,I7)')
'Global point nr ', npoints
387 write(6,
'(A22,I7)')
'Average point nr ', nptav
388 write(6,
'(A22,I7,I7)')
'Old loc pts nr min/max', ierr, itmp
389 write(6,
'(A22,I7,I7)')
'Assgn point nr min/max', ipr, ipt
390 write(6,
'(A22,I7)')
'Nr of shifted points ', nptshift1
391 write(6,
'(A22,g13.5,g13.5)')
'Mapping time min/max ',
401 $ lplist,npts,nplist)
413 parameter(lptn=2*lx1*ly1*lz1*lelt)
414 integer npts_node_u(lptn)
415 integer npts_node_l(lptn)
416 integer npts_node_r(lptn)
417 integer npts_node_g(lptn)
418 integer npts_node_h(lptn)
419 common /scrch/ npts_node_u
420 common /screv/ npts_node_l
421 common /ctmp0/ npts_node_r
422 common /ctmp1/ npts_node_g
423 common /scrsf/ npts_node_h
430 integer npts_plist(lplist)
436 integer nptav, nptmod
438 common /istat_pts_avm/ nptav, nptmod, nptmax
440 integer nptgdone, nptgundone
441 integer nptldone, nptlundone
442 common /istat_pts_done/ nptgdone, nptgundone, nptldone,
445 integer nptover, nptempty, nptshift
446 common /istat_pts_oes/ nptover, nptempty, nptshift
451 integer itmp, itmp1, itmp2, itmp3, itmp4, itmp5
456 integer ipr, ipt, ipt2, ipt3
457 integer nodeid, nodeid1
459 integer nptupg, nptupl
487 call izero(npts_node_l,nplist)
491 if(npts_plist(ipr).eq.mid(ipt))
492 $ npts_node_l(ipr) = npts_node_l(ipr) + 1
500 if (nid.eq.(np-1))
call icopy(npts_node_g,npts_node_r,nplist)
505 npts_node_r(ipr) = npts_node_r(ipr) - npts_node_l(ipr)
509 call icopy(npts_node_u,npts_node_g,nplist)
511 call izero(npts_node_h,nplist)
518 nodeid = npts_plist(ipr)
521 if (nodeid.lt.nptmod)
then
528 if (npts_node_g(ipr).gt.nptmax)
then
536 if (nid.eq.nodeid)
then
537 itmp = min(npts_node_l(ipr),nptupg)
540 npts_node_l(ipr) = npts_node_l(ipr) - itmp
541 npts_node_r(ipr) = npts_node_r(ipr) + itmp
543 idummy(2) = npts_node_r(ipr)
548 itmp = nptupg - idummy(1)
551 if (npts_node_r(ipr).ge.idummy(2))
552 $ npts_node_r(ipr) = npts_node_r(ipr) - idummy(1)
554 npts_node_h(ipr) = npts_node_h(ipr) + idummy(1)
560 if(npts_node_l(ipr).gt.0)
then
562 itmp1 = 1 - npts_node_r(ipr)
563 itmp2 = itmp1 + itmp - 1
566 itmp2 = min(npts_node_l(ipr),itmp2)
567 if ((itmp1.le.npts_node_l(ipr)).and.
568 $ (itmp2.ge.1)) nptupl = itmp2 - itmp1 + 1
571 npts_node_l(ipr) = npts_node_l(ipr) - nptupl
572 npts_node_r(ipr) = npts_node_r(ipr) + nptupl
576 ierr = iglsum(nptupl,1)
577 if(ierr.ne.itmp)
then
578 if(nio.eq.0)
write(6,*)
579 $
'Error: pts_map_set; wrong nptupl 1'
586 if (nid.eq.nodeid) nptupl = nptupl + npts_node_h(ipr)
590 nptgdone = nptgdone + nptupg
591 nptgundone = nptgundone - nptupg
593 nptldone = nptldone + nptupl
594 nptlundone = nptlundone - nptupl
598 itmp = npts_node_g(ipr) - nptupg
599 npts_node_u(ipr) = itmp
601 nptover = nptover + itmp
607 if (nptempty.gt.0)
then
611 if(npts_node_u(ipt2).lt.0)
then
613 itmp2 = - npts_node_u(ipt2)
614 itmp1 = min(itmp2,itmp)
617 if(npts_node_l(ipr).gt.0)
then
619 itmp2 = npts_node_g(ipr) -
620 $ npts_node_u(ipr) - npts_node_h(ipr) -
621 $ npts_node_r(ipr) + 1
622 itmp3 = itmp2 + itmp1 - 1
626 itmp3 = min(npts_node_l(ipr),itmp3)
628 if ((itmp2.le.npts_node_l(ipr)).and.
631 nodeid1 = npts_plist(ipt2)
636 if (mid(ipt3).eq.nodeid)
then
638 if (itmp4.ge.itmp2.and.
639 $ itmp4.le.itmp3)
then
649 nptupl = nptupl + itmp5
650 npts_node_l(ipr) = npts_node_l(ipr) - itmp5
651 npts_node_l(ipt2)= npts_node_l(ipt2) + itmp5
652 npts_node_r(ipr) = npts_node_r(ipr) + itmp5
659 npts_node_u(ipt2) = npts_node_u(ipt2) + itmp1
660 npts_node_u(ipr) = npts_node_u(ipr) - itmp1
662 nptupg = nptupg + itmp1
666 if (itmp.eq.0)
goto 100
672 ierr = iglsum(nptupl,1)
673 if(ierr.ne.nptupg)
then
674 if(nio.eq.0)
write(6,*)
675 $
'Error: pts_map_set; wrong nptupl 2'
682 nptgdone = nptgdone + nptupg
683 nptgundone = nptgundone - nptupg
685 nptldone = nptldone + nptupl
686 nptlundone = nptlundone - nptupl
688 nptempty = nptempty - nptupg
689 nptover = nptover - nptupg
690 nptshift = nptshift + nptupg
697 if (npts_node_g(ipr).gt.nptav1)
then
702 nptgdone = nptgdone + npts_node_g(ipr)
703 nptgundone = nptgundone - npts_node_g(ipr)
705 nptldone = nptldone + npts_node_l(ipr)
706 nptlundone = nptlundone - npts_node_l(ipr)
716 nptgdone = nptgdone + npts_node_g(ipr)
717 nptgundone = nptgundone - npts_node_g(ipr)
719 nptldone = nptldone + npts_node_l(ipr)
720 nptlundone = nptlundone - npts_node_l(ipr)
724 itmp = nptav1 - npts_node_g(ipr)
725 npts_node_u(ipr) = - itmp
727 nptempty = nptempty + itmp
733 if (nptover.gt.0)
then
737 if(npts_node_u(ipt2).gt.0)
then
739 itmp2 = npts_node_u(ipt2)
740 itmp1 = min(itmp2,itmp)
743 if(npts_node_l(ipt2).gt.0)
then
745 itmp2 = npts_node_g(ipt2) -
746 $ npts_node_u(ipt2) - npts_node_h(ipt2) -
747 $ npts_node_r(ipt2) + 1
748 itmp3 = itmp2 + itmp1 - 1
752 itmp3 = min(npts_node_l(ipt2),itmp3)
753 if ((itmp2.le.npts_node_l(ipt2)).and.
756 nodeid1 = npts_plist(ipt2)
761 if (mid(ipt3).eq.nodeid1)
then
763 if (itmp4.ge.itmp2.and.
764 $ itmp4.le.itmp3)
then
774 nptupl = nptupl + itmp5
775 npts_node_l(ipr) = npts_node_l(ipr)
777 npts_node_l(ipt2)= npts_node_l(ipt2)
779 npts_node_r(ipt2)= npts_node_r(ipt2)
787 npts_node_u(ipt2) = npts_node_u(ipt2) - itmp1
788 npts_node_u(ipr) = npts_node_u(ipr) + itmp1
790 nptupg = nptupg + itmp1
794 if (itmp.eq.0)
goto 200
800 ierr = iglsum(nptupl,1)
801 if(ierr.ne.nptupg)
then
802 if(nio.eq.0)
write(6,*)
803 $
'Error: pts_map_set; wrong nptupl 3'
810 nptgdone = nptgdone + nptupg
811 nptgundone = nptgundone - nptupg
813 nptldone = nptldone + nptupl
814 nptlundone = nptlundone - nptupl
816 nptempty = nptempty - nptupg
817 nptover = nptover - nptupg
818 nptshift = nptshift + nptupg
829 if (nid.eq.npts_plist(ipr))
then
830 istatus = npts_node_u(ipr)
831 indasg = npts_node_g(ipr)
subroutine comm_ibcastn(buf, nl, sid)
Broadcast integer array from specified process.
subroutine comm_ivglrsum(out, in, nl)
Global MPI scan for integer array.
subroutine icopy(a, b, n)
subroutine pts_map_set(mid, lpts, istatus, indasg, npts_plist, lplist, npts, nplist)
subroutine pts_map_all(mid, lpts, npts, npoints, nptimb)
subroutine pts_rdst(nptimb)
subroutine pts_transfer(rbuf, lrbuf, ibuf, libuf, lpts, npts)