Nek5000
SEM for Incompressible NS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
map2.F90
Go to the documentation of this file.
1 !-----------------------------------------------------------------------
2 subroutine mapelpr()
3  use size_m, only : nid, nelt
4  use input, only : ifflow, ifmvbd, ifheat, iftmsh, npscal
5  use parallel, only : np, nelgt, nelg, nelgv, node, lglel
6  use tstep, only : ifield
7  implicit none
8 
9  logical :: ifverbm
10  integer :: mfield, nfldt, idum, n8, ie, inid, mtype, inelt, nn, nm
11  integer, external :: iglmin, iglmax
12 
13  if(nid == 0) write(6,'(/,A)') ' mapping elements to processors'
14 
15  mfield=2
16  IF (ifflow) mfield=1
17  IF (ifmvbd) mfield=0
18 
19 ! Set up TEMPORARY value for NFIELD - NFLDT
20  nfldt = 1
21  IF (ifheat) nfldt = 2 + npscal
22 
23 ! Distributed memory processor mapping
24  IF (np > nelgt) THEN
25  IF(nid == 0) THEN
26  WRITE(6,1000) np,nelgt
27  1000 FORMAT(2x,'ABORT: Too many processors (',i8 &
28  ,') for to few elements (',i8,').' &
29  ,/,2x,'ABORTING IN MAPELPR.')
30  ENDIF
31  call exitt
32  ENDIF
33  call set_proc_map()
34 
35  DO 1200 ifield=mfield,nfldt
36  IF (iftmsh(ifield)) THEN
37  nelg(ifield) = nelgt
38  ELSE
39  nelg(ifield) = nelgv
40  ENDIF
41  1200 END DO
42 
43 ! Output the processor-element map:
44  ifverbm= .true.
45  if (np > 2050 .OR. nelgt > 40000) ifverbm= .false.
46 
47  if(ifverbm) then
48  idum = 1
49  if(nid == 0) then
50  n8 = min(8,nelt)
51  write(6 ,1310) node-1,(lglel(ie),ie=1,n8)
52  if (nelt > 8) write(6 ,1315) (lglel(ie),ie=9,nelt)
53  DO inid=1,np-1
54  mtype = inid
55  call csend(mtype,idum,4,inid,0) ! handshake
56  call crecv(mtype,inelt,4) ! nelt of other cpus
57  n8 = min(8,inelt)
58  ! write(6 ,1310) inid+1,(lglel(ie,inid+1),ie=1,n8)
59  ! IF (inelt.gt.8)
60  ! & write(6 ,1315) (lglel(ie,inid+1),ie=9,inelt)
61  ENDDO
62  1310 FORMAT(' RANK',i6,' IEG',8i8)
63  1315 FORMAT(' ',6x,' ',8i8)
64  else
65  mtype = nid
66  call crecv(mtype,idum,4) ! hand-shake
67  call csend(mtype,nelt,4,0,0) ! nelt
68  endif
69  endif
70 
71 ! Check elemental distribution
72 
73 ! IF (IPASS.EQ.2.AND.PARAM(156).eq.9) THEN
74 ! NXYZ=NX1*NY1*NZ1
75 ! DO 1400 IE=1,NELT
76 ! VTMP1=NODE
77 ! VTMP2=IE
78 ! CALL CFILL(VX(1,1,1,IE) ,VTMP1,NXYZ)
79 ! CALL CFILL(VY(1,1,1,IE) ,VTMP2,NXYZ)
80 ! CALL CFILL(T(1,1,1,IE,1),VTMP1,NXYZ)
81 ! 1400 CONTINUE
82 ! call prepost(.true.,' ')
83 ! ENDIF
84 
85  nn = iglmin(nelt,1)
86  nm = iglmax(nelt,1)
87  if(nid == 0) write(6,*) 'element load imbalance: ',nm-nn,nn,nm
88 
89  if(nid == 0) then
90  write(6,*) 'done :: mapping elements to processors'
91  write(6,*) ' '
92  endif
93 
94  return
95 end subroutine mapelpr
96 
97 !-----------------------------------------------------------------------
101 subroutine set_proc_map()
102  implicit none
103 
104  call get_vert
105 
106  return
107 end subroutine set_proc_map
108 
subroutine set_proc_map()
Compute element to processor distribution according to (weighted) physical distribution in an attempt...
Definition: map2.F90:101
cleaned
Definition: tstep_mod.F90:2
Input parameters from preprocessors.
Definition: input_mod.F90:11
subroutine crecv(mtype, buf, lenm)
Definition: comm_mpi.F90:223
void exitt()
Definition: comm_mpi.F90:411
integer function lglel(iel)
cleaned
Definition: parallel_mod.F90:2
static uint np
Definition: findpts_test.c:63
subroutine mapelpr()
Definition: map2.F90:2
subroutine csend(mtype, buf, len, jnid, jpid)
Definition: comm_mpi.F90:209