From 90e9b98584f6c6e1860c10a77e4f3d1a7e01c2a7 Mon Sep 17 00:00:00 2001 From: Arka Lahiri Date: Wed, 9 May 2018 16:35:09 +0200 Subject: [PATCH 1/5] performance profiling should not be part of the source code --- src/constitutive.f90 | 20 +-- src/crystallite.f90 | 78 +++++------ src/debug.f90 | 290 ++++++++++++++++++++--------------------- src/homogenization.f90 | 14 +- 4 files changed, 201 insertions(+), 201 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index a62245f99..27e81e03e 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -838,8 +838,8 @@ subroutine constitutive_collectDotState(Tstar_v, FeArray, FpArray, subdt, subfra pReal, & pLongInt use debug, only: & - debug_cumDotStateCalls, & - debug_cumDotStateTicks, & + !debug_cumDotStateCalls, & + !debug_cumDotStateTicks, & debug_level, & debug_constitutive, & debug_levelBasic @@ -951,10 +951,10 @@ subroutine constitutive_collectDotState(Tstar_v, FeArray, FpArray, subdt, subfra if (iand(debug_level(debug_constitutive), debug_levelBasic) /= 0_pInt) then call system_clock(count=tock,count_rate=tickrate,count_max=maxticks) !$OMP CRITICAL (debugTimingDotState) - debug_cumDotStateCalls = debug_cumDotStateCalls + 1_pInt - debug_cumDotStateTicks = debug_cumDotStateTicks + tock-tick + !debug_cumDotStateCalls = debug_cumDotStateCalls + 1_pInt + !debug_cumDotStateTicks = debug_cumDotStateTicks + tock-tick !$OMP FLUSH (debug_cumDotStateTicks) - if (tock < tick) debug_cumDotStateTicks = debug_cumDotStateTicks + maxticks + !if (tock < tick) debug_cumDotStateTicks = debug_cumDotStateTicks + maxticks !$OMP END CRITICAL (debugTimingDotState) endif end subroutine constitutive_collectDotState @@ -968,8 +968,8 @@ subroutine constitutive_collectDeltaState(Tstar_v, Fe, ipc, ip, el) pReal, & pLongInt use debug, only: & - debug_cumDeltaStateCalls, & - debug_cumDeltaStateTicks, & + !debug_cumDeltaStateCalls, & + !debug_cumDeltaStateTicks, & debug_level, & debug_constitutive, & debug_levelBasic @@ -1035,10 +1035,10 @@ subroutine constitutive_collectDeltaState(Tstar_v, Fe, ipc, ip, el) if (iand(debug_level(debug_constitutive), debug_levelBasic) /= 0_pInt) then call system_clock(count=tock,count_rate=tickrate,count_max=maxticks) !$OMP CRITICAL (debugTimingDeltaState) - debug_cumDeltaStateCalls = debug_cumDeltaStateCalls + 1_pInt - debug_cumDeltaStateTicks = debug_cumDeltaStateTicks + tock-tick + !debug_cumDeltaStateCalls = debug_cumDeltaStateCalls + 1_pInt + !debug_cumDeltaStateTicks = debug_cumDeltaStateTicks + tock-tick !$OMP FLUSH (debug_cumDeltaStateTicks) - if (tock < tick) debug_cumDeltaStateTicks = debug_cumDeltaStateTicks + maxticks + !if (tock < tick) debug_cumDeltaStateTicks = debug_cumDeltaStateTicks + maxticks !$OMP END CRITICAL (debugTimingDeltaState) endif diff --git a/src/crystallite.f90 b/src/crystallite.f90 index 12bf19871..a28c8f208 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -529,8 +529,8 @@ subroutine crystallite_stressAndItsTangent(updateJaco) debug_levelSelective, & debug_e, & debug_i, & - debug_g, & - debug_CrystalliteLoopDistribution + debug_g!, & + !debug_CrystalliteLoopDistribution use IO, only: & IO_warning, & IO_error @@ -949,8 +949,8 @@ subroutine crystallite_stressAndItsTangent(updateJaco) if (iand(debug_level(debug_crystallite),debug_levelBasic) /= 0_pInt & .and. formerSubStep > 0.0_pReal) then !$OMP CRITICAL (distributionCrystallite) - debug_CrystalliteLoopDistribution(min(nCryst+1_pInt,NiterationCrystallite)) = & - debug_CrystalliteLoopDistribution(min(nCryst+1_pInt,NiterationCrystallite)) + 1_pInt + !debug_CrystalliteLoopDistribution(min(nCryst+1_pInt,NiterationCrystallite)) = & + !debug_CrystalliteLoopDistribution(min(nCryst+1_pInt,NiterationCrystallite)) + 1_pInt !$OMP END CRITICAL (distributionCrystallite) endif endif @@ -1259,8 +1259,8 @@ subroutine crystallite_integrateStateRK4() debug_crystallite, & debug_levelBasic, & debug_levelExtensive, & - debug_levelSelective, & - debug_StateLoopDistribution + debug_levelSelective !, & + !debug_StateLoopDistribution use FEsolving, only: & FEsolving_execElem, & FEsolving_execIP @@ -1519,8 +1519,8 @@ subroutine crystallite_integrateStateRK4() crystallite_converged(g,i,e) = .true. ! if still "to do" then converged per definitionem if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - debug_StateLoopDistribution(4,numerics_integrationMode) = & - debug_StateLoopDistribution(4,numerics_integrationMode) + 1_pInt + !debug_StateLoopDistribution(4,numerics_integrationMode) = & + !debug_StateLoopDistribution(4,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -1555,8 +1555,8 @@ subroutine crystallite_integrateStateRKCK45() debug_crystallite, & debug_levelBasic, & debug_levelExtensive, & - debug_levelSelective, & - debug_StateLoopDistribution + debug_levelSelective!, & + !debug_StateLoopDistribution use numerics, only: & rTol_crystalliteState, & numerics_integrationMode @@ -2023,8 +2023,8 @@ subroutine crystallite_integrateStateRKCK45() crystallite_converged(g,i,e) = .true. ! if still "to do" then converged per definition if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - debug_StateLoopDistribution(6,numerics_integrationMode) = & - debug_StateLoopDistribution(6,numerics_integrationMode) + 1_pInt + !debug_StateLoopDistribution(6,numerics_integrationMode) = & + !debug_StateLoopDistribution(6,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -2060,8 +2060,8 @@ subroutine crystallite_integrateStateAdaptiveEuler() debug_crystallite, & debug_levelBasic, & debug_levelExtensive, & - debug_levelSelective, & - debug_StateLoopDistribution + debug_levelSelective!, & + !debug_StateLoopDistribution use numerics, only: & rTol_crystalliteState, & numerics_integrationMode @@ -2365,8 +2365,8 @@ subroutine crystallite_integrateStateAdaptiveEuler() crystallite_converged(g,i,e) = .true. ! ... converged per definitionem if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - debug_StateLoopDistribution(2,numerics_integrationMode) = & - debug_StateLoopDistribution(2,numerics_integrationMode) + 1_pInt + !debug_StateLoopDistribution(2,numerics_integrationMode) = & + !debug_StateLoopDistribution(2,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -2383,8 +2383,8 @@ subroutine crystallite_integrateStateAdaptiveEuler() crystallite_converged(g,i,e) = .true. ! ... converged per definitionem if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - debug_StateLoopDistribution(2,numerics_integrationMode) = & - debug_StateLoopDistribution(2,numerics_integrationMode) + 1_pInt + !debug_StateLoopDistribution(2,numerics_integrationMode) = & + !debug_StateLoopDistribution(2,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -2422,8 +2422,8 @@ subroutine crystallite_integrateStateEuler() debug_crystallite, & debug_levelBasic, & debug_levelExtensive, & - debug_levelSelective, & - debug_StateLoopDistribution + debug_levelSelective!, & + !debug_StateLoopDistribution use numerics, only: & numerics_integrationMode, & numerics_timeSyncing @@ -2608,8 +2608,8 @@ eIter = FEsolving_execElem(1:2) crystallite_converged(g,i,e) = .true. ! if still "to do" then converged per definitionem if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - debug_StateLoopDistribution(1,numerics_integrationMode) = & - debug_StateLoopDistribution(1,numerics_integrationMode) + 1_pInt + !debug_StateLoopDistribution(1,numerics_integrationMode) = & + !debug_StateLoopDistribution(1,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -2647,8 +2647,8 @@ subroutine crystallite_integrateStateFPI() debug_crystallite, & debug_levelBasic, & debug_levelExtensive, & - debug_levelSelective, & - debug_StateLoopDistribution + debug_levelSelective!, & + !debug_StateLoopDistribution use numerics, only: & nState, & numerics_integrationMode, & @@ -3025,8 +3025,8 @@ subroutine crystallite_integrateStateFPI() if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - debug_StateLoopDistribution(NiterationState,numerics_integrationMode) = & - debug_StateLoopDistribution(NiterationState,numerics_integrationMode) + 1_pInt + !debug_StateLoopDistribution(NiterationState,numerics_integrationMode) = & + !debug_StateLoopDistribution(NiterationState,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -3246,12 +3246,12 @@ logical function crystallite_integrateStress(& #ifdef DEBUG debug_e, & debug_i, & - debug_g, & + debug_g!, & #endif - debug_cumLpCalls, & - debug_cumLpTicks, & - debug_StressLoopLpDistribution, & - debug_StressLoopLiDistribution + !debug_cumLpCalls, & + !debug_cumLpTicks, & + !debug_StressLoopLpDistribution, & + !debug_StressLoopLiDistribution use constitutive, only: constitutive_LpAndItsTangent, & constitutive_LiAndItsTangent, & constitutive_TandItsTangent @@ -3353,7 +3353,7 @@ logical function crystallite_integrateStress(& if (iand(debug_level(debug_crystallite), debug_levelExtensive) /= 0_pInt & .and. ((el == debug_e .and. ip == debug_i .and. ipc == debug_g) & .or. .not. iand(debug_level(debug_crystallite), debug_levelSelective) /= 0_pInt)) & - write(6,'(a,i8,1x,i2,1x,i3)') '<< CRYST >> integrateStress at el ip ipc ',el,ip,ipc + write(6,'(a,i8,1x,i2,1x,i3)') '<< CRYST >> integrateStress at el ip ipc ',el,ip,ipc #endif !* only integrate over fraction of timestep? @@ -3477,10 +3477,10 @@ logical function crystallite_integrateStress(& if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then call system_clock(count=tock,count_rate=tickrate,count_max=maxticks) !$OMP CRITICAL (debugTimingLpTangent) - debug_cumLpCalls = debug_cumLpCalls + 1_pInt - debug_cumLpTicks = debug_cumLpTicks + tock-tick + !debug_cumLpCalls = debug_cumLpCalls + 1_pInt + !debug_cumLpTicks = debug_cumLpTicks + tock-tick !$OMP FLUSH (debug_cumLpTicks) - if (tock < tick) debug_cumLpTicks = debug_cumLpTicks + maxticks + !if (tock < tick) debug_cumLpTicks = debug_cumLpTicks + maxticks !$OMP END CRITICAL (debugTimingLpTangent) endif @@ -3583,8 +3583,8 @@ logical function crystallite_integrateStress(& if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionStress) - debug_StressLoopLpDistribution(NiterationStressLp,numerics_integrationMode) = & - debug_StressLoopLpDistribution(NiterationStressLp,numerics_integrationMode) + 1_pInt + !debug_StressLoopLpDistribution(NiterationStressLp,numerics_integrationMode) = & + !debug_StressLoopLpDistribution(NiterationStressLp,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionStress) endif @@ -3670,8 +3670,8 @@ logical function crystallite_integrateStress(& if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionStress) - debug_StressLoopLiDistribution(NiterationStressLi,numerics_integrationMode) = & - debug_StressLoopLiDistribution(NiterationStressLi,numerics_integrationMode) + 1_pInt + !debug_StressLoopLiDistribution(NiterationStressLi,numerics_integrationMode) = & + !debug_StressLoopLiDistribution(NiterationStressLi,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionStress) endif diff --git a/src/debug.f90 b/src/debug.f90 index feb1c9fe4..e07a2e12a 100644 --- a/src/debug.f90 +++ b/src/debug.f90 @@ -46,20 +46,20 @@ module debug integer(pInt),protected, dimension(debug_maxNtype+2_pInt), public :: & ! specific ones, and 2 for "all" and "other" debug_level = 0_pInt - integer(pLongInt), public :: & - debug_cumLpCalls = 0_pLongInt, & !< total number of calls to LpAndItsTangent - debug_cumDeltaStateCalls = 0_pLongInt, & !< total number of calls to deltaState - debug_cumDotStateCalls = 0_pLongInt !< total number of calls to dotState + !integer(pLongInt), public :: & + !debug_cumLpCalls = 0_pLongInt, & !< total number of calls to LpAndItsTangent + !debug_cumDeltaStateCalls = 0_pLongInt, & !< total number of calls to deltaState + !debug_cumDotStateCalls = 0_pLongInt !< total number of calls to dotState integer(pInt), protected, public :: & debug_e = 1_pInt, & debug_i = 1_pInt, & debug_g = 1_pInt - integer(pLongInt), public :: & - debug_cumLpTicks = 0_pLongInt, & !< total cpu ticks spent in LpAndItsTangent - debug_cumDeltaStateTicks = 0_pLongInt, & !< total cpu ticks spent in deltaState - debug_cumDotStateTicks = 0_pLongInt !< total cpu ticks spent in dotState + !integer(pLongInt), public :: & + !debug_cumLpTicks = 0_pLongInt, & !< total cpu ticks spent in LpAndItsTangent + !debug_cumDeltaStateTicks = 0_pLongInt, & !< total cpu ticks spent in deltaState + !debug_cumDotStateTicks = 0_pLongInt !< total cpu ticks spent in dotState integer(pInt), dimension(2), public :: & debug_stressMaxLocation = 0_pInt, & @@ -68,15 +68,15 @@ module debug debug_jacobianMinLocation = 0_pInt - integer(pInt), dimension(:), allocatable, public :: & - debug_CrystalliteLoopDistribution, & !< distribution of crystallite cutbacks - debug_MaterialpointStateLoopDistribution, & - debug_MaterialpointLoopDistribution + !integer(pInt), dimension(:), allocatable, public :: & + !debug_CrystalliteLoopDistribution, & !< distribution of crystallite cutbacks + !debug_MaterialpointStateLoopDistribution, & + !debug_MaterialpointLoopDistribution - integer(pInt), dimension(:,:), allocatable, public :: & - debug_StressLoopLiDistribution, & !< distribution of stress iterations until convergence - debug_StressLoopLpDistribution, & !< distribution of stress iterations until convergence - debug_StateLoopDistribution !< distribution of state iterations until convergence + !integer(pInt), dimension(:,:), allocatable, public :: & + !debug_StressLoopLiDistribution, & !< distribution of stress iterations until convergence + !debug_StressLoopLpDistribution, & !< distribution of stress iterations until convergence + !debug_StateLoopDistribution !< distribution of state iterations until convergence real(pReal), public :: & debug_stressMax = -huge(1.0_pReal), & @@ -107,12 +107,12 @@ subroutine debug_init compiler_version, & compiler_options #endif - use numerics, only: & - nStress, & - nState, & - nCryst, & - nMPstate, & - nHomog +! use numerics, only: & +! nStress, & +! nState, & +! nCryst, & +! nMPstate, & +! nHomog use IO, only: & IO_read, & IO_error, & @@ -137,12 +137,12 @@ subroutine debug_init write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - allocate(debug_StressLoopLpDistribution(nStress+1,2), source=0_pInt) - allocate(debug_StressLoopLiDistribution(nStress+1,2), source=0_pInt) - allocate(debug_StateLoopDistribution(nState+1,2), source=0_pInt) - allocate(debug_CrystalliteLoopDistribution(nCryst+1), source=0_pInt) - allocate(debug_MaterialpointStateLoopDistribution(nMPstate), source=0_pInt) - allocate(debug_MaterialpointLoopDistribution(nHomog+1), source=0_pInt) + !allocate(debug_StressLoopLpDistribution(nStress+1,2), source=0_pInt) + !allocate(debug_StressLoopLiDistribution(nStress+1,2), source=0_pInt) + !allocate(debug_StateLoopDistribution(nState+1,2), source=0_pInt) + !allocate(debug_CrystalliteLoopDistribution(nCryst+1), source=0_pInt) + !allocate(debug_MaterialpointStateLoopDistribution(nMPstate), source=0_pInt) + !allocate(debug_MaterialpointLoopDistribution(nHomog+1), source=0_pInt) !-------------------------------------------------------------------------------------------------- ! try to open the config file @@ -297,18 +297,18 @@ subroutine debug_reset implicit none - debug_StressLoopLpDistribution = 0_pInt - debug_StressLoopLiDistribution = 0_pInt - debug_StateLoopDistribution = 0_pInt - debug_CrystalliteLoopDistribution = 0_pInt - debug_MaterialpointStateLoopDistribution = 0_pInt - debug_MaterialpointLoopDistribution = 0_pInt - debug_cumLpTicks = 0_pLongInt - debug_cumDeltaStateTicks = 0_pLongInt - debug_cumDotStateTicks = 0_pLongInt - debug_cumLpCalls = 0_pInt - debug_cumDeltaStateCalls = 0_pInt - debug_cumDotStateCalls = 0_pInt + !debug_StressLoopLpDistribution = 0_pInt + !debug_StressLoopLiDistribution = 0_pInt + !debug_StateLoopDistribution = 0_pInt + !debug_CrystalliteLoopDistribution = 0_pInt + !debug_MaterialpointStateLoopDistribution = 0_pInt + !debug_MaterialpointLoopDistribution = 0_pInt + !debug_cumLpTicks = 0_pLongInt + !debug_cumDeltaStateTicks = 0_pLongInt + !debug_cumDotStateTicks = 0_pLongInt + !debug_cumLpCalls = 0_pInt + !debug_cumDeltaStateCalls = 0_pInt + !debug_cumDotStateCalls = 0_pInt debug_stressMaxLocation = 0_pInt debug_stressMinLocation = 0_pInt debug_jacobianMaxLocation = 0_pInt @@ -325,123 +325,123 @@ end subroutine debug_reset !> @brief writes debug statements to standard out !-------------------------------------------------------------------------------------------------- subroutine debug_info - use numerics, only: & - nStress, & - nState, & - nCryst, & - nMPstate, & - nHomog +! use numerics, only: & +! nStress, & +! nState, & +! nCryst, & +! nMPstate, & +! nHomog implicit none - integer(pInt) :: j,integral - integer(pLongInt) :: tickrate + !integer(pInt) :: j,integral + !integer(pLongInt) :: tickrate character(len=1) :: exceed - call system_clock(count_rate=tickrate) + !call system_clock(count_rate=tickrate) !$OMP CRITICAL (write2out) - debugOutputCryst: if (iand(debug_level(debug_CRYSTALLITE),debug_LEVELBASIC) /= 0) then - write(6,'(/,a,/)') ' DEBUG Info (from previous cycle)' - write(6,'(a33,1x,i12)') 'total calls to LpAndItsTangent :',debug_cumLpCalls - if (debug_cumLpCalls > 0_pInt) then - write(6,'(a33,1x,f12.3)') 'total CPU time/s :',& - real(debug_cumLpTicks,pReal)/real(tickrate,pReal) - write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',& - real(debug_cumLpTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumLpCalls,pReal) - endif - write(6,'(/,a33,1x,i12)') 'total calls to collectDotState :',debug_cumDotStateCalls - if (debug_cumdotStateCalls > 0_pInt) then - write(6,'(a33,1x,f12.3)') 'total CPU time/s :',& - real(debug_cumDotStateTicks,pReal)/real(tickrate,pReal) - write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',& - real(debug_cumDotStateTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumDotStateCalls,pReal) - endif - write(6,'(/,a33,1x,i12)') 'total calls to collectDeltaState:',debug_cumDeltaStateCalls - if (debug_cumDeltaStateCalls > 0_pInt) then - write(6,'(a33,1x,f12.3)') 'total CPU time/s :',& - real(debug_cumDeltaStateTicks,pReal)/real(tickrate,pReal) - write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',& - real(debug_cumDeltaStateTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumDeltaStateCalls,pReal) - endif + !debugOutputCryst: if (iand(debug_level(debug_CRYSTALLITE),debug_LEVELBASIC) /= 0) then + !write(6,'(/,a,/)') ' DEBUG Info (from previous cycle)' + !write(6,'(a33,1x,i12)') 'total calls to LpAndItsTangent :',debug_cumLpCalls + !if (debug_cumLpCalls > 0_pInt) then + !write(6,'(a33,1x,f12.3)') 'total CPU time/s :',& + !real(debug_cumLpTicks,pReal)/real(tickrate,pReal) + !!write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',& + !real(debug_cumLpTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumLpCalls,pReal) + !endif + !write(6,'(/,a33,1x,i12)') 'total calls to collectDotState :',debug_cumDotStateCalls + !if (debug_cumdotStateCalls > 0_pInt) then + !write(6,'(a33,1x,f12.3)') 'total CPU time/s :',& + !real(debug_cumDotStateTicks,pReal)/real(tickrate,pReal) + !write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',& + !real(debug_cumDotStateTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumDotStateCalls,pReal) + !endif + !write(6,'(/,a33,1x,i12)') 'total calls to collectDeltaState:',debug_cumDeltaStateCalls + !if (debug_cumDeltaStateCalls > 0_pInt) then + !write(6,'(a33,1x,f12.3)') 'total CPU time/s :',& + !real(debug_cumDeltaStateTicks,pReal)/real(tickrate,pReal) + !write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',& + !real(debug_cumDeltaStateTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumDeltaStateCalls,pReal) + !endif - integral = 0_pInt - write(6,'(3/,a)') 'distribution_StressLoopLp : stress stiffness' - do j=1_pInt,nStress+1_pInt - if (any(debug_StressLoopLpDistribution(j,:) /= 0_pInt )) then - integral = integral + j*(debug_StressLoopLpDistribution(j,1) + debug_StressLoopLpDistribution(j,2)) - exceed = ' ' - if (j > nStress) exceed = '+' ! last entry gets "+" - write(6,'(i25,a1,i10,1x,i10)') min(nStress,j),exceed,debug_StressLoopLpDistribution(j,1),& - debug_StressLoopLpDistribution(j,2) - endif - enddo - write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StressLoopLpDistribution(:,1)), & - sum(debug_StressLoopLpDistribution(:,2)) + !integral = 0_pInt + !write(6,'(3/,a)') 'distribution_StressLoopLp : stress stiffness' + !do j=1_pInt,nStress+1_pInt + !if (any(debug_StressLoopLpDistribution(j,:) /= 0_pInt )) then + !integral = integral + j*(debug_StressLoopLpDistribution(j,1) + debug_StressLoopLpDistribution(j,2)) + !exceed = ' ' + !if (j > nStress) exceed = '+' ! last entry gets "+" + !write(6,'(i25,a1,i10,1x,i10)') min(nStress,j),exceed,debug_StressLoopLpDistribution(j,1),& + !debug_StressLoopLpDistribution(j,2) + !endif + !enddo + !write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StressLoopLpDistribution(:,1)), & + !sum(debug_StressLoopLpDistribution(:,2)) - integral = 0_pInt - write(6,'(3/,a)') 'distribution_StressLoopLi : stress stiffness' - do j=1_pInt,nStress+1_pInt - if (any(debug_StressLoopLiDistribution(j,:) /= 0_pInt )) then - integral = integral + j*(debug_StressLoopLiDistribution(j,1) + debug_StressLoopLiDistribution(j,2)) - exceed = ' ' - if (j > nStress) exceed = '+' ! last entry gets "+" - write(6,'(i25,a1,i10,1x,i10)') min(nStress,j),exceed,debug_StressLoopLiDistribution(j,1),& - debug_StressLoopLiDistribution(j,2) - endif - enddo - write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StressLoopLiDistribution(:,1)), & - sum(debug_StressLoopLiDistribution(:,2)) + !integral = 0_pInt + !write(6,'(3/,a)') 'distribution_StressLoopLi : stress stiffness' + !do j=1_pInt,nStress+1_pInt + !if (any(debug_StressLoopLiDistribution(j,:) /= 0_pInt )) then + !integral = integral + j*(debug_StressLoopLiDistribution(j,1) + debug_StressLoopLiDistribution(j,2)) + !exceed = ' ' + !if (j > nStress) exceed = '+' ! last entry gets "+" + !write(6,'(i25,a1,i10,1x,i10)') min(nStress,j),exceed,debug_StressLoopLiDistribution(j,1),& + ! debug_StressLoopLiDistribution(j,2) + !endif + !enddo + !write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StressLoopLiDistribution(:,1)), & + ! sum(debug_StressLoopLiDistribution(:,2)) - integral = 0_pInt - write(6,'(2/,a)') 'distribution_CrystalliteStateLoop :' - do j=1_pInt,nState+1_pInt - if (any(debug_StateLoopDistribution(j,:) /= 0)) then - integral = integral + j*(debug_StateLoopDistribution(j,1) + debug_StateLoopDistribution(j,2)) - exceed = ' ' - if (j > nState) exceed = '+' ! last entry gets "+" - write(6,'(i25,a1,i10,1x,i10)') min(nState,j),exceed,debug_StateLoopDistribution(j,1),& - debug_StateLoopDistribution(j,2) - endif - enddo - write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StateLoopDistribution(:,1)), & - sum(debug_StateLoopDistribution(:,2)) + !integral = 0_pInt + !write(6,'(2/,a)') 'distribution_CrystalliteStateLoop :' + !do j=1_pInt,nState+1_pInt + !if (any(debug_StateLoopDistribution(j,:) /= 0)) then + !integral = integral + j*(debug_StateLoopDistribution(j,1) + debug_StateLoopDistribution(j,2)) + !exceed = ' ' + !if (j > nState) exceed = '+' ! last entry gets "+" + !write(6,'(i25,a1,i10,1x,i10)') min(nState,j),exceed,debug_StateLoopDistribution(j,1),& + ! debug_StateLoopDistribution(j,2) + !endif + !enddo + !write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StateLoopDistribution(:,1)), & + ! sum(debug_StateLoopDistribution(:,2)) - integral = 0_pInt - write(6,'(2/,a)') 'distribution_CrystalliteCutbackLoop :' - do j=1_pInt,nCryst+1_pInt - if (debug_CrystalliteLoopDistribution(j) /= 0) then - integral = integral + j*debug_CrystalliteLoopDistribution(j) - exceed = ' ' - if (j > nCryst) exceed = '+' - write(6,'(i25,a1,i10)') min(nCryst,j),exceed,debug_CrystalliteLoopDistribution(j) - endif - enddo - write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_CrystalliteLoopDistribution) - endif debugOutputCryst + !integral = 0_pInt + !write(6,'(2/,a)') 'distribution_CrystalliteCutbackLoop :' + !do j=1_pInt,nCryst+1_pInt + !if (debug_CrystalliteLoopDistribution(j) /= 0) then + !integral = integral + j*debug_CrystalliteLoopDistribution(j) + !exceed = ' ' + !if (j > nCryst) exceed = '+' + !write(6,'(i25,a1,i10)') min(nCryst,j),exceed,debug_CrystalliteLoopDistribution(j) + !endif + !enddo + !write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_CrystalliteLoopDistribution) + !endif debugOutputCryst - debugOutputHomog: if (iand(debug_level(debug_HOMOGENIZATION),debug_LEVELBASIC) /= 0) then - integral = 0_pInt - write(6,'(2/,a)') 'distribution_MaterialpointStateLoop :' - do j=1_pInt,nMPstate - if (debug_MaterialpointStateLoopDistribution(j) /= 0) then - integral = integral + j*debug_MaterialpointStateLoopDistribution(j) - write(6,'(i25,1x,i10)') j,debug_MaterialpointStateLoopDistribution(j) - endif - enddo - write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_MaterialpointStateLoopDistribution) + !debugOutputHomog: if (iand(debug_level(debug_HOMOGENIZATION),debug_LEVELBASIC) /= 0) then + !integral = 0_pInt + !write(6,'(2/,a)') 'distribution_MaterialpointStateLoop :' + !do j=1_pInt,nMPstate + !if (debug_MaterialpointStateLoopDistribution(j) /= 0) then + !integral = integral + j*debug_MaterialpointStateLoopDistribution(j) + !!write(6,'(i25,1x,i10)') j,debug_MaterialpointStateLoopDistribution(j) + !endif + !enddo + !write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_MaterialpointStateLoopDistribution) - integral = 0_pInt - write(6,'(2/,a)') 'distribution_MaterialpointCutbackLoop :' - do j=1_pInt,nHomog+1_pInt - if (debug_MaterialpointLoopDistribution(j) /= 0) then - integral = integral + j*debug_MaterialpointLoopDistribution(j) - exceed = ' ' - if (j > nHomog) exceed = '+' - write(6,'(i25,a1,i10)') min(nHomog,j),exceed,debug_MaterialpointLoopDistribution(j) - endif - enddo - write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_MaterialpointLoopDistribution) - endif debugOutputHomog + !integral = 0_pInt + !write(6,'(2/,a)') 'distribution_MaterialpointCutbackLoop :' + !do j=1_pInt,nHomog+1_pInt + !if (debug_MaterialpointLoopDistribution(j) /= 0) then + ! integral = integral + j*debug_MaterialpointLoopDistribution(j) + !exceed = ' ' + !if (j > nHomog) exceed = '+' + !write(6,'(i25,a1,i10)') min(nHomog,j),exceed,debug_MaterialpointLoopDistribution(j) + !endif + !enddo + !write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_MaterialpointLoopDistribution) + !endif debugOutputHomog debugOutputCPFEM: if (iand(debug_level(debug_CPFEM),debug_LEVELBASIC) /= 0 & .and. any(debug_stressMinLocation /= 0_pInt) & diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 7dbea41d5..b1595b9dd 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -545,9 +545,9 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) debug_levelExtensive, & debug_levelSelective, & debug_e, & - debug_i, & - debug_MaterialpointLoopDistribution, & - debug_MaterialpointStateLoopDistribution + debug_i!, & + !debug_MaterialpointLoopDistribution, & + !debug_MaterialpointStateLoopDistribution implicit none real(pReal), intent(in) :: dt !< time increment @@ -719,8 +719,8 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) elseif (materialpoint_requested(i,e)) then steppingNeeded ! already at final time (??) if (iand(debug_level(debug_homogenization), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionHomog) - debug_MaterialpointLoopDistribution(min(nHomog+1,NiterationHomog)) = & - debug_MaterialpointLoopDistribution(min(nHomog+1,NiterationHomog)) + 1 + !debug_MaterialpointLoopDistribution(min(nHomog+1,NiterationHomog)) = & + !debug_MaterialpointLoopDistribution(min(nHomog+1,NiterationHomog)) + 1 !$OMP END CRITICAL (distributionHomog) endif endif steppingNeeded @@ -865,8 +865,8 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) if (materialpoint_converged(i,e)) then if (iand(debug_level(debug_homogenization), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionMPState) - debug_MaterialpointStateLoopdistribution(NiterationMPstate) = & - debug_MaterialpointStateLoopdistribution(NiterationMPstate) + 1_pInt + !debug_MaterialpointStateLoopdistribution(NiterationMPstate) = & + !debug_MaterialpointStateLoopdistribution(NiterationMPstate) + 1_pInt !$OMP END CRITICAL (distributionMPState) endif endif From 4d393518ac180ed35210038c0abcb08eb846a379 Mon Sep 17 00:00:00 2001 From: Arka Lahiri Date: Wed, 9 May 2018 16:54:06 +0200 Subject: [PATCH 2/5] did only compile with BUILD_TYPE=DEBUG --- src/constitutive.f90 | 19 ------------------- src/crystallite.f90 | 28 ++++++---------------------- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index 27e81e03e..bcb895a71 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -948,15 +948,6 @@ subroutine constitutive_collectDotState(Tstar_v, FeArray, FpArray, subdt, subfra end select sourceType enddo SourceLoop - if (iand(debug_level(debug_constitutive), debug_levelBasic) /= 0_pInt) then - call system_clock(count=tock,count_rate=tickrate,count_max=maxticks) - !$OMP CRITICAL (debugTimingDotState) - !debug_cumDotStateCalls = debug_cumDotStateCalls + 1_pInt - !debug_cumDotStateTicks = debug_cumDotStateTicks + tock-tick - !$OMP FLUSH (debug_cumDotStateTicks) - !if (tock < tick) debug_cumDotStateTicks = debug_cumDotStateTicks + maxticks - !$OMP END CRITICAL (debugTimingDotState) - endif end subroutine constitutive_collectDotState !-------------------------------------------------------------------------------------------------- @@ -1032,16 +1023,6 @@ subroutine constitutive_collectDeltaState(Tstar_v, Fe, ipc, ip, el) end select sourceType enddo SourceLoop - if (iand(debug_level(debug_constitutive), debug_levelBasic) /= 0_pInt) then - call system_clock(count=tock,count_rate=tickrate,count_max=maxticks) - !$OMP CRITICAL (debugTimingDeltaState) - !debug_cumDeltaStateCalls = debug_cumDeltaStateCalls + 1_pInt - !debug_cumDeltaStateTicks = debug_cumDeltaStateTicks + tock-tick - !$OMP FLUSH (debug_cumDeltaStateTicks) - !if (tock < tick) debug_cumDeltaStateTicks = debug_cumDeltaStateTicks + maxticks - !$OMP END CRITICAL (debugTimingDeltaState) - endif - end subroutine constitutive_collectDeltaState diff --git a/src/crystallite.f90 b/src/crystallite.f90 index a28c8f208..b73d11b17 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -3239,19 +3239,16 @@ logical function crystallite_integrateStress(& subStepSizeLp, & subStepSizeLi use debug, only: debug_level, & - debug_crystallite, & - debug_levelBasic, & - debug_levelExtensive, & - debug_levelSelective, & #ifdef DEBUG debug_e, & debug_i, & - debug_g!, & + debug_g, & #endif - !debug_cumLpCalls, & - !debug_cumLpTicks, & - !debug_StressLoopLpDistribution, & - !debug_StressLoopLiDistribution + debug_crystallite, & + debug_levelBasic, & + debug_levelExtensive, & + debug_levelSelective + use constitutive, only: constitutive_LpAndItsTangent, & constitutive_LiAndItsTangent, & constitutive_TandItsTangent @@ -3457,9 +3454,6 @@ logical function crystallite_integrateStress(& !* calculate plastic velocity gradient and its tangent from constitutive law - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) & - call system_clock(count=tick,count_rate=tickrate,count_max=maxticks) - #ifdef DEBUG if (iand(debug_level(debug_crystallite), debug_levelExtensive) /= 0_pInt & .and. ((el == debug_e .and. ip == debug_i .and. ipc == debug_g) & @@ -3474,16 +3468,6 @@ logical function crystallite_integrateStress(& call constitutive_LpAndItsTangent(Lp_constitutive, dLp_dT3333, dLp_dFi3333, & Tstar_v, Fi_new, ipc, ip, el) - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then - call system_clock(count=tock,count_rate=tickrate,count_max=maxticks) - !$OMP CRITICAL (debugTimingLpTangent) - !debug_cumLpCalls = debug_cumLpCalls + 1_pInt - !debug_cumLpTicks = debug_cumLpTicks + tock-tick - !$OMP FLUSH (debug_cumLpTicks) - !if (tock < tick) debug_cumLpTicks = debug_cumLpTicks + maxticks - !$OMP END CRITICAL (debugTimingLpTangent) - endif - #ifdef DEBUG if (iand(debug_level(debug_crystallite), debug_levelExtensive) /= 0_pInt & .and. ((el == debug_e .and. ip == debug_i .and. ipc == debug_g) & From c45d9f9ee9f7ae710b17cf21ea6211a6265168c9 Mon Sep 17 00:00:00 2001 From: Arka Lahiri Date: Thu, 17 May 2018 16:33:35 +0200 Subject: [PATCH 3/5] Deleted performance profiling code --- src/constitutive.f90 | 4 -- src/crystallite.f90 | 36 ++-------- src/debug.f90 | 159 +---------------------------------------- src/homogenization.f90 | 8 +-- 4 files changed, 9 insertions(+), 198 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index bcb895a71..7f1bff89e 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -838,8 +838,6 @@ subroutine constitutive_collectDotState(Tstar_v, FeArray, FpArray, subdt, subfra pReal, & pLongInt use debug, only: & - !debug_cumDotStateCalls, & - !debug_cumDotStateTicks, & debug_level, & debug_constitutive, & debug_levelBasic @@ -959,8 +957,6 @@ subroutine constitutive_collectDeltaState(Tstar_v, Fe, ipc, ip, el) pReal, & pLongInt use debug, only: & - !debug_cumDeltaStateCalls, & - !debug_cumDeltaStateTicks, & debug_level, & debug_constitutive, & debug_levelBasic diff --git a/src/crystallite.f90 b/src/crystallite.f90 index b73d11b17..dd497ad17 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -529,8 +529,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) debug_levelSelective, & debug_e, & debug_i, & - debug_g!, & - !debug_CrystalliteLoopDistribution + debug_g use IO, only: & IO_warning, & IO_error @@ -949,8 +948,6 @@ subroutine crystallite_stressAndItsTangent(updateJaco) if (iand(debug_level(debug_crystallite),debug_levelBasic) /= 0_pInt & .and. formerSubStep > 0.0_pReal) then !$OMP CRITICAL (distributionCrystallite) - !debug_CrystalliteLoopDistribution(min(nCryst+1_pInt,NiterationCrystallite)) = & - !debug_CrystalliteLoopDistribution(min(nCryst+1_pInt,NiterationCrystallite)) + 1_pInt !$OMP END CRITICAL (distributionCrystallite) endif endif @@ -1259,8 +1256,7 @@ subroutine crystallite_integrateStateRK4() debug_crystallite, & debug_levelBasic, & debug_levelExtensive, & - debug_levelSelective !, & - !debug_StateLoopDistribution + debug_levelSelective use FEsolving, only: & FEsolving_execElem, & FEsolving_execIP @@ -1519,8 +1515,6 @@ subroutine crystallite_integrateStateRK4() crystallite_converged(g,i,e) = .true. ! if still "to do" then converged per definitionem if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - !debug_StateLoopDistribution(4,numerics_integrationMode) = & - !debug_StateLoopDistribution(4,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -1555,8 +1549,7 @@ subroutine crystallite_integrateStateRKCK45() debug_crystallite, & debug_levelBasic, & debug_levelExtensive, & - debug_levelSelective!, & - !debug_StateLoopDistribution + debug_levelSelective use numerics, only: & rTol_crystalliteState, & numerics_integrationMode @@ -2023,8 +2016,6 @@ subroutine crystallite_integrateStateRKCK45() crystallite_converged(g,i,e) = .true. ! if still "to do" then converged per definition if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - !debug_StateLoopDistribution(6,numerics_integrationMode) = & - !debug_StateLoopDistribution(6,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -2060,8 +2051,7 @@ subroutine crystallite_integrateStateAdaptiveEuler() debug_crystallite, & debug_levelBasic, & debug_levelExtensive, & - debug_levelSelective!, & - !debug_StateLoopDistribution + debug_levelSelective use numerics, only: & rTol_crystalliteState, & numerics_integrationMode @@ -2365,8 +2355,6 @@ subroutine crystallite_integrateStateAdaptiveEuler() crystallite_converged(g,i,e) = .true. ! ... converged per definitionem if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - !debug_StateLoopDistribution(2,numerics_integrationMode) = & - !debug_StateLoopDistribution(2,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -2383,8 +2371,6 @@ subroutine crystallite_integrateStateAdaptiveEuler() crystallite_converged(g,i,e) = .true. ! ... converged per definitionem if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - !debug_StateLoopDistribution(2,numerics_integrationMode) = & - !debug_StateLoopDistribution(2,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -2422,8 +2408,7 @@ subroutine crystallite_integrateStateEuler() debug_crystallite, & debug_levelBasic, & debug_levelExtensive, & - debug_levelSelective!, & - !debug_StateLoopDistribution + debug_levelSelective use numerics, only: & numerics_integrationMode, & numerics_timeSyncing @@ -2608,8 +2593,6 @@ eIter = FEsolving_execElem(1:2) crystallite_converged(g,i,e) = .true. ! if still "to do" then converged per definitionem if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - !debug_StateLoopDistribution(1,numerics_integrationMode) = & - !debug_StateLoopDistribution(1,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -2647,8 +2630,7 @@ subroutine crystallite_integrateStateFPI() debug_crystallite, & debug_levelBasic, & debug_levelExtensive, & - debug_levelSelective!, & - !debug_StateLoopDistribution + debug_levelSelective use numerics, only: & nState, & numerics_integrationMode, & @@ -3025,8 +3007,6 @@ subroutine crystallite_integrateStateFPI() if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionState) - !debug_StateLoopDistribution(NiterationState,numerics_integrationMode) = & - !debug_StateLoopDistribution(NiterationState,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionState) endif endif @@ -3567,8 +3547,6 @@ logical function crystallite_integrateStress(& if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionStress) - !debug_StressLoopLpDistribution(NiterationStressLp,numerics_integrationMode) = & - !debug_StressLoopLpDistribution(NiterationStressLp,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionStress) endif @@ -3654,8 +3632,6 @@ logical function crystallite_integrateStress(& if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionStress) - !debug_StressLoopLiDistribution(NiterationStressLi,numerics_integrationMode) = & - !debug_StressLoopLiDistribution(NiterationStressLi,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionStress) endif diff --git a/src/debug.f90 b/src/debug.f90 index e07a2e12a..ea2b659a1 100644 --- a/src/debug.f90 +++ b/src/debug.f90 @@ -46,21 +46,11 @@ module debug integer(pInt),protected, dimension(debug_maxNtype+2_pInt), public :: & ! specific ones, and 2 for "all" and "other" debug_level = 0_pInt - !integer(pLongInt), public :: & - !debug_cumLpCalls = 0_pLongInt, & !< total number of calls to LpAndItsTangent - !debug_cumDeltaStateCalls = 0_pLongInt, & !< total number of calls to deltaState - !debug_cumDotStateCalls = 0_pLongInt !< total number of calls to dotState - integer(pInt), protected, public :: & debug_e = 1_pInt, & debug_i = 1_pInt, & debug_g = 1_pInt - !integer(pLongInt), public :: & - !debug_cumLpTicks = 0_pLongInt, & !< total cpu ticks spent in LpAndItsTangent - !debug_cumDeltaStateTicks = 0_pLongInt, & !< total cpu ticks spent in deltaState - !debug_cumDotStateTicks = 0_pLongInt !< total cpu ticks spent in dotState - integer(pInt), dimension(2), public :: & debug_stressMaxLocation = 0_pInt, & debug_stressMinLocation = 0_pInt, & @@ -68,16 +58,6 @@ module debug debug_jacobianMinLocation = 0_pInt - !integer(pInt), dimension(:), allocatable, public :: & - !debug_CrystalliteLoopDistribution, & !< distribution of crystallite cutbacks - !debug_MaterialpointStateLoopDistribution, & - !debug_MaterialpointLoopDistribution - - !integer(pInt), dimension(:,:), allocatable, public :: & - !debug_StressLoopLiDistribution, & !< distribution of stress iterations until convergence - !debug_StressLoopLpDistribution, & !< distribution of stress iterations until convergence - !debug_StateLoopDistribution !< distribution of state iterations until convergence - real(pReal), public :: & debug_stressMax = -huge(1.0_pReal), & debug_stressMin = huge(1.0_pReal), & @@ -107,12 +87,7 @@ subroutine debug_init compiler_version, & compiler_options #endif -! use numerics, only: & -! nStress, & -! nState, & -! nCryst, & -! nMPstate, & -! nHomog + use IO, only: & IO_read, & IO_error, & @@ -137,13 +112,6 @@ subroutine debug_init write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - !allocate(debug_StressLoopLpDistribution(nStress+1,2), source=0_pInt) - !allocate(debug_StressLoopLiDistribution(nStress+1,2), source=0_pInt) - !allocate(debug_StateLoopDistribution(nState+1,2), source=0_pInt) - !allocate(debug_CrystalliteLoopDistribution(nCryst+1), source=0_pInt) - !allocate(debug_MaterialpointStateLoopDistribution(nMPstate), source=0_pInt) - !allocate(debug_MaterialpointLoopDistribution(nHomog+1), source=0_pInt) - !-------------------------------------------------------------------------------------------------- ! try to open the config file @@ -297,18 +265,6 @@ subroutine debug_reset implicit none - !debug_StressLoopLpDistribution = 0_pInt - !debug_StressLoopLiDistribution = 0_pInt - !debug_StateLoopDistribution = 0_pInt - !debug_CrystalliteLoopDistribution = 0_pInt - !debug_MaterialpointStateLoopDistribution = 0_pInt - !debug_MaterialpointLoopDistribution = 0_pInt - !debug_cumLpTicks = 0_pLongInt - !debug_cumDeltaStateTicks = 0_pLongInt - !debug_cumDotStateTicks = 0_pLongInt - !debug_cumLpCalls = 0_pInt - !debug_cumDeltaStateCalls = 0_pInt - !debug_cumDotStateCalls = 0_pInt debug_stressMaxLocation = 0_pInt debug_stressMinLocation = 0_pInt debug_jacobianMaxLocation = 0_pInt @@ -325,123 +281,12 @@ end subroutine debug_reset !> @brief writes debug statements to standard out !-------------------------------------------------------------------------------------------------- subroutine debug_info -! use numerics, only: & -! nStress, & -! nState, & -! nCryst, & -! nMPstate, & -! nHomog implicit none - !integer(pInt) :: j,integral - !integer(pLongInt) :: tickrate character(len=1) :: exceed - !call system_clock(count_rate=tickrate) - + !$OMP CRITICAL (write2out) - !debugOutputCryst: if (iand(debug_level(debug_CRYSTALLITE),debug_LEVELBASIC) /= 0) then - !write(6,'(/,a,/)') ' DEBUG Info (from previous cycle)' - !write(6,'(a33,1x,i12)') 'total calls to LpAndItsTangent :',debug_cumLpCalls - !if (debug_cumLpCalls > 0_pInt) then - !write(6,'(a33,1x,f12.3)') 'total CPU time/s :',& - !real(debug_cumLpTicks,pReal)/real(tickrate,pReal) - !!write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',& - !real(debug_cumLpTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumLpCalls,pReal) - !endif - !write(6,'(/,a33,1x,i12)') 'total calls to collectDotState :',debug_cumDotStateCalls - !if (debug_cumdotStateCalls > 0_pInt) then - !write(6,'(a33,1x,f12.3)') 'total CPU time/s :',& - !real(debug_cumDotStateTicks,pReal)/real(tickrate,pReal) - !write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',& - !real(debug_cumDotStateTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumDotStateCalls,pReal) - !endif - !write(6,'(/,a33,1x,i12)') 'total calls to collectDeltaState:',debug_cumDeltaStateCalls - !if (debug_cumDeltaStateCalls > 0_pInt) then - !write(6,'(a33,1x,f12.3)') 'total CPU time/s :',& - !real(debug_cumDeltaStateTicks,pReal)/real(tickrate,pReal) - !write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',& - !real(debug_cumDeltaStateTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumDeltaStateCalls,pReal) - !endif - - !integral = 0_pInt - !write(6,'(3/,a)') 'distribution_StressLoopLp : stress stiffness' - !do j=1_pInt,nStress+1_pInt - !if (any(debug_StressLoopLpDistribution(j,:) /= 0_pInt )) then - !integral = integral + j*(debug_StressLoopLpDistribution(j,1) + debug_StressLoopLpDistribution(j,2)) - !exceed = ' ' - !if (j > nStress) exceed = '+' ! last entry gets "+" - !write(6,'(i25,a1,i10,1x,i10)') min(nStress,j),exceed,debug_StressLoopLpDistribution(j,1),& - !debug_StressLoopLpDistribution(j,2) - !endif - !enddo - !write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StressLoopLpDistribution(:,1)), & - !sum(debug_StressLoopLpDistribution(:,2)) - - !integral = 0_pInt - !write(6,'(3/,a)') 'distribution_StressLoopLi : stress stiffness' - !do j=1_pInt,nStress+1_pInt - !if (any(debug_StressLoopLiDistribution(j,:) /= 0_pInt )) then - !integral = integral + j*(debug_StressLoopLiDistribution(j,1) + debug_StressLoopLiDistribution(j,2)) - !exceed = ' ' - !if (j > nStress) exceed = '+' ! last entry gets "+" - !write(6,'(i25,a1,i10,1x,i10)') min(nStress,j),exceed,debug_StressLoopLiDistribution(j,1),& - ! debug_StressLoopLiDistribution(j,2) - !endif - !enddo - !write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StressLoopLiDistribution(:,1)), & - ! sum(debug_StressLoopLiDistribution(:,2)) - - !integral = 0_pInt - !write(6,'(2/,a)') 'distribution_CrystalliteStateLoop :' - !do j=1_pInt,nState+1_pInt - !if (any(debug_StateLoopDistribution(j,:) /= 0)) then - !integral = integral + j*(debug_StateLoopDistribution(j,1) + debug_StateLoopDistribution(j,2)) - !exceed = ' ' - !if (j > nState) exceed = '+' ! last entry gets "+" - !write(6,'(i25,a1,i10,1x,i10)') min(nState,j),exceed,debug_StateLoopDistribution(j,1),& - ! debug_StateLoopDistribution(j,2) - !endif - !enddo - !write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StateLoopDistribution(:,1)), & - ! sum(debug_StateLoopDistribution(:,2)) - - !integral = 0_pInt - !write(6,'(2/,a)') 'distribution_CrystalliteCutbackLoop :' - !do j=1_pInt,nCryst+1_pInt - !if (debug_CrystalliteLoopDistribution(j) /= 0) then - !integral = integral + j*debug_CrystalliteLoopDistribution(j) - !exceed = ' ' - !if (j > nCryst) exceed = '+' - !write(6,'(i25,a1,i10)') min(nCryst,j),exceed,debug_CrystalliteLoopDistribution(j) - !endif - !enddo - !write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_CrystalliteLoopDistribution) - !endif debugOutputCryst - - !debugOutputHomog: if (iand(debug_level(debug_HOMOGENIZATION),debug_LEVELBASIC) /= 0) then - !integral = 0_pInt - !write(6,'(2/,a)') 'distribution_MaterialpointStateLoop :' - !do j=1_pInt,nMPstate - !if (debug_MaterialpointStateLoopDistribution(j) /= 0) then - !integral = integral + j*debug_MaterialpointStateLoopDistribution(j) - !!write(6,'(i25,1x,i10)') j,debug_MaterialpointStateLoopDistribution(j) - !endif - !enddo - !write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_MaterialpointStateLoopDistribution) - - !integral = 0_pInt - !write(6,'(2/,a)') 'distribution_MaterialpointCutbackLoop :' - !do j=1_pInt,nHomog+1_pInt - !if (debug_MaterialpointLoopDistribution(j) /= 0) then - ! integral = integral + j*debug_MaterialpointLoopDistribution(j) - !exceed = ' ' - !if (j > nHomog) exceed = '+' - !write(6,'(i25,a1,i10)') min(nHomog,j),exceed,debug_MaterialpointLoopDistribution(j) - !endif - !enddo - !write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_MaterialpointLoopDistribution) - !endif debugOutputHomog debugOutputCPFEM: if (iand(debug_level(debug_CPFEM),debug_LEVELBASIC) /= 0 & .and. any(debug_stressMinLocation /= 0_pInt) & diff --git a/src/homogenization.f90 b/src/homogenization.f90 index b1595b9dd..6db264989 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -545,9 +545,7 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) debug_levelExtensive, & debug_levelSelective, & debug_e, & - debug_i!, & - !debug_MaterialpointLoopDistribution, & - !debug_MaterialpointStateLoopDistribution + debug_i implicit none real(pReal), intent(in) :: dt !< time increment @@ -719,8 +717,6 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) elseif (materialpoint_requested(i,e)) then steppingNeeded ! already at final time (??) if (iand(debug_level(debug_homogenization), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionHomog) - !debug_MaterialpointLoopDistribution(min(nHomog+1,NiterationHomog)) = & - !debug_MaterialpointLoopDistribution(min(nHomog+1,NiterationHomog)) + 1 !$OMP END CRITICAL (distributionHomog) endif endif steppingNeeded @@ -865,8 +861,6 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) if (materialpoint_converged(i,e)) then if (iand(debug_level(debug_homogenization), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionMPState) - !debug_MaterialpointStateLoopdistribution(NiterationMPstate) = & - !debug_MaterialpointStateLoopdistribution(NiterationMPstate) + 1_pInt !$OMP END CRITICAL (distributionMPState) endif endif From efee9d98e72e025d1b2a7aa49e78a20f70f13e22 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 3 Jul 2018 21:58:28 +0200 Subject: [PATCH 4/5] elseif contained only debug statements, not needed --- src/homogenization.f90 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 23c2ccad5..75330e86c 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -720,11 +720,6 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) hydrogenfluxState(mappingHomogenization(2,i,e))%State( :,mappingHomogenization(1,i,e))! ...internal hydrogen transport state materialpoint_subF0(1:3,1:3,i,e) = materialpoint_subF(1:3,1:3,i,e) ! ...def grad !$OMP FLUSH(materialpoint_subF0) - elseif (materialpoint_requested(i,e)) then steppingNeeded ! already at final time (??) - if (iand(debug_level(debug_homogenization), debug_levelBasic) /= 0_pInt) then - !$OMP CRITICAL (distributionHomog) - !$OMP END CRITICAL (distributionHomog) - endif endif steppingNeeded else converged From 3c1012ef38672c7be3b5203cf73719289dafe387 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 3 Jul 2018 22:12:25 +0200 Subject: [PATCH 5/5] cut out more now useless pieces --- src/crystallite.f90 | 55 +++++---------------------------------------- 1 file changed, 5 insertions(+), 50 deletions(-) diff --git a/src/crystallite.f90 b/src/crystallite.f90 index dc8751978..29fda16ed 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -921,11 +921,6 @@ subroutine crystallite_stressAndItsTangent(updateJaco) else ! this crystallite just converged for the entire timestep crystallite_todo(c,i,e) = .false. ! so done here !$OMP FLUSH(crystallite_todo) - if (iand(debug_level(debug_crystallite),debug_levelBasic) /= 0_pInt & - .and. formerSubStep > 0.0_pReal) then - !$OMP CRITICAL (distributionCrystallite) - !$OMP END CRITICAL (distributionCrystallite) - endif endif ! --- cutback --- @@ -1488,13 +1483,7 @@ subroutine crystallite_integrateStateRK4() ! --- SET CONVERGENCE FLAG --- do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains - if (crystallite_todo(g,i,e)) then - crystallite_converged(g,i,e) = .true. ! if still "to do" then converged per definitionem - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then - !$OMP CRITICAL (distributionState) - !$OMP END CRITICAL (distributionState) - endif - endif + crystallite_converged(g,i,e) = crystallite_todo(g,i,e) .or. crystallite_converged(g,i,e) ! if still "to do" then converged per definitionem enddo; enddo; enddo @@ -1989,13 +1978,7 @@ subroutine crystallite_integrateStateRKCK45() ! --- SET CONVERGENCE FLAG --- !$OMP DO do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains - if (crystallite_todo(g,i,e)) then - crystallite_converged(g,i,e) = .true. ! if still "to do" then converged per definition - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then - !$OMP CRITICAL (distributionState) - !$OMP END CRITICAL (distributionState) - endif - endif + crystallite_converged(g,i,e) = crystallite_todo(g,i,e) .or. crystallite_converged(g,i,e) ! if still "to do" then converged per definition enddo; enddo; enddo !$OMP ENDDO @@ -2344,13 +2327,7 @@ subroutine crystallite_integrateStateAdaptiveEuler() !$OMP PARALLEL DO do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains - if (crystallite_todo(g,i,e)) then - crystallite_converged(g,i,e) = .true. ! ... converged per definitionem - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then - !$OMP CRITICAL (distributionState) - !$OMP END CRITICAL (distributionState) - endif - endif + crystallite_converged(g,i,e) = crystallite_todo(g,i,e) .or. crystallite_converged(g,i,e) ! ... converged per definitionem enddo; enddo; enddo !$OMP END PARALLEL DO @@ -2566,13 +2543,7 @@ eIter = FEsolving_execElem(1:2) !$OMP DO do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains - if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) then - crystallite_converged(g,i,e) = .true. ! if still "to do" then converged per definitionem - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then - !$OMP CRITICAL (distributionState) - !$OMP END CRITICAL (distributionState) - endif - endif + crystallite_converged(g,i,e) = crystallite_todo(g,i,e) .or. crystallite_converged(g,i,e) ! if still "to do" then converged per definitionem enddo; enddo; enddo !$OMP ENDDO @@ -2979,14 +2950,8 @@ subroutine crystallite_integrateStateFPI() .or. abs(sourceStateResiduum(1:mySizeSourceDotState,mySource)) < & rTol_crystalliteState * abs(tempSourceState(1:mySizeSourceDotState,mySource))) enddo - if (converged) then - crystallite_converged(g,i,e) = .true. ! ... converged per definition + if (converged) crystallite_converged(g,i,e) = .true. ! ... converged per definition - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then - !$OMP CRITICAL (distributionState) - !$OMP END CRITICAL (distributionState) - endif - endif plasticState(p)%state(1:mySizePlasticDotState,c) = & tempPlasticState(1:mySizePlasticDotState) do mySource = 1_pInt, phase_Nsources(p) @@ -3520,11 +3485,6 @@ logical function crystallite_integrateStress(& enddo LpLoop - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then - !$OMP CRITICAL (distributionStress) - !$OMP END CRITICAL (distributionStress) - endif - !* calculate intermediate velocity gradient and its tangent from constitutive law call constitutive_LiAndItsTangent(Li_constitutive, dLi_dT3333, dLi_dFi3333, & @@ -3605,11 +3565,6 @@ logical function crystallite_integrateStress(& Liguess = Liguess + steplengthLi * deltaLi enddo LiLoop - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then - !$OMP CRITICAL (distributionStress) - !$OMP END CRITICAL (distributionStress) - endif - !* calculate new plastic and elastic deformation gradient invFp_new = math_mul33x33(invFp_current,B)