4 use mpif, only : mpi_comm_world, mpi_double_precision, mpi_real
5 use mpif, only : mpi_tag_ub
6 use size_m
, only : nid, lp, lelg
7 use parallel, only :
np, wdsize, ifdblas, isize, lsize, csize, pid
8 use parallel, only : nullpid, node0, node, cr_h
16 real(DP) :: eps, oneeps
29 call
mpi_attr_get(mpi_comm_world,mpi_tag_ub,nval,flag,ierr)
30 if (nval < (10000+max(lp,lelg)))
then
31 if(nid == 0)
write(6,*)
'ABORT: MPI_TAG_UB too small!'
37 'ERROR: Code compiled for a max of',lp,
' processors.'
39 'Recompile with LP =',
np,
' or run with fewer processors.'
41 'Aborting in routine INIPROC.'
49 if (oneeps /= 1.0)
then
53 write(6,*)
'ABORT: single precision mode not supported!'
57 if (wdsize == 8) nekreal = mpi_double_precision
60 if (wdsize == 8) ifdblas = .true.
78 write(6,*)
'Number of processors:',
np
79 WRITE(6,*)
'REAL wdsize :',wdsize
80 WRITE(6,*)
'INTEGER wdsize :',isize
83 call crystal_setup(cr_h,nekcomm,
np)
94 integer,
external :: mynode, numnodes
104 subroutine gop( x, w, op, n)
106 use mpif, only : mpi_max, mpi_min, mpi_prod, mpi_sum
108 use parallel, only :nid,nekcomm,nekreal
112 real(DP) :: x(n), w(n)
120 if (icalld == 0)
then
131 elseif (op ==
'M ')
then
133 elseif (op ==
'm ')
then
135 elseif (op ==
'* ')
then
138 write(6,*) nid,
' OP ',op,
' not supported. ABORT in GOP.'
153 use mpif, only : mpi_integer, mpi_max, mpi_min, mpi_prod, mpi_sum
157 integer,
intent(in) :: n
158 integer,
intent(inout) :: x(n), w(n)
159 character(3),
intent(in) :: op
164 elseif (op ==
'M ')
then
166 elseif (op ==
'm ')
then
168 elseif (op ==
'* ')
then
171 write(6,*) nid,
' OP ',op,
' not supported. ABORT in igop.'
183 use mpif, only : mpi_integer8, mpi_max, mpi_min, mpi_prod, mpi_sum
187 integer(i8) :: x(n), w(n)
193 elseif (op ==
'M ')
then
195 elseif (op ==
'm ')
then
197 elseif (op ==
'* ')
then
200 write(6,*) nid,
' OP ',op,
' not supported. ABORT in igop.'
209 subroutine csend(mtype,buf,len,jnid,jpid)
211 use mpif, only : mpi_byte
215 integer :: mtype, len, jnid, jpid
218 call
mpi_send(buf,len,mpi_byte,jnid,mtype,nekcomm,ierr)
225 use mpif, only : mpi_any_source, mpi_byte, mpi_status_size
228 integer :: mtype, lenm
231 integer :: status(mpi_status_size)
232 integer :: len, jnid, ierr
235 jnid = mpi_any_source
238 ,jnid,mtype,nekcomm,status,ierr)
241 write(6,*) nid,
'long message in mpi_crecv:',len,lenm
261 integer :: myid, ierr
282 call
bcast(
real(item, kind=r4),isize)
284 if (item == 1) ifif= .true.
291 use mpif, only : mpi_byte
298 call
mpi_bcast(buf,len,mpi_byte,0,nekcomm,ierr)
304 integer function irecv(msgtag,x,len)
305 use mpif, only : mpi_any_source, mpi_byte
308 integer :: msgtag, x(1), len
309 integer :: ierr, imsg
311 call
mpi_irecv(x,len,mpi_byte,mpi_any_source,msgtag &
329 use size_m
, only : nid
335 character(132) :: stringi
336 character(132) :: stringo
340 call
blank(stringo,132)
341 call
chcopy(stringo,stringi,132)
342 len =
indx1(stringo,
'$',1)
345 call
chcopy(stringo(len:len),s11,11)
347 if (nid == 0)
write(6,1) (stringo(k:k),k=1,len+10)
348 1
format(
'EXIT: ',132a1)
357 use size_m
, only : nid
363 character(*) :: istring
364 character(132) :: ostring
368 integer,
external :: iglsum
370 ierr = iglsum(ierr,1)
373 len =
indx1(istring,
'$',1)
374 call
blank(ostring,132)
376 11
format(1x,
' ierr=',i3)
378 call
chcopy(ostring,istring,len-1)
379 call
chcopy(ostring(len:len),s10,10)
381 if (nid == 0)
write(6,1) (ostring(k:k),k=1,len+10)
382 1
format(
'ERROR: ',132a1)
395 write(6,*)
'Emergency exit'
412 use kinds, only : dp, i8
413 use size_m
, only : nid, nx1, ny1, nz1
415 use input, only : ifneknek
417 use tstep, only : istep
421 real(r4) :: papi_mflops
423 integer(i8) :: papi_flops
427 real(DP) :: tstop, dtmp1, dtmp2, dtmp3, dgp
428 integer :: nxyz, ierr
443 ttotal = tstop-etimes
447 inquire(unit=50,opened=ifopen)
455 dtmp1 =
np*ttime/(dgp*max(istep,1))
456 dtmp2 = ttime/max(istep,1)
457 dtmp3 = 1.*papi_flops/1e6
460 write(6,
'(A)')
'call exitt: dying ...'
464 write(6,
'(4(A,1p1e13.5,A,/))') &
465 'total elapsed time : ',ttotal,
' sec' &
466 ,
'total solver time incl. I/O : ',ttime ,
' sec' &
467 ,
'time/timestep : ',dtmp2 ,
' sec' &
468 ,
'CPU seconds/timestep/gridpt : ',dtmp1 ,
' sec'
470 write(6,
'(2(A,1g13.5,/))') &
471 'Gflops : ',dtmp3/1000. &
472 ,
'Gflops/s : ',papi_mflops/1000.
494 use mpif, only : mpi_integer, mpi_sum
498 integer :: x,w,r, ierr
504 call
mpi_scan(x,r,1,mpi_integer,mpi_sum,nekcomm,ierr)
511 use mpif, only : mpi_status_size
513 integer :: status(mpi_status_size)
514 integer :: imsg, ierr
subroutine mpi_send(data, n, datatype, iproc, itag, comm, ierror)
subroutine bcast(buf, len)
subroutine lbcast(ifif)
Broadcast logical variable to all processors.
integer function numnodes()
subroutine mpi_recv(data, n, datatype, iproc, itag, comm, istatus, ierror)
subroutine mpi_wait(irequest, istatus, ierror)
subroutine mpi_scan(data1, data2, n, datatype, operation, comm, ierror)
subroutine igop(x, w, op, n)
Global vector commutative operation.
subroutine crecv(mtype, buf, lenm)
subroutine init_nek_comm(intracomm)
integer function mynode()
integer function indx1(S1, S2, L2)
subroutine mpi_bcast(data, n, datatype, node, comm, ierror)
subroutine mpi_irecv(data, n, datatype, iproc, itag, comm, irequest, ierror)
subroutine mpi_barrier(comm, ierror)
real(dp) function dnekclock()
subroutine mpi_finalize(ierror)
integer function irecv(msgtag, x, len)
subroutine happy_check(iflag)
Dummy for singlmesh.
subroutine nek_flops(flops, mflops)
subroutine mpi_allreduce(data1, data2, n, datatype, operation, comm, ierror)
integer function igl_running_sum(in)
subroutine mpi_comm_rank(comm, me, ierror)
subroutine blank(A, N)
blank a string
subroutine iniproc(intracomm)
subroutine mpi_attr_get(icomm, ikey, ival, iflag, ierr)
subroutine gop(x, w, op, n)
Global vector commutative operation.
subroutine chcopy(a, b, n)
subroutine mpi_comm_size(comm, nprocs, ierror)
subroutine err_chk(ierr, istring)
subroutine i8gop(x, w, op, n)
Global vector commutative operation.
subroutine exitti(stringi, idata)
subroutine csend(mtype, buf, len, jnid, jpid)