diff --git a/Makefile.MinGW b/Makefile.MinGW index 637f2e217..fbf25f8ae 100644 --- a/Makefile.MinGW +++ b/Makefile.MinGW @@ -32,9 +32,8 @@ SRCF77 = indexx.f gen65.f chkmsg.f \ unpackmsg.f unpacktext.f astro.f azdist.f coord.f dcoord.f \ deg2grid.f dot.f ftsky.f geocentric.f GeoDist.f grid2deg.f \ moon2.f MoonDop.f sun.f toxyz.f pfxdump.f \ - ccf65.f trimlist.f chkhist.f decode1a.f \ - fil6521.f twkfreq.f decode65b.f \ - afc65b.f fchisq.f ccf2.f + ccf65.f trimlist.f chkhist.f decode1a.f f77_wisdom.f \ + fil6521.f twkfreq.f decode65b.f afc65b.f fchisq.f ccf2.f SRC2F77 = four2a.f filbig.f diff --git a/four2a.f b/four2a.f index 9f2a095b5..7e022a48e 100644 --- a/four2a.f +++ b/four2a.f @@ -1,4 +1,4 @@ - SUBROUTINE FOUR2a (a,nfft,NDIM,ISIGN,IFORM) + subroutine four2a(a,nfft,ndim,isign,iform) C IFORM = 1, 0 or -1, as data is C complex, real, or the first half of a complex array. Transform @@ -18,13 +18,15 @@ C to -1. In the N array, N(1) must be the true N(1), not N(1)/2+1. C The transform will be real and returned to the input array. parameter (NPMAX=100) + parameter (NSMALL=16384) complex a(nfft) complex aa(32768) integer nn(NPMAX),ns(NPMAX),nf(NPMAX),nl(NPMAX) - real*8 plan(NPMAX) !Should be i*8 + real*8 plan(NPMAX) !Actually should be i*8, but no matter data nplan/0/ include 'fftw3.f' - save + common/patience/npatience + save plan,nplan,nn,ns,nf,nl if(nfft.lt.0) go to 999 @@ -41,12 +43,19 @@ C The transform will be real and returned to the input array. nf(i)=iform nl(i)=nloc -C Planning: FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE +C Planning: FFTW_ESTIMATE, FFTW_ESTIMATE_PATIENT, FFTW_MEASURE, +C FFTW_PATIENT, FFTW_EXHAUSTIVE +C NB: "EXHAUSTIVE" takes more or less forever, for long transforms. nspeed=FFTW_ESTIMATE - if(nfft.le.16384) nspeed=FFTW_MEASURE - nspeed=FFTW_MEASURE - if(nfft.le.32768) then - do j=1,nfft + if(npatience.eq.1) nspeed=FFTW_ESTIMATE_PATIENT + if(npatience.eq.2) nspeed=FFTW_MEASURE + if(npatience.eq.3) nspeed=FFTW_PATIENT + if(npatience.eq.4) nspeed=FFTW_EXHAUSTIVE + nspeed=nspeed + FFTW_THREADSAFE+FFTW_USE_WISDOM + if(nfft.le.NSMALL) then + jz=nfft + if(iform.eq.0) jz=nfft/2 + do j=1,jz aa(j)=a(j) enddo endif @@ -66,13 +75,16 @@ C Planning: FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE endif call sleep_msec(0) i=nplan - if(nfft.le.32768) then - do j=1,nfft + if(nfft.le.NSMALL) then + jz=nfft + if(iform.eq.0) jz=nfft/2 + do j=1,jz a(j)=aa(j) enddo endif - 10 call sleep_msec(0) + 10 continue + call sleep_msec(0) call sfftw_execute_(plan(i)) call sleep_msec(0) return diff --git a/ftn_init.F90 b/ftn_init.F90 index b40f1f021..a91f700e6 100644 --- a/ftn_init.F90 +++ b/ftn_init.F90 @@ -18,7 +18,7 @@ ! 25 meas25.dat ! 26 tmp26.txt ! 27 dphi.txt -! 28 +! 28 fftw_wisdom.dat ! 29 debug.txt !------------------------------------------------ ftn_init subroutine ftn_init @@ -140,6 +140,12 @@ subroutine ftn_init open(27,file=appdir(:iz)//'/dphi.txt',status='unknown') #endif + open(28,file='fftw_wisdom.dat',status='unknown') + call import_wisdom_from_file(isuccess,28) + close(28) + if(isuccess.ne.0) write(*,1000) +1000 format('Using optimized FFTs.') + #ifdef CVF open(29,file=appdir(:iz)//'/debug.txt',status='unknown', & share='denynone') diff --git a/libfftw3f.a b/libfftw3f.a index c1d49dc19..6e1ea3a46 100644 Binary files a/libfftw3f.a and b/libfftw3f.a differ