39 integer*8 stride,stridebt,stridebf
43 integer wdsizet, wdsizef
49 integer igl_running_sum
50 real dnekclock_sync, glsum
52 tiostart=dnekclock_sync()
57 nptsb = igl_running_sum(itmp)
58 nptsb = nptsb - tsrs_npts
74 $
'Error openning file')
80 offs0 = iheadersize + 4 + wdsizo*tsrs_ntsnap + isize*tsrs_nptot
83 stridebt = nelb * wdsizet
84 stridebf = nelb * wdsizef
85 stride = tsrs_nptot * wdsizet
92 offs = offs0 + stride*ioflds + stridebt*ndim
97 $
'Error writing point coordinates')
98 ioflds = ioflds + ndim
103 offs = offs0 + stride*ioflds + stridebf*tsrs_nfld*tsrs_ntsnap
105 itmp = tsrs_npts*tsrs_nfld*tsrs_ntsnap
108 $
'Error writing interpolated field')
109 ioflds = ioflds + tsrs_nfld*tsrs_ntsnap
111 if (nid.eq.pid0)
then
119 $
'Error closing file')
122 dnbyte = 1.*ioflds*tsrs_npts*wdsizo
123 tio = dnekclock_sync()-tiostart
127 dnbyte = glsum(dnbyte,1)
128 dnbyte = dnbyte + iheadersize + 4. + wdsizo * tsrs_ntsnap +
131 dnbyte = dnbyte/1024/1024
132 if(nio.eq.0)
write(6,7) istep,time,dnbyte,dnbyte/tio,
134 7
format(/,i9,1pe12.4,
' done :: Write checkpoint',/,
135 & 30x,
'file size = ',3pg12.2,
'MB',/,
136 & 30x,
'avg data-throughput = ',0pf7.1,
'MB/s',/,
137 & 30x,
'io-nodes = ',i5,/)
162 integer wdsizet, wdsizef
167 integer lglist(0:lhis)
176 integer ibsw_out, len
195 call csend(mtype,idum,4,jl,0)
196 call crecv(mtype,inelp,4)
201 call crecv(mtype,idum,4)
202 call csend(mtype,tsrs_npts,4,pid0,0)
210 write(hdr,1) wdsizet,wdsizef,ldim,nelo,tsrs_nptot,tsrs_ntsnap,
211 $ tsrs_nfld,time,fid0,nfileoo
212 1
format(
'#std',1x,i1,1x,i1,1x,i1,1x,i10,1x,i10,1x,i10,1x,i4,1x,
213 $ e20.13,1x,i6,1x,i6)
216 test_pattern = 6.54321
218 len = wdsizo/4 * tsrs_ntsnap
232 $
'Error writing header')
237 ioff = iheadersize + 4 + wdsizo * tsrs_ntsnap + nelb*isize
246 call csend(mtype,idum,isize,jl,0)
248 call crecv(mtype,lglist,len)
252 $ (lglist(1),lglist(0),-1,ifh_mbyte,ierr)
260 call crecv(mtype,idum,isize)
262 lglist(0) = tsrs_npts
263 call icopy(lglist(1),tsrs_ipts,tsrs_npts)
265 len = isize*(tsrs_npts+1)
266 call csend(mtype,lglist,len,pid0,0)
270 $
'Error writing global point numbers')
296 parameter(lw2=tsrs_nfld*tsrs_ltsnap*lhis)
307 integer len, leo, nout
315 leo = 8 + wdsizo*lpts
319 if (nid.eq.pid0)
then
321 if (wdsizo.eq.4)
then
324 call copy (u8,ul,lpts)
326 nout = wdsizo/4 * lpts
339 call csend(mtype,idum,4,kl,0)
340 call crecv(mtype,u4,len)
341 nout = wdsizo/4 * u8(1)
342 if (wdsizo.eq.4.and.ierr.eq.0)
then
348 elseif(ierr.eq.0)
then
360 if (wdsizo.eq.4)
then
361 call copyx4 (u4(3),ul,lpts)
363 call copy (u8(2),ul,lpts)
367 call crecv(mtype,idum,4)
368 call csend(mtype,u4,leo,pid0,0)
388 integer mid,mp,nekcomm,nekgroup,nekreal
389 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
397 integer itmp_ipts(lhis)
398 real rtmp_pts(ldim,lhis)
399 real*4 rbuffl(2*ldim*lhis)
410 logical if_byte_swap_test
414 if (nid.eq.pid00)
then
420 call blank (hdr,hdrl)
422 if (ierr.ne.0)
goto 101
426 if(ierr.ne.0)
goto 101
427 if_byte_sw = if_byte_swap_test(bytetest,ierr)
428 if(ierr.ne.0)
goto 101
431 read(hdr,*,iostat=ierr) dummy, wdsizr, ldiml, nptsr
437 $
'tsrs_mfi_points: Error opening point files')
440 call bcast(wdsizr,isize)
441 call bcast(ldiml,isize)
442 call bcast(nptsr,isize)
443 call bcast(if_byte_sw,lsize)
447 $
'tsrs_mfi_points: Inconsisten dimension.')
453 if (tsrs_npts.gt.0)
then
454 tsrs_npt1 = mod(tsrs_nptot,mp)
456 tsrs_npt1 = tsrs_nptot
458 if (nid.lt.tsrs_npt1) tsrs_npts = tsrs_npts +1
462 $
'Interpolation point number :', tsrs_nptot)
465 if (tsrs_npts.gt.lhis) ierr = 1
467 $
'tsrs_mfi_points: lhis too small')
472 if (nid.eq.pid00)
then
473 if (tsrs_nptot.gt.0)
then
475 ldiml = ldim*tsrs_npts*wdsizr/4
488 ldiml = ldim*tsrs_npts
489 if (wdsizr.eq.4)
then
490 call copy4r(tsrs_pts,rbuffl,ldiml)
492 call copy(tsrs_pts,rbuffl,ldiml)
498 tsrs_ipts(il) = iglob
502 npass = min(mp,tsrs_nptot)
505 if (tsrs_npt1.gt.0.and.il.ge.tsrs_npt1)
then
509 ldiml = ldim*nptsr*wdsizr/4
523 if (wdsizr.eq.4)
then
524 call copy4r(rtmp_pts,rbuffl,ldiml)
526 call copy(rtmp_pts,rbuffl,ldiml)
531 itmp_ipts(jl) = iglob
536 call csend(il,rtmp_pts,ldiml,il,jl)
538 call csend(il,itmp_ipts,ldiml,il,jl)
542 if (tsrs_npts.gt.0)
then
543 call crecv2(nid,tsrs_pts,ldim*tsrs_npts*wdsize,0)
544 call crecv2(nid,tsrs_ipts,tsrs_npts*isize,0)
549 if (nid.eq.pid00)
then
subroutine byte_write_mpi(buf, icount, iorank, mpi_fh, ierr)
subroutine byte_close_mpi(mpi_fh, ierr)
subroutine byte_set_view(ioff_in, mpi_fh)
subroutine crecv2(mtype, buf, lenm, jnid)
subroutine crecv(mtype, buf, lenm)
subroutine csend(mtype, buf, len, jnid, jpid)
subroutine bcast(buf, len)
subroutine mntr_logi(mid, priority, logs, ivar)
Write log message adding single integer.
subroutine mntr_abort(mid, logs)
Abort simulation.
subroutine mntr_check_abort(mid, ierr, logs)
Abort simulation.
subroutine tsrs_mfi_points()
Read interpolation points positions, number and redistribute them.
subroutine tsrs_mfo_write_hdr(wdsizet, wdsizef)
Write file header.
subroutine tsrs_mfo_outfld(bff, lbff)
Write a point history file.
subroutine tsrs_mfo_outs(ul, lpts, ierr)
Write single field for a local set of points.
subroutine icopy(a, b, n)
subroutine mfo_open_files(prefix, ierr)
subroutine copy4r(a, b, n)
subroutine copyx4(a, b, n)