Skip to content

Commit

Permalink
Merge branch 'improvement.quiet.loadbalance' into 'master.dev'
Browse files Browse the repository at this point in the history
[improvement.quiet.loadbalance] Make load balance less chatty

See merge request piclas/piclas!672
  • Loading branch information
scopplestone committed Aug 4, 2022
2 parents 422481a + 16996dc commit 69400ca
Show file tree
Hide file tree
Showing 57 changed files with 894 additions and 645 deletions.
11 changes: 7 additions & 4 deletions src/analyze/analyze.f90
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ SUBROUTINE InitAnalyze()
USE MOD_PICInterpolation_Vars ,ONLY: useAlgebraicExternalField,AlgebraicExternalField
#endif /*PARTICLES*/
#endif /*USE_HDG*/
#if USE_LOADBALANCE
USE MOD_LoadBalance_Vars ,ONLY: PerformLoadBalance
#endif /*USE_LOADBALANCE*/
! IMPLICIT VARIABLE HANDLING
IMPLICIT NONE
!----------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -198,8 +201,8 @@ SUBROUTINE InitAnalyze()
,'InitAnalyse not ready to be called or already called.')
RETURN
END IF
SWRITE(UNIT_StdOut,'(132("-"))')
SWRITE(UNIT_stdOut,'(A)') ' INIT ANALYZE...'
LBWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)') ' INIT ANALYZE...'

! Get logical for calculating the error norms L2 and LInf
DoCalcErrorNorms = GETLOGICAL('DoCalcErrorNorms')
Expand Down Expand Up @@ -287,8 +290,8 @@ SUBROUTINE InitAnalyze()
AnalyzeTime = 0.0

AnalyzeInitIsDone = .TRUE.
SWRITE(UNIT_stdOut,'(A)')' INIT ANALYZE DONE!'
SWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)')' INIT ANALYZE DONE!'
LBWRITE(UNIT_StdOut,'(132("-"))')

! Points Per Wavelength
CalcPointsPerWavelength = GETLOGICAL('CalcPointsPerWavelength')
Expand Down
17 changes: 10 additions & 7 deletions src/dg/dg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ SUBROUTINE InitDG()
#ifdef OPTIMIZED
USE MOD_Riemann ,ONLY: GetRiemannMatrix
#endif /*OPTIMIZED*/
#if USE_LOADBALANCE && !(USE_HDG)
USE MOD_LoadBalance_Vars ,ONLY: PerformLoadBalance,UseH5IOLoadBalance
#endif /*USE_LOADBALANCE && !(USE_HDG)*/
#if USE_LOADBALANCE
USE MOD_LoadBalance_Vars ,ONLY: PerformLoadBalance
#if !(USE_HDG)
USE MOD_LoadBalance_Vars ,ONLY: UseH5IOLoadBalance
#endif /*!(USE_HDG)*/
#endif /*USE_LOADBALANCE*/
! IMPLICIT VARIABLE HANDLING
IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -88,8 +91,8 @@ SUBROUTINE InitDG()
!===================================================================================================================================
IF((.NOT.InterpolationInitIsDone).OR.(.NOT.MeshInitIsDone).OR.(.NOT.RestartInitIsDone).OR.DGInitIsDone) CALL abort(__STAMP__,&
'InitDG not ready to be called or already called.')
SWRITE(UNIT_StdOut,'(132("-"))')
SWRITE(UNIT_stdOut,'(A)') ' INIT DG...'
LBWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)') ' INIT DG...'

CALL initDGbasis(PP_N,xGP,wGP,wBary)
#if USE_LOADBALANCE && !(USE_HDG)
Expand Down Expand Up @@ -149,8 +152,8 @@ SUBROUTINE InitDG()
#endif /*USE_HDG*/

DGInitIsDone=.TRUE.
SWRITE(UNIT_stdOut,'(A)')' INIT DG DONE!'
SWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)')' INIT DG DONE!'
LBWRITE(UNIT_StdOut,'(132("-"))')
END SUBROUTINE InitDG


Expand Down
13 changes: 8 additions & 5 deletions src/dielectric/dielectric.f90
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ SUBROUTINE InitDielectric()
#if ! (USE_HDG)
USE MOD_Equation_Vars ,ONLY: c_corr
#endif /*if not USE_HDG*/
#if USE_LOADBALANCE
USE MOD_LoadBalance_Vars ,ONLY: PerformLoadBalance
#endif /*USE_LOADBALANCE*/
! IMPLICIT VARIABLE HANDLING
IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -98,14 +101,14 @@ SUBROUTINE InitDielectric()
!-----------------------------------------------------------------------------------------------------------------------------------
! LOCAL VARIABLES
!===================================================================================================================================
SWRITE(UNIT_StdOut,'(132("-"))')
SWRITE(UNIT_stdOut,'(A)') ' INIT Dielectric...'
LBWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)') ' INIT Dielectric...'
!===================================================================================================================================
! Readin
!===================================================================================================================================
DoDielectric = GETLOGICAL('DoDielectric','.FALSE.')
IF(.NOT.DoDielectric) THEN
SWRITE(UNIT_stdOut,'(A)') ' Dielectric region deactivated. '
LBWRITE(UNIT_stdOut,'(A)') ' Dielectric region deactivated. '
nDielectricElems=0
RETURN
END IF
Expand Down Expand Up @@ -205,8 +208,8 @@ SUBROUTINE InitDielectric()
CALL WriteDielectricGlobalToHDF5()

DielectricInitIsDone=.TRUE.
SWRITE(UNIT_stdOut,'(A)')' INIT Dielectric DONE!'
SWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)')' INIT Dielectric DONE!'
LBWRITE(UNIT_StdOut,'(132("-"))')
END SUBROUTINE InitDielectric


Expand Down
23 changes: 13 additions & 10 deletions src/equations/maxwell/equation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ SUBROUTINE InitEquation()
USE MOD_Mesh ,ONLY: GetMeshMinMaxBoundaries
USE MOD_Utils ,ONLY: RootsOfBesselFunctions
USE MOD_ReadInTools ,ONLY: PrintOption
#if USE_LOADBALANCE
USE MOD_LoadBalance_Vars ,ONLY: PerformLoadBalance
#endif /*USE_LOADBALANCE*/
! IMPLICIT VARIABLE HANDLING
IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -177,17 +180,17 @@ SUBROUTINE InitEquation()
IF(EquationInitIsDone)THEN
#ifdef PARTICLES
IF(InterpolationInitIsDone)THEN
SWRITE(*,*) "InitMaxwell not ready to be called or already called."
LBWRITE(*,*) "InitMaxwell not ready to be called or already called."
RETURN
END IF
#else
SWRITE(*,*) "InitMaxwell not ready to be called or already called."
LBWRITE(*,*) "InitMaxwell not ready to be called or already called."
RETURN
#endif /*PARTICLES*/
END IF

SWRITE(UNIT_StdOut,'(132("-"))')
SWRITE(UNIT_stdOut,'(A)') ' INIT MAXWELL ...'
LBWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)') ' INIT MAXWELL ...'

! Read correction velocity
c_corr = GETREAL('c_corr','1.')
Expand Down Expand Up @@ -265,13 +268,13 @@ SUBROUTINE InitEquation()
END IF
IF(TERadius.LT.0.0)THEN ! not set
TERadius=GETREAL('TERadius','0.0')
SWRITE(UNIT_StdOut,*) ' TERadius not determined automatically. Set waveguide radius to ', TERadius
LBWRITE(UNIT_StdOut,*) ' TERadius not determined automatically. Set waveguide radius to ', TERadius
END IF

! display cut-off freequncy for this mode
SWRITE(UNIT_stdOut,'(A,I5,A1,I5,A,ES25.14E3,A)')&
LBWRITE(UNIT_stdOut,'(A,I5,A1,I5,A,ES25.14E3,A)')&
' Cut-off frequency in circular waveguide for TE_[',1,',',0,'] is ',1.8412*c/(2*PI*TERadius),' Hz (lowest mode)'
SWRITE(UNIT_stdOut,'(A,I5,A1,I5,A,ES25.14E3,A)')&
LBWRITE(UNIT_stdOut,'(A,I5,A1,I5,A,ES25.14E3,A)')&
' Cut-off frequency in circular waveguide for TE_[',TEMode(1),',',TEMode(2),'] is ',(TEModeRoot/TERadius)*c/(2*PI),&
' Hz (chosen mode)'
CASE(12,121,14,15,16)
Expand Down Expand Up @@ -347,7 +350,7 @@ SUBROUTINE InitEquation()
Beam_w0 = GETREAL ('Beam_w0','1.')
ELSE
Beam_w0 = omega_0
SWRITE(UNIT_StdOut,'(A)')'Setting Beam_w0=omega_0 (value read from old variable definition)'
LBWRITE(UNIT_StdOut,'(A)')'Setting Beam_w0=omega_0 (value read from old variable definition)'
END IF
Beam_w0_2inv = 2.0/(Beam_w0**2)
sBeam_w0_2 = 1.0/(Beam_w0**2)
Expand Down Expand Up @@ -466,8 +469,8 @@ SUBROUTINE InitEquation()
* (REAL(alpha_shape) + 1.)/(PI*(rCutoff**3))

EquationInitIsDone=.TRUE.
SWRITE(UNIT_stdOut,'(A)')' INIT MAXWELL DONE!'
SWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)')' INIT MAXWELL DONE!'
LBWRITE(UNIT_StdOut,'(132("-"))')
END SUBROUTINE InitEquation


Expand Down
13 changes: 8 additions & 5 deletions src/equations/maxwell_pois/equation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ SUBROUTINE InitEquation()
USE MOD_Interpolation_Vars ,ONLY: xGP
USE MOD_Interpolation_Vars ,ONLY: InterpolationInitIsDone
USE MOD_Equation_Vars
#if USE_LOADBALANCE
USE MOD_LoadBalance_Vars ,ONLY: PerformLoadBalance
#endif /*USE_LOADBALANCE*/
! IMPLICIT VARIABLE HANDLING
IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -133,11 +136,11 @@ SUBROUTINE InitEquation()
#endif
!===================================================================================================================================
IF(InterpolationInitIsDone.AND.EquationInitIsDone)THEN
SWRITE(*,*) "InitMaxwell Poisson not ready to be called or already called."
LBWRITE(*,*) "InitMaxwell Poisson not ready to be called or already called."
RETURN
END IF
SWRITE(UNIT_StdOut,'(132("-"))')
SWRITE(UNIT_stdOut,'(A)') ' INIT MAXWELL POISSON...'
LBWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)') ' INIT MAXWELL POISSON...'

! Read correction velocity
c_corr = GETREAL('c_corr','1.')
Expand Down Expand Up @@ -215,8 +218,8 @@ SUBROUTINE InitEquation()
CALL PolynomialDerivativeMatrix(N,xGP,D)

EquationInitIsDone=.TRUE.
SWRITE(UNIT_stdOut,'(A)')' INIT MAXWELL POISSON DONE!'
SWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)')' INIT MAXWELL POISSON DONE!'
LBWRITE(UNIT_StdOut,'(132("-"))')
END SUBROUTINE InitEquation


Expand Down
17 changes: 9 additions & 8 deletions src/equations/poisson/equation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ SUBROUTINE InitEquation()
USE MOD_Interpolation_Vars ,ONLY: InterpolationInitIsDone
USE MOD_Mesh_Vars ,ONLY: BoundaryName,BoundaryType,nBCs
USE MOD_Mesh_Vars ,ONLY: nSides
#if USE_LOADBALANCE
USE MOD_LoadBalance_Vars ,ONLY: PerformLoadBalance
#endif /*USE_LOADBALANCE*/
! IMPLICIT VARIABLE HANDLING
IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -113,11 +116,11 @@ SUBROUTINE InitEquation()
INTEGER :: nRefStateMax
!===================================================================================================================================
IF((.NOT.InterpolationInitIsDone).OR.EquationInitIsDone)THEN
SWRITE(*,*) "InitPoisson not ready to be called or already called."
LBWRITE(*,*) "InitPoisson not ready to be called or already called."
RETURN
END IF
SWRITE(UNIT_StdOut,'(132("-"))')
SWRITE(UNIT_stdOut,'(A)') ' INIT POISSON...'
LBWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)') ' INIT POISSON...'

! Read in boundary parameters
IniExactFunc = GETINT('IniExactFunc')
Expand All @@ -134,9 +137,7 @@ SUBROUTINE InitEquation()
SWRITE(*,'(A,I0)') " Type: ",BCType
SWRITE(*,'(A,I0)') "State: ",BCState
SWRITE(*,'(A)') " Name: "//TRIM(BCName)
CALL abort(&
__STAMP__&
,'BCState is <= 0 for BCType=5 is not allowed! Set a positive integer for the n-th RefState')
CALL abort(__STAMP__,'BCState is <= 0 for BCType=5 is not allowed! Set a positive integer for the n-th RefState')
ELSEIF(BCType.EQ.5.AND.BCState.GT.0)THEN
nRefStateMax = MAX(nRefStateMax,BCState)
ELSEIF(BCType.EQ.2)THEN
Expand Down Expand Up @@ -213,8 +214,8 @@ SUBROUTINE InitEquation()


EquationInitIsDone=.TRUE.
SWRITE(UNIT_stdOut,'(A)')' INIT POISSON DONE!'
SWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)')' INIT POISSON DONE!'
LBWRITE(UNIT_StdOut,'(132("-"))')
END SUBROUTINE InitEquation


Expand Down
22 changes: 14 additions & 8 deletions src/hdg/hdg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ SUBROUTINE InitHDG()
USE MOD_Part_BR_Elecron_Fluid ,ONLY: UpdateNonlinVolumeFac
USE MOD_Restart_Vars ,ONLY: DoRestart
#endif /*defined(PARTICLES)*/
#if USE_LOADBALANCE
USE MOD_LoadBalance_Vars ,ONLY: PerformLoadBalance
#endif /*USE_LOADBALANCE*/
IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
! INPUT VARIABLES
Expand All @@ -127,11 +130,11 @@ SUBROUTINE InitHDG()
REAL :: D(0:PP_N,0:PP_N)
!===================================================================================================================================
IF(HDGInitIsDone)THEN
SWRITE(*,*) "InitHDG already called."
LBWRITE(*,*) "InitHDG already called."
RETURN
END IF
SWRITE(UNIT_StdOut,'(132("-"))')
SWRITE(UNIT_stdOut,'(A)') ' INIT HDG...'
LBWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)') ' INIT HDG...'

HDGDisplayConvergence = GETLOGICAL('HDGDisplayConvergence')

Expand Down Expand Up @@ -331,8 +334,8 @@ SUBROUTINE InitHDG()
RHS_vol=0.

HDGInitIsDone = .TRUE.
SWRITE(UNIT_stdOut,'(A)')' INIT HDG DONE!'
SWRITE(UNIT_StdOut,'(132("-"))')
LBWRITE(UNIT_stdOut,'(A)')' INIT HDG DONE!'
LBWRITE(UNIT_StdOut,'(132("-"))')
END SUBROUTINE InitHDG


Expand All @@ -350,6 +353,9 @@ SUBROUTINE InitZeroPotential()
USE MOD_Mesh ,ONLY: GetMeshMinMaxBoundaries
USE MOD_Mesh_Vars ,ONLY: nBCs,BoundaryType,nSides,BC,xyzMinMax,NGeo,Face_xGP
USE MOD_ReadInTools ,ONLY: PrintOption,GETINT
#if USE_LOADBALANCE
USE MOD_LoadBalance_Vars ,ONLY: PerformLoadBalance
#endif /*USE_LOADBALANCE*/
IMPLICIT NONE
!----------------------------------------------------------------------------------------------------------------------------------!
! INPUT / OUTPUT VARIABLES
Expand Down Expand Up @@ -434,14 +440,14 @@ SUBROUTINE InitZeroPotential()
#else
nZeroPotentialSidesGlobal = nZeroPotentialSides
#endif /*USE_MPI*/
SWRITE(UNIT_StdOut,'(A,I0)') " Found (global) number of zero potential sides: ", nZeroPotentialSidesMax
LBWRITE(UNIT_StdOut,'(A,I0)') " Found (global) number of zero potential sides: ", nZeroPotentialSidesMax

! Sanity checks for root
IF(MPIroot)THEN
! 1) multiples sides found
IF(nZeroPotentialSidesMax.GT.1)THEN
WRITE(UNIT_StdOut,'(A)') " WARNING: Found more than 1 zero potential side on a proc and currently, only one can be considered."
WRITE(UNIT_StdOut,'(A,I0,A)') " WARNING: nZeroPotentialSidesGlobal: ", nZeroPotentialSidesMax, " (may lead to problems)"
LBWRITE(UNIT_StdOut,'(A)') " WARNING: Found more than 1 zero potential side on a proc and currently, only one can be considered."
LBWRITE(UNIT_StdOut,'(A,I0,A)') " WARNING: nZeroPotentialSidesGlobal: ", nZeroPotentialSidesMax, " (may lead to problems)"
END IF

! 2) no sides found
Expand Down
3 changes: 1 addition & 2 deletions src/init/piclas_init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ SUBROUTINE InitPiclas(IsLoadBalance)
!===================================================================================================================================
! Get length of the floating number time stamp
TimeStampLength = GETINT('TimeStampLength')
IF((TimeStampLength.LT.4).OR.(TimeStampLength.GT.30)) CALL abort(&
__STAMP__&
IF((TimeStampLength.LT.4).OR.(TimeStampLength.GT.30)) CALL abort(__STAMP__&
,'TimeStampLength cannot be smaller than 4 and not larger than 30')
WRITE(UNIT=TimeStampLenStr2,FMT='(I0)') TimeStampLength-4
! Check if TEnd overflows the output floating format
Expand Down
Loading

0 comments on commit 69400ca

Please sign in to comment.