mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-29 04:42:28 -04:00
Use timer module from wsjt_fort library in MAP65.
This commit is contained in:
parent
4b967ad8af
commit
5af7397641
@ -68,7 +68,7 @@ set (libm65_FSRCS
|
|||||||
smo.f90
|
smo.f90
|
||||||
sun.f90
|
sun.f90
|
||||||
symspec.f90
|
symspec.f90
|
||||||
timer.f90
|
# timer.f90
|
||||||
timf2.f90
|
timf2.f90
|
||||||
tm2.f90
|
tm2.f90
|
||||||
toxyz.f90
|
toxyz.f90
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
subroutine decode0(dd,ss,savg,nstandalone)
|
subroutine decode0(dd,ss,savg,nstandalone)
|
||||||
|
|
||||||
|
use timer_module, only: timer
|
||||||
parameter (NSMAX=60*96000)
|
parameter (NSMAX=60*96000)
|
||||||
parameter (NFFT=32768)
|
parameter (NFFT=32768)
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ subroutine decode1a(dd,newdat,f0,nflip,mode65,nfsample,xpol, &
|
|||||||
|
|
||||||
! Apply AFC corrections to a candidate JT65 signal, then decode it.
|
! Apply AFC corrections to a candidate JT65 signal, then decode it.
|
||||||
|
|
||||||
|
use timer_module, only: timer
|
||||||
parameter (NMAX=60*96000) !Samples per 60 s
|
parameter (NMAX=60*96000) !Samples per 60 s
|
||||||
real*4 dd(4,NMAX) !92 MB: raw data from Linrad timf2
|
real*4 dd(4,NMAX) !92 MB: raw data from Linrad timf2
|
||||||
complex cx(NMAX/64), cy(NMAX/64) !Data at 1378.125 samples/s
|
complex cx(NMAX/64), cy(NMAX/64) !Data at 1378.125 samples/s
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
subroutine deep65(s3,mode65,neme,flip,mycall,hiscall,hisgrid,decoded,qual)
|
subroutine deep65(s3,mode65,neme,flip,mycall,hiscall,hisgrid,decoded,qual)
|
||||||
|
|
||||||
|
use timer_module, only: timer
|
||||||
parameter (MAXCALLS=10000,MAXRPT=63)
|
parameter (MAXCALLS=10000,MAXRPT=63)
|
||||||
real s3(64,63)
|
real s3(64,63)
|
||||||
character callsign*12,grid*4,message*22,hisgrid*6,c*1,ceme*3
|
character callsign*12,grid*4,message*22,hisgrid*6,c*1,ceme*3
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
subroutine extract(s3,nadd,ncount,nhist,decoded,ltext)
|
subroutine extract(s3,nadd,ncount,nhist,decoded,ltext)
|
||||||
|
|
||||||
use packjt
|
use packjt
|
||||||
|
use timer_module, only: timer
|
||||||
real s3(64,63)
|
real s3(64,63)
|
||||||
character decoded*22
|
character decoded*22
|
||||||
integer dat4(12)
|
integer dat4(12)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
real function fchisq(cx,cy,npts,fsample,nflip,a,ccfmax,dtmax)
|
real function fchisq(cx,cy,npts,fsample,nflip,a,ccfmax,dtmax)
|
||||||
|
|
||||||
|
use timer_module, only: timer
|
||||||
parameter (NMAX=60*96000) !Samples per 60 s
|
parameter (NMAX=60*96000) !Samples per 60 s
|
||||||
complex cx(npts),cy(npts)
|
complex cx(npts),cy(npts)
|
||||||
real a(5)
|
real a(5)
|
||||||
|
@ -3,6 +3,7 @@ subroutine filbig(dd,nmax,f0,newdat,nfsample,xpol,c4a,c4b,n4)
|
|||||||
! Filter and downsample complex data stored in array dd(4,nmax).
|
! Filter and downsample complex data stored in array dd(4,nmax).
|
||||||
! Output is downsampled from 96000 Hz to 1375.125 Hz.
|
! Output is downsampled from 96000 Hz to 1375.125 Hz.
|
||||||
|
|
||||||
|
use timer_module, only: timer
|
||||||
parameter (MAXFFT1=5376000,MAXFFT2=77175)
|
parameter (MAXFFT1=5376000,MAXFFT2=77175)
|
||||||
real*4 dd(4,nmax) !Input data
|
real*4 dd(4,nmax) !Input data
|
||||||
complex ca(MAXFFT1),cb(MAXFFT1) !FFTs of input
|
complex ca(MAXFFT1),cb(MAXFFT1) !FFTs of input
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
!
|
!
|
||||||
! 10 binary input data, *.tf2 files
|
! 10 binary input data, *.tf2 files
|
||||||
! 11 prefixes.txt
|
! 11 prefixes.txt
|
||||||
! 12 timer.out
|
! 12
|
||||||
! 13 map65.log
|
! 13 map65.log
|
||||||
! 14
|
! 14
|
||||||
! 15
|
! 15
|
||||||
@ -22,6 +22,7 @@
|
|||||||
!------------------------------------------------ ftn_init
|
!------------------------------------------------ ftn_init
|
||||||
subroutine ftninit(appd)
|
subroutine ftninit(appd)
|
||||||
|
|
||||||
|
use timer_module, only: timer
|
||||||
character*(*) appd
|
character*(*) appd
|
||||||
character firstline*30
|
character firstline*30
|
||||||
character addpfx*8
|
character addpfx*8
|
||||||
@ -29,7 +30,6 @@ subroutine ftninit(appd)
|
|||||||
|
|
||||||
addpfx=' '
|
addpfx=' '
|
||||||
call pfxdump(appd//'/prefixes.txt')
|
call pfxdump(appd//'/prefixes.txt')
|
||||||
open(12,file=appd//'/timer_map65.out',status='unknown',err=920)
|
|
||||||
open(13,file=appd//'/map65.log',status='unknown')
|
open(13,file=appd//'/map65.log',status='unknown')
|
||||||
open(19,file=appd//'/livecq.txt',status='unknown')
|
open(19,file=appd//'/livecq.txt',status='unknown')
|
||||||
open(21,file=appd//'/map65_rx.log',status='unknown',access='append',err=950)
|
open(21,file=appd//'/map65_rx.log',status='unknown',access='append',err=950)
|
||||||
|
@ -3,6 +3,9 @@ program m65
|
|||||||
! Decoder for map65. Can run stand-alone, reading data from *.tf2 files;
|
! Decoder for map65. Can run stand-alone, reading data from *.tf2 files;
|
||||||
! or as the back end of map65, with data placed in a shared memory region.
|
! or as the back end of map65, with data placed in a shared memory region.
|
||||||
|
|
||||||
|
use timer_module, only: timer
|
||||||
|
use timer_impl, only: init_timer, fini_timer
|
||||||
|
|
||||||
parameter (NSMAX=60*96000)
|
parameter (NSMAX=60*96000)
|
||||||
parameter (NFFT=32768)
|
parameter (NFFT=32768)
|
||||||
parameter (NREAD=2048)
|
parameter (NREAD=2048)
|
||||||
@ -84,7 +87,9 @@ program m65
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
call ftninit('.')
|
call ftninit('.')
|
||||||
|
call init_timer('timer.out')
|
||||||
|
call timer('m65 ',0)
|
||||||
|
|
||||||
do ifile=ifile1,nargs
|
do ifile=ifile1,nargs
|
||||||
call getarg(ifile,infile)
|
call getarg(ifile,infile)
|
||||||
open(10,file=infile,access='stream',status='old',err=998)
|
open(10,file=infile,access='stream',status='old',err=998)
|
||||||
@ -102,7 +107,7 @@ program m65
|
|||||||
nch=2
|
nch=2
|
||||||
if(nxpol.eq.1) nch=4
|
if(nxpol.eq.1) nch=4
|
||||||
|
|
||||||
if(ifile.eq.ifile1) call timer('m65 ',0)
|
! if(ifile.eq.ifile1) call timer('m65 ',0)
|
||||||
do irec=1,9999999
|
do irec=1,9999999
|
||||||
read(10,end=10) i2
|
read(10,end=10) i2
|
||||||
do i=1,NREAD,nch
|
do i=1,NREAD,nch
|
||||||
@ -148,10 +153,12 @@ program m65
|
|||||||
|
|
||||||
call timer('m65 ',1)
|
call timer('m65 ',1)
|
||||||
call timer('m65 ',101)
|
call timer('m65 ',101)
|
||||||
call ftnquit
|
|
||||||
go to 999
|
go to 999
|
||||||
|
|
||||||
998 print*,'Cannot open file:'
|
998 print*,'Cannot open file:'
|
||||||
print*,infile
|
print*,infile
|
||||||
|
|
||||||
999 end program m65
|
999 call fini_timer()
|
||||||
|
call ftnquit
|
||||||
|
|
||||||
|
end program m65
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
subroutine m65a
|
subroutine m65a
|
||||||
|
|
||||||
|
use timer_module, only: timer
|
||||||
|
use timer_impl, only: init_timer !, limtrace
|
||||||
|
|
||||||
interface
|
interface
|
||||||
function address_m65()
|
function address_m65()
|
||||||
integer*1, pointer :: address_m65
|
integer*1, pointer :: address_m65
|
||||||
@ -15,6 +18,8 @@ subroutine m65a
|
|||||||
|
|
||||||
call getcwd(cwd)
|
call getcwd(cwd)
|
||||||
call ftninit(trim(cwd))
|
call ftninit(trim(cwd))
|
||||||
|
call init_timer (trim(cwd)//'/timer.out')
|
||||||
|
|
||||||
limtrace=0
|
limtrace=0
|
||||||
lu=12
|
lu=12
|
||||||
i1=attach_m65()
|
i1=attach_m65()
|
||||||
|
@ -5,6 +5,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, &
|
|||||||
|
|
||||||
! Processes timf2 data from Linrad to find and decode JT65 signals.
|
! Processes timf2 data from Linrad to find and decode JT65 signals.
|
||||||
|
|
||||||
|
use timer_module, only: timer
|
||||||
parameter (MAXMSG=1000) !Size of decoded message list
|
parameter (MAXMSG=1000) !Size of decoded message list
|
||||||
parameter (NSMAX=60*96000)
|
parameter (NSMAX=60*96000)
|
||||||
parameter (NFFT=32768)
|
parameter (NFFT=32768)
|
||||||
|
@ -2,6 +2,7 @@ subroutine q65b(nutc,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, &
|
|||||||
mycall0,hiscall0,hisgrid,mode_q65)
|
mycall0,hiscall0,hisgrid,mode_q65)
|
||||||
|
|
||||||
use q65_decode
|
use q65_decode
|
||||||
|
use timer_module, only: timer
|
||||||
parameter (MAXFFT1=5376000) !56*96000
|
parameter (MAXFFT1=5376000) !56*96000
|
||||||
parameter (MAXFFT2=336000) !56*6000 (downsampled by 1/16)
|
parameter (MAXFFT2=336000) !56*6000 (downsampled by 1/16)
|
||||||
parameter (NMAX=60*12000)
|
parameter (NMAX=60*12000)
|
||||||
|
@ -1,114 +0,0 @@
|
|||||||
subroutine timer(dname,k)
|
|
||||||
|
|
||||||
! Times procedure number n between a call with k=0 (tstart) and with
|
|
||||||
! k=1 (tstop). Accumulates sums of these times in array ut (user time).
|
|
||||||
! Also traces all calls (for debugging purposes) if limtrace.gt.0
|
|
||||||
|
|
||||||
character*8 dname,name(50),space,ename
|
|
||||||
character*16 sname
|
|
||||||
logical on(50)
|
|
||||||
real ut(50),ut0(50),dut(50),tt(2)
|
|
||||||
integer ncall(50),nlevel(50),nparent(50)
|
|
||||||
integer onlevel(0:10)
|
|
||||||
integer*8 count0,clkfreq
|
|
||||||
common/tracer/ limtrace,lu
|
|
||||||
data eps/0.000001/,ntrace/0/
|
|
||||||
data level/0/,nmax/0/,space/' '/
|
|
||||||
data limtrace/0/,lu/-1/
|
|
||||||
save
|
|
||||||
|
|
||||||
if(limtrace.lt.0) go to 999
|
|
||||||
if(lu.lt.1) lu=6
|
|
||||||
if(k.gt.1) go to 40 !Check for "all done" (k>1)
|
|
||||||
onlevel(0)=0
|
|
||||||
|
|
||||||
do n=1,nmax !Check for existing name
|
|
||||||
if(name(n).eq.dname) go to 20
|
|
||||||
enddo
|
|
||||||
|
|
||||||
nmax=nmax+1 !This is a new one
|
|
||||||
n=nmax
|
|
||||||
ncall(n)=0
|
|
||||||
on(n)=.false.
|
|
||||||
ut(n)=eps
|
|
||||||
name(n)=dname
|
|
||||||
|
|
||||||
20 if(k.eq.0) then !Get start times (k=0)
|
|
||||||
if(on(n)) print*,'Error in timer: ',dname,' already on.'
|
|
||||||
level=level+1 !Increment the level
|
|
||||||
on(n)=.true.
|
|
||||||
call system_clock(count0,clkfreq)
|
|
||||||
ut0(n)=float(count0)/float(clkfreq)
|
|
||||||
ncall(n)=ncall(n)+1
|
|
||||||
if(ncall(n).gt.1.and.nlevel(n).ne.level) then
|
|
||||||
nlevel(n)=-1
|
|
||||||
else
|
|
||||||
nlevel(n)=level
|
|
||||||
endif
|
|
||||||
nparent(n)=onlevel(level-1)
|
|
||||||
onlevel(level)=n
|
|
||||||
|
|
||||||
else if(k.eq.1) then !Get stop times and accumulate sums. (k=1)
|
|
||||||
if(on(n)) then
|
|
||||||
on(n)=.false.
|
|
||||||
call system_clock(count0,clkfreq)
|
|
||||||
ut1=float(count0)/float(clkfreq)
|
|
||||||
ut(n)=ut(n)+ut1-ut0(n)
|
|
||||||
endif
|
|
||||||
level=level-1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ntrace=ntrace+1
|
|
||||||
if(ntrace.lt.limtrace) write(lu,1020) ntrace,dname,k,level,nparent(n)
|
|
||||||
1020 format(i8,': ',a8,3i5)
|
|
||||||
go to 998
|
|
||||||
|
|
||||||
! Write out the timer statistics
|
|
||||||
|
|
||||||
40 write(lu,1040)
|
|
||||||
1040 format(/' name time frac dtime', &
|
|
||||||
' dfrac calls level parent'/75('-'))
|
|
||||||
|
|
||||||
if(k.gt.100) then
|
|
||||||
ndiv=k-100
|
|
||||||
do i=1,nmax
|
|
||||||
ncall(i)=ncall(i)/ndiv
|
|
||||||
ut(i)=ut(i)/ndiv
|
|
||||||
enddo
|
|
||||||
endif
|
|
||||||
|
|
||||||
total=ut(1)
|
|
||||||
sum=0.
|
|
||||||
sumf=0.
|
|
||||||
do i=1,nmax
|
|
||||||
dut(i)=ut(i)
|
|
||||||
do j=i,nmax
|
|
||||||
if(nparent(j).eq.i) dut(i)=dut(i)-ut(j)
|
|
||||||
enddo
|
|
||||||
utf=ut(i)/total
|
|
||||||
dutf=dut(i)/total
|
|
||||||
sum=sum+dut(i)
|
|
||||||
sumf=sumf+dutf
|
|
||||||
kk=min(nlevel(i),8)
|
|
||||||
if(kk.lt.1) sname=name(i)//space
|
|
||||||
if(kk.ge.1) sname=space(1:kk)//name(i)//space(1:8-kk)
|
|
||||||
ename=space
|
|
||||||
if(i.ge.2) ename=name(nparent(i))
|
|
||||||
write(lu,1060) float(i),sname,ut(i),utf,dut(i),dutf, &
|
|
||||||
ncall(i),nlevel(i),ename
|
|
||||||
1060 format(f4.0,a16,2(f10.2,f6.2),i7,i5,2x,a8)
|
|
||||||
enddo
|
|
||||||
|
|
||||||
write(lu,1070) sum,sumf
|
|
||||||
1070 format(75('-')/36x,f10.2,f6.2)
|
|
||||||
nmax=0
|
|
||||||
eps=0.000001
|
|
||||||
ntrace=0
|
|
||||||
level=0
|
|
||||||
space=' '
|
|
||||||
onlevel(0)=0
|
|
||||||
|
|
||||||
998 flush(lu)
|
|
||||||
|
|
||||||
999 return
|
|
||||||
end subroutine timer
|
|
Loading…
x
Reference in New Issue
Block a user