From 79a6ed5464526e61c9b4c45256923769e741e375 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 2 Feb 2015 18:29:00 +0000 Subject: [PATCH] Further algorithmic tweaks in the JT9 decoder. More detailed message to come, with comparative timing statistics. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4926 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CMakeLists.txt | 4 ++-- lib/Makefile.jtsdk | 4 ++-- lib/Makefile.linux | 9 ++++----- lib/decjt9.f90 | 6 +++++- lib/downsam9.f90 | 12 ++++++------ lib/softsym.f90 | 6 +++--- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ab55a935..8670a37b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -521,8 +521,8 @@ elseif (Fortran_COMPILER_NAME MATCHES "g77") else (Fortran_COMPILER_NAME MATCHES "gfortran.*") message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER}) message ("Fortran compiler: " ${Fortran_COMPILER_NAME}) - message ("No optimized Fortran compiler flags are known, we just try -O2...") - set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O2 ${General_FFLAGS}") + message ("No optimized Fortran compiler flags are known, we just try -O3...") + set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O3 ${General_FFLAGS}") set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fbounds-check ${General_FFLAGS}") endif (Fortran_COMPILER_NAME MATCHES "gfortran.*") diff --git a/lib/Makefile.jtsdk b/lib/Makefile.jtsdk index bc2546bdf..cde1126db 100644 --- a/lib/Makefile.jtsdk +++ b/lib/Makefile.jtsdk @@ -13,8 +13,8 @@ CC = c:/JTSDK/Qt5/Tools/mingw48_32/bin/gcc FC = c:/JTSDK/Qt5/Tools/mingw48_32/bin/gfortran CXX = c:/JTSDK/Qt5/Tools/mingw48_32/bin/g++ -FFLAGS = -O2 -Wall -fno-second-underscore -DWIN32 -CFLAGS = -I. -fbounds-check -mno-stack-arg-probe -DWIN32 +FFLAGS = -O3 -Wall -Wno-conversion -fno-second-underscore -DWIN32 +CFLAGS = -I. -mno-stack-arg-probe -DWIN32 # Default rules %.o: %.c diff --git a/lib/Makefile.linux b/lib/Makefile.linux index ecb8d4989..923eff4fc 100644 --- a/lib/Makefile.linux +++ b/lib/Makefile.linux @@ -12,8 +12,7 @@ CP = cp RANLIB = ranlib RM = rm -f -FFLAGS = -O2 -fbounds-check -Wall -Wno-conversion -fno-second-underscore \ - -fPIE -DUNIX +FFLAGS = -O3 -funroll-loops -Wall -Wno-conversion -fno-second-underscore -DUNIX CFLAGS = -I. -fbounds-check -fPIE # Default rules @@ -37,9 +36,9 @@ OBJS1 = astrosub.o astro0.o astro.o tm2.o sun.o moondop.o coord.o tmoonsub.o \ grid2k.o unpacktext.o getpfx2.o packmsg.o deg2grid.o \ packtext.o getpfx1.o packcall.o k2grid.o packgrid.o \ nchar.o four2a.o grid2deg.o pfxdump.o wisdom.o \ - symspec.o analytic.o db.o genjt9.o \ + symspec.o analytic.o db.o genjt9.o jt9fano.o \ packbits.o unpackbits.o encode232.o interleave9.o \ - entail.o fano232.o gran.o sync9.o decode9.o \ + entail.o fano232.o gran.o sync9.o decjt9.o \ fil3.o decoder.o grid2n.o n2grid.o timer.o \ softsym.o peakdt9.o getlags.o afc9.o fchisq.o \ twkfreq.o downsam9.o symspec2.o ipcomm.o sleep_msec.o \ @@ -59,7 +58,7 @@ libjt9.a: $(OBJS1) OBJS2 = jt9.o jt9a.o jt9b.o jt9c.o jt9: $(OBJS2) libjt9.a - $(CXX) -o jt9 $(OBJS2) -L. -ljt9 -lQt5Core -lfftw3f `$(FC) -print-file-name=libgfortran.so` + $(CXX) -o jt9 $(OBJS2) -L. -ljt9 -lQt5Core -lfftw3f_threads -lfftw3f `$(FC) -print-file-name=libgfortran.so` $(MKDIR) -p $(EXE_DIR) $(CP) jt9 $(EXE_DIR) diff --git a/lib/decjt9.f90 b/lib/decjt9.f90 index d39fdc901..f916b8c96 100644 --- a/lib/decjt9.f90 +++ b/lib/decjt9.f90 @@ -46,9 +46,13 @@ subroutine decjt9(ss,id2,nutc,nfqso,newdat,npts8,nfa,nfsplit,nfb,ntol, & ccflim=2.7 endif if(ndepth.ge.3 .or. nqd.eq.1) then - limit=50000 + limit=30000 ccflim=2.5 endif + if(nagain.ne.0) then + limit=100000 + ccflim=2.4 + endif ccfok=.false. if(nqd.eq.1) then diff --git a/lib/downsam9.f90 b/lib/downsam9.f90 index ac9e1855a..9096f90f2 100644 --- a/lib/downsam9.f90 +++ b/lib/downsam9.f90 @@ -1,7 +1,7 @@ subroutine downsam9(id2,npts8,nsps8,newdat,nspsd,fpk,c2,nz2) -!Downsample from id2() into C2() so as to yield nspsd samples per symbol, -!mixing from fpk down to zero frequency. +!Downsample from id2() into c2() so as to yield nspsd samples per symbol, +!mixing from fpk down to zero frequency. The downsample factor is 432. use, intrinsic :: iso_c_binding use FFTW3 @@ -9,23 +9,23 @@ subroutine downsam9(id2,npts8,nsps8,newdat,nspsd,fpk,c2,nz2) include 'constants.f90' ! parameter (NMAX1=1024*1920) parameter (NMAX1=884736) - type(C_PTR) :: plan !Pointers plan for big FFT + type(C_PTR) :: plan !Pointers plan for big FFT integer*2 id2(0:8*npts8-1) real*4 x1(0:NMAX1-1) complex c1(0:NMAX1/2) - complex c2(0:4096-1) + complex c2(0:1440-1) real s(5000) logical first common/patience/npatience,nthreads data first/.true./ save plan,first - nfft1=1024*nsps8 !Forward FFT length + nfft1=604800 !Forward FFT length df1=12000.0/nfft1 npts=8*npts8 if(newdat.eq.1) then - fac=6.963e-6 !Why this weird constant? + fac=6.963e-6 !Why this weird constant? do i=0,npts-1 x1(i)=fac*id2(i) enddo diff --git a/lib/softsym.f90 b/lib/softsym.f90 index 2e7c32ffa..cc43d6cc5 100644 --- a/lib/softsym.f90 +++ b/lib/softsym.f90 @@ -3,9 +3,9 @@ subroutine softsym(id2,npts8,nsps8,newdat,fpk,syncpk,snrdb,xdt, & ! Compute the soft symbols - complex c2(0:4096-1) - complex c3(0:4096-1) - complex c5(0:4096-1) + complex c2(0:1440-1) + complex c3(0:1440-1) + complex c5(0:1440-1) real a(3) integer*1 i1SoftSymbolsScrambled(207) integer*1 i1SoftSymbols(207)