diff --git a/lib/decjt9.f90 b/lib/decjt9.f90 index bc413e462..78291e11c 100644 --- a/lib/decjt9.f90 +++ b/lib/decjt9.f90 @@ -10,6 +10,7 @@ subroutine decjt9(ss,id2,nutc,nfqso,newdat,npts8,nfa,nfsplit,nfb,ntol, & logical done(NSMAX) integer*2 id2(NTMAX*12000) integer*1 i1SoftSymbols(207) + common/decstats/num65,numbm,numkv,num9,numfano save ccfred,red2 nsynced=0 @@ -106,8 +107,10 @@ subroutine decjt9(ss,id2,nutc,nfqso,newdat,npts8,nfa,nfsplit,nfb,ntol, & if(nsync.gt.10) nsync=10 nsnr=nint(snrdb) ndrift=nint(drift/df3) + num9=num9+1 if(msg.ne.' ') then + numfano=numfano+1 if(nqd.eq.0) ndecodes0=ndecodes0+1 if(nqd.eq.1) ndecodes1=ndecodes1+1 diff --git a/lib/extract.F90 b/lib/extract.F90 index ce6a9582f..d870b6016 100644 --- a/lib/extract.F90 +++ b/lib/extract.F90 @@ -19,6 +19,7 @@ subroutine extract(s3,nadd,nqd,ncount,nhist,decoded,ltext,nbmkv) integer dat4(12) integer mrsym(63),mr2sym(63),mrprob(63),mr2prob(63) logical nokv,ltext + common/decstats/num65,numbm,numkv,num9,numfano data nokv/.false./,nsec1/0/ save @@ -57,6 +58,7 @@ subroutine extract(s3,nadd,nqd,ncount,nhist,decoded,ltext,nbmkv) call graycode65(mrsym,63,-1) !Remove gray code and interleaving call interleave63(mrsym,-1) !from most reliable symbols call interleave63(mrprob,-1) + num65=num65+1 ! Decode using Berlekamp-Massey algorithm call timer('rs_decod',0) @@ -112,5 +114,9 @@ subroutine extract(s3,nadd,nqd,ncount,nhist,decoded,ltext,nbmkv) nbmkv=2 endif -900 return +900 continue + if(nbmkv.eq.1) numbm=numbm+1 + if(nbmkv.eq.2) numkv=numkv+1 + + return end subroutine extract diff --git a/lib/flat4.f90 b/lib/flat4.f90 index 64e7b7f93..f9d4c72f2 100644 --- a/lib/flat4.f90 +++ b/lib/flat4.f90 @@ -28,7 +28,7 @@ subroutine flat4(s,npts,nflatten) call pctile(s(ia),ib-ia+1,npct,base) !Find lowest npct of points in segment do i=ia,ib if(s(i).le.base) then - k=k+1 !Save thesde "lower envelope" points + k=k+1 !Save these "lower envelope" points x(k)=i-i0 y(k)=s(i) endif diff --git a/lib/jt9.f90 b/lib/jt9.f90 index 983c958e7..4d9a33e9e 100644 --- a/lib/jt9.f90 +++ b/lib/jt9.f90 @@ -39,6 +39,7 @@ program jt9 mousefqso,newdat,nfa,nfsplit,nfb,ntol,kin,nzhsym,nsynced,ndecoded common/tracer/limtrace,lu common/patience/npatience,nthreads + common/decstats/num65,numbm,numkv,num9,numfano data npatience/1/,nthreads/1/ do @@ -131,6 +132,12 @@ program jt9 wisfile=trim(data_dir)//'/jt9_wisdom.dat'// C_NULL_CHAR iret=fftwf_import_wisdom_from_filename(wisfile) + num65=0 + numbm=0 + numkv=0 + num9=0 + numfano=0 + if (shmem) then call jt9a() go to 999 @@ -211,7 +218,13 @@ program jt9 print*,infile 999 continue - !Save wisdom and free memory +! Output decoder statistics + write(12,1100) numbm,numkv,num65 +1100 format(/'JT65: ',i6,' BM and',i7,' KV in',i7,' attempts') + write(12,1110) numfano,num9 +1110 format('JT9: ',i6,' Fano in',12x,i7,' attempts') + +! Save wisdom and free memory iret=fftwf_export_wisdom_to_filename(wisfile) call four2a(a,-1,1,1,1) call filbig(a,-1,1,0.0,0,0,0,0,0) !used for FFT plans diff --git a/lib/timer.f90 b/lib/timer.f90 index 1dd74bdf4..19d6e3cbd 100644 --- a/lib/timer.f90 +++ b/lib/timer.f90 @@ -105,8 +105,8 @@ subroutine timer(dname,k) ! Write out the timer statistics 40 write(lu,1040) -1040 format(/' name time frac dtime', & - ' dfrac calls'/56('-')) +1040 format(/' Name Time Frac dTime', & + ' dFrac Calls'/58('-')) !$ !walk backwards through the database rolling up thread data by call chain !$ do i=nmax,1,-1 @@ -145,7 +145,7 @@ subroutine timer(dname,k) i=1 call print_root(i) write(lu,1070) sum,sumf -1070 format(/32x,f10.3,f6.2) +1070 format(58('-')/32x,f10.3,f6.2) nmax=0 eps=0.000001 ntrace=0 @@ -187,11 +187,11 @@ recursive subroutine print_root(i) kk=nlevel(i) sname=space(1:kk)//name(i)//space(1:8-kk) write(lu,2000) sname,ut(i),utf,dut,dutf,ncall(i) +2000 format(a16,2(f10.3,f6.2),i9) do j=i,nmax if(nparent(j).eq.i) call print_root(j) enddo end if end if -2000 format(a16,2(f10.3,f6.2),i7,i5) return end subroutine print_root