* enclose wall time measurement for LpAndItsTangent and count of leapfrogbreaks by CRITICAL construct
* better use SINGLE (having an implicit barrier at the end) instead of MASTER construct * deleted all explicit BARRIERs after do loops since parallel loop construct implies barrier at the end
This commit is contained in:
parent
15728d3305
commit
b9b226548c
|
@ -1181,16 +1181,15 @@ endif
|
||||||
constitutive_dotState(g,i,e)%p = 0.0_pReal ! reset dotState to zero
|
constitutive_dotState(g,i,e)%p = 0.0_pReal ! reset dotState to zero
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- FIRST RUNGE KUTTA STEP ---
|
! --- FIRST RUNGE KUTTA STEP ---
|
||||||
if (verboseDebugger) then
|
if (verboseDebugger) then
|
||||||
!$OMP MASTER
|
!$OMP SINGLE
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,'(a,x,i1)') '<<<RUNGE KUTTA STEP',1
|
write(6,'(a,x,i1)') '<<<RUNGE KUTTA STEP',1
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
!$OMP END MASTER
|
!$OMP END SINGLE
|
||||||
endif
|
endif
|
||||||
!$OMP DO
|
!$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
|
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
|
||||||
|
@ -1213,7 +1212,6 @@ endif
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- SECOND TO SIXTH RUNGE KUTTA STEP ---
|
! --- SECOND TO SIXTH RUNGE KUTTA STEP ---
|
||||||
|
@ -1241,7 +1239,6 @@ do n = 1,5
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- update dependent states ---
|
! --- update dependent states ---
|
||||||
|
@ -1255,7 +1252,6 @@ do n = 1,5
|
||||||
constitutive_dotState(g,i,e)%p = 0.0_pReal ! reset dotState to zero
|
constitutive_dotState(g,i,e)%p = 0.0_pReal ! reset dotState to zero
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- stress integration ---
|
! --- stress integration ---
|
||||||
|
@ -1275,16 +1271,15 @@ do n = 1,5
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- dot state and RK dot state---
|
! --- dot state and RK dot state---
|
||||||
if (verboseDebugger) then
|
if (verboseDebugger) then
|
||||||
!$OMP MASTER
|
!$OMP SINGLE
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,'(a,x,i1)') '<<<RUNGE KUTTA STEP',n+1
|
write(6,'(a,x,i1)') '<<<RUNGE KUTTA STEP',n+1
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
!$OMP END MASTER
|
!$OMP END SINGLE
|
||||||
endif
|
endif
|
||||||
!$OMP DO
|
!$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
|
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
|
||||||
|
@ -1308,7 +1303,6 @@ do n = 1,5
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
@ -1389,7 +1383,6 @@ relTemperatureResiduum = 0.0_pReal
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- UPDATE DEPENDENT STATES IF RESIDUUM BELOW TOLERANCE ---
|
! --- UPDATE DEPENDENT STATES IF RESIDUUM BELOW TOLERANCE ---
|
||||||
|
@ -1402,7 +1395,6 @@ relTemperatureResiduum = 0.0_pReal
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- FINAL STRESS INTEGRATION STEP IF RESIDUUM BELOW TOLERANCE ---
|
! --- FINAL STRESS INTEGRATION STEP IF RESIDUUM BELOW TOLERANCE ---
|
||||||
|
@ -1988,7 +1980,6 @@ endif
|
||||||
constitutive_previousDotState2(g,i,e)%p = 0.0_pReal
|
constitutive_previousDotState2(g,i,e)%p = 0.0_pReal
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- DOT STATES ---
|
! --- DOT STATES ---
|
||||||
|
@ -2002,14 +1993,13 @@ endif
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- STATE & TEMPERATURE UPDATE ---
|
! --- STATE & TEMPERATURE UPDATE ---
|
||||||
|
|
||||||
!$OMP MASTER
|
!$OMP SINGLE
|
||||||
crystallite_statedamper = 1.0_pReal
|
crystallite_statedamper = 1.0_pReal
|
||||||
!$OMP END MASTER
|
!$OMP END SINGLE
|
||||||
!$OMP DO
|
!$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
|
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
|
if (crystallite_todo(g,i,e)) then
|
||||||
|
@ -2023,7 +2013,6 @@ endif
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- UPDATE DEPENDENT STATES ---
|
! --- UPDATE DEPENDENT STATES ---
|
||||||
|
@ -2039,21 +2028,19 @@ endif
|
||||||
constitutive_previousDotState2(g,i,e)%p = constitutive_previousDotState(g,i,e)%p
|
constitutive_previousDotState2(g,i,e)%p = constitutive_previousDotState(g,i,e)%p
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --+>> STATE LOOP <<+--
|
! --+>> STATE LOOP <<+--
|
||||||
|
|
||||||
!$OMP MASTER
|
!$OMP SINGLE
|
||||||
NiterationState = 0_pInt
|
NiterationState = 0_pInt
|
||||||
!$OMP END MASTER
|
!$OMP END SINGLE
|
||||||
|
|
||||||
do while (any(crystallite_todo) .and. NiterationState < nState ) ! convergence loop for crystallite
|
do while (any(crystallite_todo) .and. NiterationState < nState ) ! convergence loop for crystallite
|
||||||
|
|
||||||
!$OMP MASTER
|
!$OMP SINGLE
|
||||||
NiterationState = NiterationState + 1_pInt
|
NiterationState = NiterationState + 1_pInt
|
||||||
!$OMP END MASTER
|
!$OMP END SINGLE
|
||||||
|
|
||||||
|
|
||||||
! --- STRESS INTEGRATION ---
|
! --- STRESS INTEGRATION ---
|
||||||
|
|
||||||
|
@ -2069,14 +2056,13 @@ do while (any(crystallite_todo) .and. NiterationState < nState )
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
if (verboseDebugger .and. mode == 1) then
|
if (verboseDebugger .and. mode == 1) then
|
||||||
!$OMP MASTER
|
!$OMP SINGLE
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,*) count(crystallite_todo(:,:,:)),'grains todo after stress integration'
|
write(6,*) count(crystallite_todo(:,:,:)),'grains todo after stress integration'
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
!$OMP END MASTER
|
!$OMP END SINGLE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -2091,12 +2077,13 @@ do while (any(crystallite_todo) .and. NiterationState < nState )
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- STATE & TEMPERATURE UPDATE ---
|
! --- STATE & TEMPERATURE UPDATE ---
|
||||||
|
|
||||||
|
!$OMP SINGLE
|
||||||
crystallite_statedamper = 1.0_pReal
|
crystallite_statedamper = 1.0_pReal
|
||||||
|
!$OMP END SINGLE
|
||||||
!$OMP DO PRIVATE(dot_prod12,dot_prod22)
|
!$OMP DO PRIVATE(dot_prod12,dot_prod22)
|
||||||
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
|
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
|
if (crystallite_todo(g,i,e)) then
|
||||||
|
@ -2129,7 +2116,6 @@ do while (any(crystallite_todo) .and. NiterationState < nState )
|
||||||
endif
|
endif
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
! --- UPDATE DEPENDENT STATES ---
|
! --- UPDATE DEPENDENT STATES ---
|
||||||
|
@ -2145,16 +2131,15 @@ do while (any(crystallite_todo) .and. NiterationState < nState )
|
||||||
constitutive_previousDotState2(g,i,e)%p = constitutive_previousDotState(g,i,e)%p
|
constitutive_previousDotState2(g,i,e)%p = constitutive_previousDotState(g,i,e)%p
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
|
|
||||||
if (verboseDebugger .and. mode == 1) then
|
if (verboseDebugger .and. mode == 1) then
|
||||||
!$OMP MASTER
|
!$OMP SINGLE
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,*) count(crystallite_converged(:,:,:)),'grains converged after state integration no.', NiterationState
|
write(6,*) count(crystallite_converged(:,:,:)),'grains converged after state integration no.', NiterationState
|
||||||
write(6,*)
|
write(6,*)
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
!$OMP END MASTER
|
!$OMP END SINGLE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -2169,13 +2154,13 @@ do while (any(crystallite_todo) .and. NiterationState < nState )
|
||||||
crystallite_todo = crystallite_todo .and. .not. crystallite_converged ! skip all converged
|
crystallite_todo = crystallite_todo .and. .not. crystallite_converged ! skip all converged
|
||||||
|
|
||||||
if (verboseDebugger .and. mode == 1) then
|
if (verboseDebugger .and. mode == 1) then
|
||||||
!$OMP MASTER
|
!$OMP SINGLE
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,*) count(crystallite_converged(:,:,:)),'grains converged after non-local check'
|
write(6,*) count(crystallite_converged(:,:,:)),'grains converged after non-local check'
|
||||||
write(6,*) count(crystallite_todo(:,:,:)),'grains todo after state integration no.', NiterationState
|
write(6,*) count(crystallite_todo(:,:,:)),'grains todo after state integration no.', NiterationState
|
||||||
write(6,*)
|
write(6,*)
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
!$OMP END MASTER
|
!$OMP END SINGLE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
enddo ! crystallite convergence loop
|
enddo ! crystallite convergence loop
|
||||||
|
@ -2508,9 +2493,12 @@ LpLoop: do
|
||||||
call system_clock(count=tick,count_rate=tickrate,count_max=maxticks)
|
call system_clock(count=tick,count_rate=tickrate,count_max=maxticks)
|
||||||
call constitutive_LpAndItsTangent(Lp_constitutive, dLpdT_constitutive, Tstar_v, crystallite_Temperature(g,i,e), g, i, e)
|
call constitutive_LpAndItsTangent(Lp_constitutive, dLpdT_constitutive, Tstar_v, crystallite_Temperature(g,i,e), g, i, e)
|
||||||
call system_clock(count=tock,count_rate=tickrate,count_max=maxticks)
|
call system_clock(count=tock,count_rate=tickrate,count_max=maxticks)
|
||||||
|
!$OMP CRITICAL (debugTimingLpTangent)
|
||||||
debug_cumLpCalls = debug_cumLpCalls + 1_pInt
|
debug_cumLpCalls = debug_cumLpCalls + 1_pInt
|
||||||
debug_cumLpTicks = debug_cumLpTicks + tock-tick
|
debug_cumLpTicks = debug_cumLpTicks + tock-tick
|
||||||
if (tock < tick) debug_cumLpTicks = debug_cumLpTicks + maxticks
|
if (tock < tick) debug_cumLpTicks = debug_cumLpTicks + maxticks
|
||||||
|
!$OMP END CRITICAL (debugTimingLpTangent)
|
||||||
|
|
||||||
if (verboseDebugger .and. (e == debug_e .and. i == debug_i .and. g == debug_g)) then
|
if (verboseDebugger .and. (e == debug_e .and. i == debug_i .and. g == debug_g)) then
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,'(a,i3,x,i2,x,i5,x,a,x,i3)') '::: integrateStress at ' ,g,i,e, ' ; iteration ', NiterationStress
|
write(6,'(a,i3,x,i2,x,i5,x,a,x,i3)') '::: integrateStress at ' ,g,i,e, ' ; iteration ', NiterationStress
|
||||||
|
@ -2565,7 +2553,9 @@ LpLoop: do
|
||||||
Lpguess = Lpguess_old
|
Lpguess = Lpguess_old
|
||||||
residuum = residuum_old
|
residuum = residuum_old
|
||||||
|
|
||||||
|
!$OMP CRITICAL (distributionLeapfrogBreak)
|
||||||
debug_LeapfrogBreakDistribution(NiterationStress,mode) = debug_LeapfrogBreakDistribution(NiterationStress,mode) + 1
|
debug_LeapfrogBreakDistribution(NiterationStress,mode) = debug_LeapfrogBreakDistribution(NiterationStress,mode) + 1
|
||||||
|
!$OMP END CRITICAL (distributionLeapfrogBreak)
|
||||||
|
|
||||||
! residuum got better
|
! residuum got better
|
||||||
else
|
else
|
||||||
|
@ -2731,9 +2721,7 @@ logical error
|
||||||
|
|
||||||
! --- CALCULATE ORIENTATION AND LATTICE ROTATION ---
|
! --- CALCULATE ORIENTATION AND LATTICE ROTATION ---
|
||||||
|
|
||||||
!$OMP PARALLEL
|
!$OMP PARALLEL DO PRIVATE(error,U,R)
|
||||||
|
|
||||||
!$OMP DO PRIVATE(error,U,R)
|
|
||||||
do e = FEsolving_execElem(1),FEsolving_execElem(2)
|
do e = FEsolving_execElem(1),FEsolving_execElem(2)
|
||||||
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
|
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
|
||||||
do g = 1,homogenization_Ngrains(mesh_element(3,e))
|
do g = 1,homogenization_Ngrains(mesh_element(3,e))
|
||||||
|
@ -2754,13 +2742,13 @@ logical error
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
!$OMP ENDDO
|
!$OMP END PARALLEL DO
|
||||||
!$OMP BARRIER
|
|
||||||
|
|
||||||
! --- UPDATE SOME ADDITIONAL VARIABLES THAT ARE NEEDED FOR NONLOCAL MATERIAL ---
|
! --- UPDATE SOME ADDITIONAL VARIABLES THAT ARE NEEDED FOR NONLOCAL MATERIAL ---
|
||||||
! --- we use crystallite_orientation from above, so need a seperate loop
|
! --- we use crystallite_orientation from above, so need a seperate loop
|
||||||
|
|
||||||
!$OMP DO PRIVATE(myPhase,myInstance,myStructure,neighboring_e,neighboring_i, &
|
!$OMP PARALLEL DO PRIVATE(myPhase,myInstance,myStructure,neighboring_e,neighboring_i, &
|
||||||
!$OMP & neighboringPhase,neighboringInstance,neighboringStructure)
|
!$OMP & neighboringPhase,neighboringInstance,neighboringStructure)
|
||||||
do e = FEsolving_execElem(1),FEsolving_execElem(2)
|
do e = FEsolving_execElem(1),FEsolving_execElem(2)
|
||||||
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
|
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
|
||||||
|
@ -2804,9 +2792,7 @@ logical error
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
!$OMP ENDDO
|
!$OMP END PARALLEL DO
|
||||||
|
|
||||||
!$OMP END PARALLEL
|
|
||||||
|
|
||||||
endsubroutine
|
endsubroutine
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue