Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Walltime fix #40

Merged
merged 7 commits into from
Feb 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/amuse/community/fi/src/buildnearlist.f90
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ subroutine epscal(option)
enddo
nsavg=nstot/(up-low+1)

if(verbosity.GT.0) print*,'<epscal> < a > t:',nsmin,nsavg,nsmax,nstot
if(verbosity.GT.0) print*,'<epscal> mn,av,mx:',nsmin,nsavg,nsmax

end subroutine

Expand Down Expand Up @@ -91,7 +91,7 @@ subroutine hsmcal
nnmin=MIN(nnmin,inear)
enddo
nnavg=nntot/(up-low+1)
if(verbosity.GT.0) print*,'<hsmcal> < a > t:',nnmin,nnavg,nnmax,nntot
if(verbosity.GT.0) print*,'<hsmcal> mn,av,mx:',nnmin,nnavg,nnmax

end subroutine

Expand Down
6 changes: 3 additions & 3 deletions src/amuse/community/fi/src/buildtree.f90
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ subroutine loadtree5(option,startcell)
!$omp reduction( MIN : mintime) &
!$omp reduction( MAX : maxtime) &
!$omp reduction(+ : totredu,totcell,totbody,tottime) if(hcell-lcell.gt.maxthread)
call cpu_time(time1)
call wall_time(time1)
mythread=0
totalthread=1
!$ mythread=omp_get_thread_num()
Expand Down Expand Up @@ -260,7 +260,7 @@ subroutine loadtree5(option,startcell)
totcell=totcell+checkcell
totbody=totbody+checkbody
totredu=totredu+checkredu
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
Expand All @@ -275,7 +275,7 @@ subroutine loadtree5(option,startcell)
incells=totcell
if(verbosity.GT.0) then
write(*,'(" <loadtree> time:", 3f8.2)') mintime,maxtime,tottime
print*,'<loadtree> ',option,incells
print*,'<loadtree> option, parts, cells: ',option,iupper-ilower+1, incells
endif
end subroutine loadtree5

Expand Down
8 changes: 4 additions & 4 deletions src/amuse/community/fi/src/density.f90
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ subroutine densnhsmooth
!$omp reduction( max : imax,nnmax,maxtime) &
!$omp reduction(+ : jtot,nntot,tottime,totalsearches,drhosum,niter) &
!$omp reduction( min : nnmin,mintime)
call cpu_time(time1)
call wall_time(time1)
ncalls=0;nsearches=0
!$omp do schedule(guided,1)
do chunk=1,nchunk
Expand Down Expand Up @@ -346,15 +346,15 @@ subroutine densnhsmooth
enddo
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
totalsearches=totalsearches+nsearches
!$omp end parallel
nnavg=nntot/nsphact
if(verbosity.GT.0) print*,'<densnhsmooth> parts,searches', nsphact,totalsearches
if(verbosity.GT.0) print*,'<densnhsmooth> < a > t',nnmin,nnavg,nnmax,nntot
if(verbosity.GT.0) print*,'<densnhsmooth> parts,searches:', nsphact,totalsearches
if(verbosity.GT.0) print*,'<densnhsmooth> mn,av,mx:',nnmin,nnavg,nnmax
if(verbosity.GT.0) then
write(*,'(" <densnhsmooth> time:", 3f8.2)') maxtime,mintime,tottime
print*,'<densnhsmooth> max iter, fails:',imax,jtot
Expand Down
40 changes: 20 additions & 20 deletions src/amuse/community/fi/src/entdot.f90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ subroutine omp_entdotaccsphco
!$omp reduction( + : tottime,nntot,totalsearches,niter) &
!$omp reduction( MIN : mintime,nnmin) &
!$omp reduction( MAX : maxtime,nnmax)
call cpu_time(time1)
call wall_time(time1)
ncalls=0;nsearches=0
!$omp do schedule(guided,1)
do chunk=1,nchunk
Expand All @@ -45,15 +45,15 @@ subroutine omp_entdotaccsphco
enddo
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
totalsearches=totalsearches+nsearches
!$omp end parallel
nnavg=nntot/nsphact
if(verbosity.GT.0) print*,'<dentacc> parts,searches', nsphact,totalsearches
if(verbosity.GT.0) print*,'<dentacc> < a > t',nnmin,nnavg,nnmax,nntot
if(verbosity.GT.0) print*,'<dentacc> parts,searches:', nsphact,totalsearches
if(verbosity.GT.0) print*,'<dentacc> mn,av,mx:',nnmin,nnavg,nnmax
if(verbosity.GT.0) write(*,'(" <dentacc> time:", 3f8.2)') mintime,maxtime,tottime
if(niter.NE.nsphact) call terror("inconsistent omp_entdotaccsphco iter count")
end
Expand Down Expand Up @@ -82,7 +82,7 @@ subroutine omp_accsphco
!$omp reduction( + : tottime,nntot,niter) &
!$omp reduction( MIN : mintime,nnmin) &
!$omp reduction( MAX : maxtime,nnmax)
call cpu_time(time1)
call wall_time(time1)
ncalls=0;nsearches=0
!$omp do schedule(guided,1)
do chunk=1,nchunk
Expand All @@ -105,14 +105,15 @@ subroutine omp_accsphco
enddo
enddo
!$omp enddo nowait
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
totalsearches=totalsearches+nsearches
!$omp end parallel
nnavg=nntot/nsphact
if(verbosity.GT.0) print*,'<accsph> parts,searches', nsphact,totalsearches
if(verbosity.GT.0) print*,'<accsph> < a > t',nnmin,nnavg,nnmax,nntot
if(verbosity.GT.0) print*,'<accsph> parts,searches:', nsphact,totalsearches
if(verbosity.GT.0) print*,'<accsph> mn,av,mx:',nnmin,nnavg,nnmax
if(verbosity.GT.0) write(*,'(" <accsph> time:", 3f8.2)') mintime,maxtime,tottime
if(niter.NE.nsphact) call terror("inconsistent omp_accsphco iter count")
end
Expand Down Expand Up @@ -142,7 +143,7 @@ subroutine omp_entdot
!$omp reduction( + : tottime,nntot, niter) &
!$omp reduction( MIN : mintime,nnmin) &
!$omp reduction( MAX : maxtime,nnmax)
call cpu_time(time1)
call wall_time(time1)
ncalls=0;nsearches=0
!$omp do schedule(guided,1)
do chunk=1,nchunk
Expand All @@ -165,16 +166,15 @@ subroutine omp_entdot
enddo
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
totalsearches=totalsearches+nsearches
!$omp end parallel
call cpu_time(utime2)
nnavg=nntot/nsphact
if(verbosity.GT.0) print*,'<entdot> parts,searches', nsphact,totalsearches
if(verbosity.GT.0) print*,'<entdot> < a > t',nnmin,nnavg,nnmax,nntot
if(verbosity.GT.0) print*,'<entdot> parts,searches:', nsphact,totalsearches
if(verbosity.GT.0) print*,'<entdot> mn,av,mx:',nnmin,nnavg,nnmax
if(verbosity.GT.0) write(*,'(" <entdot> time:", 3f8.2)') mintime,maxtime,tottime
if(niter.NE.nsphact) call terror("inconsistent omp_entdot iter count")
end
Expand Down Expand Up @@ -560,7 +560,7 @@ subroutine omp_ethdotaccsphco
!$omp reduction( + : tottime,nntot,totalsearches,niter) &
!$omp reduction( MIN : mintime,nnmin) &
!$omp reduction( MAX : maxtime,nnmax)
call cpu_time(time1)
call wall_time(time1)
ncalls=0;nsearches=0
!$omp do schedule(guided,1)
do chunk=1,nchunk
Expand All @@ -583,15 +583,15 @@ subroutine omp_ethdotaccsphco
enddo
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
totalsearches=totalsearches+nsearches
!$omp end parallel
nnavg=nntot/nsphact
if(verbosity.GT.0) print*,'<dethacc> parts,searches', nsphact,totalsearches
if(verbosity.GT.0) print*,'<dethacc> < a > t',nnmin,nnavg,nnmax,nntot
if(verbosity.GT.0) print*,'<dethacc> parts,searches:', nsphact,totalsearches
if(verbosity.GT.0) print*,'<dethacc> mn,av,mx:',nnmin,nnavg,nnmax
if(verbosity.GT.0) write(*,'(" <dethacc> time:", 3f8.2)') mintime,maxtime,tottime
if(niter.NE.nsphact) call terror("inconsistent omp_ethdotaccsphco iter count")
end
Expand Down Expand Up @@ -620,7 +620,7 @@ subroutine omp_ethdotco
!$omp reduction( + : tottime,nntot,totalsearches,niter) &
!$omp reduction( MIN : mintime,nnmin) &
!$omp reduction( MAX : maxtime,nnmax)
call cpu_time(time1)
call wall_time(time1)
ncalls=0;nsearches=0
!$omp do schedule(guided,1)
do chunk=1,nchunk
Expand All @@ -643,15 +643,15 @@ subroutine omp_ethdotco
enddo
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
totalsearches=totalsearches+nsearches
!$omp end parallel
nnavg=nntot/nsphact
if(verbosity.GT.0) print*,'<deth> parts,searches', nsphact,totalsearches
if(verbosity.GT.0) print*,'<deth> < a > t',nnmin,nnavg,nnmax,nntot
if(verbosity.GT.0) print*,'<deth> parts,searches:', nsphact,totalsearches
if(verbosity.GT.0) print*,'<deth> mn,av,mx:',nnmin,nnavg,nnmax
if(verbosity.GT.0) write(*,'(" <deth> time:", 3f8.2)') mintime,maxtime,tottime
if(niter.NE.nsphact) call terror("inconsistent omp_ethdotco iter count")
end
Expand Down
8 changes: 4 additions & 4 deletions src/amuse/community/fi/src/ethstep.f90
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ subroutine extrapeth(dt)
!$omp reduction(+ : tottime) &
!$omp reduction(max : jmax,imax,maxtime) &
!$omp reduction(min : mintime)
call cpu_time(time1)
call wall_time(time1)
!$omp do
do p=1,nsph
if(rho(p).EQ.0) cycle
Expand Down Expand Up @@ -199,7 +199,7 @@ subroutine extrapeth(dt)
derad(p)=drad
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
Expand Down Expand Up @@ -238,7 +238,7 @@ subroutine exstep2(pc)
!$omp reduction(+ : eradiate,snheat,efuvheat,eradcool,tottime) &
!$omp reduction(max : jmax,imax,maxtime) &
!$omp reduction(min : mintime)
call cpu_time(time1)
call wall_time(time1)
!$omp do
do k=1,nsphact
p=pactive(k)
Expand Down Expand Up @@ -272,7 +272,7 @@ subroutine exstep2(pc)
endif
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
Expand Down
4 changes: 2 additions & 2 deletions src/amuse/community/fi/src/feedback.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ subroutine pp_feedback(dt,tnu)
!$ mythread=omp_get_thread_num()
!$ totalthread=omp_get_num_threads()
allocate(p_acc(nsph,3))
call cpu_time(time1)
call wall_time(time1)
p_acc(1:nsph,1:3)=0.
!$omp do reduction(+ : lsnheat)
do i=1,npp
Expand Down Expand Up @@ -97,7 +97,7 @@ subroutine pp_feedback(dt,tnu)
endif
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)

if(nsphact.GT.0) then
p_acc(1:pactive(1)-1,1:3)=0.
Expand Down
10 changes: 5 additions & 5 deletions src/amuse/community/fi/src/fuvflux.f90
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ subroutine fuvflux
!$omp reduction( + : nttotfuv,tottime,totalsearches,niter) &
!$omp reduction( MIN : ntminfuv, mintime) &
!$omp reduction( MAX : ntmaxfuv, maxtime)
call cpu_time(time1)
call wall_time(time1)
ncalls=0;nsearches=0
!$omp do schedule(guided,1)
do k=1,nchunk
Expand Down Expand Up @@ -62,17 +62,17 @@ subroutine fuvflux
enddo
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
totalsearches=totalsearches+nsearches
!$omp end parallel
ntavgfuv=nttotfuv/nsphact
if(verbosity.GT.0) then
print*,'<fuvflux> searches', nsphact,totalsearches
write(*,'(" <fuvflux> time:", 3f8.2)') maxtime,mintime
print*,'<fuvflux> < a > t:',ntminfuv,ntavgfuv,ntmaxfuv,nttotfuv
print*,'<fuvflux> parts,searches:', nsphact,totalsearches
write(*,'(" <fuvflux> time:", 3f8.2)') maxtime,mintime,tottime
print*,'<fuvflux> mn,av,mx:',ntminfuv,ntavgfuv,ntmaxfuv
endif
if(niter.NE.nsphact) call terror("fuvflux inconsistent iter count")
end subroutine
Expand Down
12 changes: 7 additions & 5 deletions src/amuse/community/fi/src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@
INTEGER sfrfilenr,bhfilenr,erasenr
PARAMETER(sfrfilenr=23,bhfilenr=24,erasenr=25)

INTEGER root,nbodies,incells,nttot,ntmin,ntmax,ntavg,nsteps, &
& stepout,steplog,incellsg,targetnn,nstot,nsmin,nsmax,nsavg, &
& nttotfuv,ntminfuv,ntmaxfuv,ntavgfuv
INTEGER*8 nttot,nttotfuv,nstot
INTEGER root,nbodies,incells,ntmin,ntmax,ntavg,nsteps, &
& stepout,steplog,incellsg,targetnn,nsmin,nsmax,nsavg, &
& ntminfuv,ntmaxfuv,ntavgfuv
LOGICAL usequad,usesph,fixthalo,selfgrav,adaptive_eps, directsum, &
& isotherm
REAL bh_tol,eps,rsize,rmin,tnow,tpos,dtime,tiny, &
Expand All @@ -134,7 +135,7 @@
COMMON/paramcom/ nbodies,nsnap
COMMON/cellcom/ rmin(ndim),rsize,incells,incellsg
COMMON/pointers/ root
COMMON/forcecom/ nttot,ntmin,ntmax,ntavg,nttotfuv,ntminfuv, &
COMMON/forcecom/ nttot,nttotfuv,ntmin,ntmax,ntavg,ntminfuv, &
& ntmaxfuv,ntavgfuv
COMMON/softcom/ nstot,nsmin,nsmax,nsavg
COMMON/timecom/ tnow,tpos
Expand Down Expand Up @@ -177,7 +178,8 @@
COMMON/interpoc/ deldr2i
COMMON/skerncom/ wsmooth(0:1+ninterp),dwsmooth(0:1+ninterp)

INTEGER nntot,nnmin,nnmax,nnavg
INTEGER*8 nntot
INTEGER nnmin,nnmax,nnavg

COMMON/neighcom/ nntot,nnmin,nnmax,nnavg

Expand Down
18 changes: 9 additions & 9 deletions src/amuse/community/fi/src/gravity.f90
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ subroutine accgrav(option)
!$omp reduction( + : nttot, esofttot,tottime,totalsearches,niter) &
!$omp reduction( MIN : ntmin,mintime) &
!$omp reduction( MAX : ntmax,maxtime)
call cpu_time(time1)
call wall_time(time1)
ncalls=0;nsearches=0
!$omp do schedule(guided,1)
do k=1,nchunk
Expand Down Expand Up @@ -90,17 +90,17 @@ subroutine accgrav(option)
enddo
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
totalsearches=totalsearches+nsearches
!$omp end parallel
ntavg=nttot/npactive
if(verbosity.GT.0) then
print*,'<accgrav> searches', npactive,totalsearches
write(*,'(" <accgrav> time:", 2f8.2)') maxtime,mintime
print*,'<accgrav> < a > t:',ntmin,ntavg,ntmax,nttot
print*,'<accgrav> parts,searches:', npactive,totalsearches
write(*,'(" <accgrav> time:", 3f8.2)') maxtime,mintime, tottime
print*,'<accgrav> mn,av,mx:',ntmin,ntavg,ntmax
endif
if(niter.NE.npactive) call terror("accgrav inconsistent iter count")
end subroutine
Expand All @@ -120,28 +120,28 @@ subroutine pmaccgrav(option)
! and in the acc. (hence they do not experience grav acc)
! this could be changed later to be more flexible)

call cpu_time(utime1)
call wall_time(utime1)
if(tnow.GE.tpm) then
call pmgrav(nbodies,mass,pos)
vmax=maxval(vel(1:nbodies,1:3))
if(vmax.GT.0) dtpm=dmeshQ()/vmax/2.
if(verbosity.GT.0) print*,'<pmaccgrav> timestep:',dtpm
tpm=tpm+dtpm
endif
call cpu_time(utime2)
call wall_time(utime2)
!$omp parallel &
!$omp private(p,i,time1,time2) &
!$omp reduction( + : tottime) &
!$omp reduction( MIN : mintime) &
!$omp reduction( MAX : maxtime)
call cpu_time(time1)
call wall_time(time1)
!$omp do schedule(guided,200)
do i=1,npactive
p=pactive(i)
if(mass(p).GT.0) call pmgravsum(p,option)
enddo
!$omp enddo nowait
call cpu_time(time2)
call wall_time(time2)
mintime=MIN(mintime,time2-time1)
maxtime=MAX(maxtime,time2-time1)
tottime=tottime+time2-time1
Expand Down
Loading