Skip to content

Commit

Permalink
Fixes internal timing for OMP
Browse files Browse the repository at this point in the history
  • Loading branch information
holm10 committed Jan 22, 2025
1 parent e2a2da5 commit 26421bb
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 130 deletions.
24 changes: 12 additions & 12 deletions aph/aphrates.m
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,11 @@ real function rqa (te, ne, k)
Use(Rtdegas)
Use(Aphwrk)
Use(Timespl)
real(Size4) sec4, gettime, tsval
real tick, tock, tsval

c external procedures --
real rsa, svradp, B2VAhL
external rsa, svradp, B2VAhL, gettime
external rsa, svradp, B2VAhL, tick, tock

c local variables --
real a
Expand Down Expand Up @@ -590,10 +590,10 @@ c fractional parts of intervals (je,je+1) and (jd,jd+1) --
nxcoef=nxdata_aph
nycoef=nydata_aph

tsval = gettime(sec4)
tsval = tick()
w = B2VAhL(xuse, yuse, 0, 0, xknots_aph, yknots_aph, nxcoef, nycoef,
. kxords_aph, kyords_aph, rqacoef, ldf_aph, workh, iflag_aph)
totb2val = totb2val + gettime(sec4) - tsval
totb2val = totb2val + tock(tsval)
c electron energy loss rate parameter --
rqa = w + 13.6 * ev_aph * rsa(te,ne,0.,k)

Expand Down Expand Up @@ -626,11 +626,11 @@ real function rra (te, ne, tau, k)
Use(Rtdegas)
Use(Aphwrk)
Use(Timespl)
real(Size4) sec4, gettime, tsval
real tick, tock, tsval

c external procedures --
real srecf, B2VAhL
external srecf, B2VAhL, gettime
external srecf, B2VAhL, tick, tock

c local variables --
integer ine,ite
Expand Down Expand Up @@ -767,10 +767,10 @@ c fractional parts of intervals (je,je+1) and (jd,jd+1) --
nxcoef=nxdata_aph
nycoef=nydata_aph

tsval = gettime(sec4)
tsval = tick()
rra = B2VAhL(xuse, yuse, 0, 0, xknots_aph, yknots_aph, nxcoef, nycoef,
. kxords_aph, kyords_aph, rracoef, ldf_aph, workh, iflag_aph)
totb2val = totb2val + gettime(sec4) - tsval
totb2val = totb2val + tock(tsval)
c----------------------------------------------------------------------c
elseif (istabon .eq. 7) then
c use polynomial fit from Bob Campbell - 8/93
Expand Down Expand Up @@ -881,11 +881,11 @@ real function rsa (te, ne, tau, k)
Use(Rtdegas)
Use(Aphwrk)
Use(Timespl)
real(Size4) sec4, gettime, tsval
real tick, tock, tsval

c external procedures --
real sionf, B2VAhL
external sionf, B2VAhL, gettime
external sionf, B2VAhL, tick, tock

c local variables --
real a
Expand Down Expand Up @@ -1025,10 +1025,10 @@ c fractional parts of intervals (je,je+1) and (jd,jd+1) --
nxcoef=nxdata_aph
nycoef=nydata_aph

tsval = gettime(sec4)
tsval = tick()
rsa = B2VAhL(xuse, yuse, 0, 0, xknots_aph, yknots_aph, nxcoef, nycoef,
. kxords_aph, kyords_aph, rsacoef, ldf_aph, workh, iflag_aph)
totb2val = totb2val + gettime(sec4) - tsval
totb2val = totb2val + tock(tsval)
c----------------------------------------------------------------------c
elseif (istabon .eq. 7) then
c use polynomial fit from Bob Campbell - 8/93
Expand Down
2 changes: 1 addition & 1 deletion api/apifcn.m
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ subroutine sapitim (timingsw)

write(*,902) 'Impur.: physics w/o bookkeeping = ', ttimpc
902 format(a36,f10.4,20x,' sec')
write(*,*) '(included in above f & Jac numbers)'
write(*,*) '(incl. in above f & Jac numbers)'
ttimpc = 0.

return
Expand Down
7 changes: 4 additions & 3 deletions api/fmombal.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
subroutine coulfric(amu,denz2,dloglam,mntau,zi_api,capm,capn,
> ela,elab,tempa)
implicit real (a-h,o-z), integer (i-n)
real tick, tock, tsval
external tick, tock
Use(Reduced_ion_constants)
real capm(KXA,miso,KXA,miso),denz2(miso),
> capn(KXA,KXA,miso,miso),mntau(miso,miso),
Expand Down Expand Up @@ -56,7 +58,6 @@ implicit real (a-h,o-z), integer (i-n)
Use(Reduced_ion_constants)
Use(Reduced_ion_variables)
Use(Timing) # istimingon,ttimpc
real(Size4) sec4, gettime, tsval
real amu(misotope), den(misotope*(nchstate+1)),
> gradp(misotope*nchstate), gradt(misotope*nchstate),
> nurec(misotope*nchstate), nuion(misotope*(nchstate+1)),
Expand Down Expand Up @@ -198,7 +199,7 @@ integer natomic(misotope)
!

c ... Start timing impurity calculations.
if (istimingon .eq. 1 .and. misotope .gt. 1) tsval = gettime(sec4)
if (istimingon .eq. 1 .and. misotope .gt. 1) tsval = tick()

c ... Initialize amat array.
ndima=KXA*(MXMISO1)*KXA*(MXMISO1)
Expand Down Expand Up @@ -244,7 +245,7 @@ call getfrict(friction,fricc,caplam,denmass,ela,nuion,

c ... End timing impurity calculations.
if (istimingon .eq. 1 .and. misotope .gt. 1)
. ttimpc = ttimpc + gettime(sec4) - tsval
. ttimpc = ttimpc + tock(tsval)

return
end
Expand Down
Loading

0 comments on commit 26421bb

Please sign in to comment.