mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 12:48:40 -05:00
FFTW wisdom is now built into jt9[.exe].
New optional argument to jt9: -w patience Default is patience = 1 Example timing measurements for 130610_2343.wav: patience plan execute (s) (s) ----------------------------------------------- 0 0.01 1.25 FFTW_ESTIMATE 1 0.69 1.25 FFTW_ESTIMATE_PATIENT 2 16.97 1.15 FFTW_MEASURE 3 390.88 1.15 FFTW_PATIENT Conclusions, consistent with expectation based on past experience with similar FFTs: - First decode (in each mode) with patience = 2 is slow. - Speed advantage of patience = 2 is small but measurable. - No measurable advantage in using patience > 2. Present mainwindow.cpp has "-w 1" hard-wired. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4610 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
11487c69fa
commit
175f1913b4
@ -19,10 +19,11 @@ subroutine filbig(dd,npts,f0,newdat,c4a,n4,sq0)
|
||||
logical first
|
||||
include 'fftw3.f90'
|
||||
equivalence (rfilt,cfilt),(rca,ca)
|
||||
data first/.true./,npatience/1/
|
||||
data first/.true./
|
||||
data halfpulse/114.97547150,36.57879257,-20.93789101, &
|
||||
5.89886379,1.59355187,-2.49138308,0.60910773,-0.04248129/
|
||||
common/refspec/dfref,ref(NSZ)
|
||||
common/patience/npatience
|
||||
save
|
||||
|
||||
if(npts.lt.0) go to 900 !Clean up at end of program
|
||||
|
@ -22,8 +22,8 @@ subroutine four2a(a,nfft,ndim,isign,iform)
|
||||
complex aa(NSMALL)
|
||||
integer nn(NPMAX),ns(NPMAX),nf(NPMAX)
|
||||
integer*8 plan(NPMAX),nl(NPMAX),nloc
|
||||
! character cfftw*20
|
||||
data nplan/0/,npatience/1/
|
||||
data nplan/0/
|
||||
common/patience/npatience
|
||||
include 'fftw3.f90'
|
||||
save plan,nplan,nn,ns,nf,nl
|
||||
|
||||
@ -42,16 +42,6 @@ subroutine four2a(a,nfft,ndim,isign,iform)
|
||||
nf(i)=iform
|
||||
nl(i)=nloc
|
||||
|
||||
! cfftw(1:2)='ci'
|
||||
! if(nf(i).ne.1) cfftw(1:2)='ri'
|
||||
! cfftw(3:3)='f'
|
||||
! if(ns(i).eq.1) cfftw(3:3)='b'
|
||||
! write(cfftw(4:),*) nn(i)
|
||||
! cfftw=cfftw(1:3)//cfftw(5:)
|
||||
! write(12,3999) i,nn(i),ns(i),nf(i),cfftw
|
||||
!3999 format(4i10,2x,a20)
|
||||
! flush(12)
|
||||
|
||||
! Planning: FFTW_ESTIMATE, FFTW_ESTIMATE_PATIENT, FFTW_MEASURE,
|
||||
! FFTW_PATIENT, FFTW_EXHAUSTIVE
|
||||
nflags=FFTW_ESTIMATE
|
||||
|
63
lib/jt9.f90
63
lib/jt9.f90
@ -18,9 +18,11 @@ program jt9
|
||||
common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat,ntr, &
|
||||
mousefqso,newdat,nfa,nfsplit,nfb,ntol,kin,nzhsym,nsynced,ndecoded
|
||||
common/tracer/limtrace,lu
|
||||
common/patience/npatience
|
||||
data npatience/1/
|
||||
|
||||
do
|
||||
call getopt('s:e:a:r:p:d:f:',long_options,c,optarg,arglen,stat,offset,remain)
|
||||
call getopt('s:e:a:r:p:d:f:w:',long_options,c,optarg,arglen,stat,offset,remain)
|
||||
if (stat .ne. 0) then
|
||||
exit
|
||||
end if
|
||||
@ -47,19 +49,41 @@ program jt9
|
||||
case ('f')
|
||||
read_files = .true.
|
||||
read (optarg(:arglen), *) nrxfreq
|
||||
|
||||
case ('w')
|
||||
read (optarg(:arglen), *) npatience
|
||||
end select
|
||||
end do
|
||||
|
||||
if (.not. have_args .or. (stat .lt. 0 .or. (shmem .and. remain .gt. 0) &
|
||||
.or. (read_files .and. remain .eq. 0) .or. (shmem .and. read_files))) then
|
||||
print*,'Usage: jt9 -p TRperiod -d ndepth -f rxfreq -e exe_dir file1 [file2 ...]'
|
||||
if (.not. have_args .or. (stat .lt. 0 .or. (shmem .and. remain .gt. 0) &
|
||||
.or. (read_files .and. remain .eq. 0) .or. &
|
||||
(shmem .and. read_files))) then
|
||||
print*,'Usage: jt9 -p TRperiod [-d ndepth] [-f rxfreq] {-w patience] -e exe_dir file1 [file2 ...]'
|
||||
print*,' Reads data from *.wav files.'
|
||||
print*,''
|
||||
print*,' jt9 -s <key> -e exe_dir'
|
||||
print*,' jt9 -s <key> [-w patience] -e exe_dir'
|
||||
print*,' Gets data from shared memory region with key==<key>'
|
||||
go to 999
|
||||
endif
|
||||
|
||||
! Import FFTW wisdom, if available:
|
||||
open(14,file=trim(data_dir)//'/jt9_wisdom_status.txt',status='unknown',err=30)
|
||||
open(28,file=trim(data_dir)//'/jt9_wisdom.dat',status='old',err=30)
|
||||
read(28,1000,err=30,end=30) firstline
|
||||
1000 format(a30)
|
||||
rewind 28
|
||||
isuccess=0
|
||||
call import_wisdom_from_file(isuccess,28)
|
||||
close(28)
|
||||
30 if(isuccess.ne.0) then
|
||||
write(14,1010) firstline
|
||||
1010 format('Imported FFTW wisdom (jt9): ',a30)
|
||||
else
|
||||
write(14,1011)
|
||||
1011 format('No imported FFTW wisdom (jt9):')
|
||||
endif
|
||||
call flush(14)
|
||||
|
||||
if (shmem) then
|
||||
call jt9a()
|
||||
go to 999
|
||||
@ -103,19 +127,7 @@ program jt9
|
||||
npts=(60*ntrperiod-6)*12000
|
||||
if(iarg .eq. offset + 1) then
|
||||
open(12,file=trim(data_dir)//'/timer.out',status='unknown')
|
||||
|
||||
! Import FFTW wisdom, if available:
|
||||
open(28,file=trim(data_dir)//'/fftwf_wisdom.dat',status='old',err=30)
|
||||
read(28,1000,err=30,end=30) firstline
|
||||
1000 format(a30)
|
||||
rewind 28
|
||||
call import_wisdom_from_file(isuccess,28)
|
||||
close(28)
|
||||
if(isuccess.ne.0) write(12,1010) firstline
|
||||
1010 format('Imported FFTW wisdom: ',a30)
|
||||
call flush(12)
|
||||
|
||||
30 call timer('jt9 ',0)
|
||||
call timer('jt9 ',0)
|
||||
endif
|
||||
|
||||
id2=0 !??? Why is this necessary ???
|
||||
@ -150,4 +162,17 @@ program jt9
|
||||
998 print*,'Cannot open file:'
|
||||
print*,infile
|
||||
|
||||
999 end program jt9
|
||||
999 continue
|
||||
! Export FFTW wisdom
|
||||
open(28,file=trim(data_dir)//'/jt9_wisdom.dat',status='unknown',err=9999)
|
||||
call export_wisdom_to_file(28)
|
||||
close(28)
|
||||
write(14,1999)
|
||||
1999 format('Exported FFTW wisdom (jt9): ')
|
||||
call flush(14)
|
||||
9999 continue
|
||||
|
||||
call four2a(a,-1,1,1,1) !Save wisdom and free memory
|
||||
call filbig(a,-1,1,0.0,0,0,0,0,0) !used for FFT plans
|
||||
|
||||
end program jt9
|
||||
|
14
lib/jt9a.f90
14
lib/jt9a.f90
@ -25,18 +25,7 @@ subroutine jt9a()
|
||||
call getcwd(cwd)
|
||||
open(12,file=trim(data_dir)//'/timer.out',status='unknown')
|
||||
|
||||
! Import FFTW wisdom, if available:
|
||||
open(28,file=trim(exe_dir)//'/fftwf_wisdom.dat',status='old',err=30)
|
||||
read(28,1000,err=30,end=30) firstline
|
||||
1000 format(a30)
|
||||
rewind 28
|
||||
call import_wisdom_from_file(isuccess,28)
|
||||
close(28)
|
||||
if(isuccess.ne.0) write(12,1010) firstline
|
||||
1010 format('Imported FFTW wisdom: ',a30)
|
||||
call flush(12)
|
||||
|
||||
30 limtrace=0
|
||||
limtrace=0
|
||||
! limtrace=-1 !Disable all calls to timer()
|
||||
lu=12
|
||||
|
||||
@ -55,7 +44,6 @@ subroutine jt9a()
|
||||
|
||||
inquire(file='.quit',exist=fileExists)
|
||||
if(fileExists) then
|
||||
! call ftnquit
|
||||
i1=detach_jt9()
|
||||
go to 999
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user