From cc7224d361d58eb23e500efb945ba45bc85a68b2 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 29 Sep 2016 16:39:14 +0000 Subject: [PATCH] Minor cleanup; add some !$OMP stuff to msk144sync.f90, but it's not yet functional. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7119 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/msk144sync.f90 | 22 +++++++++++++++++++--- lib/mskrtd.f90 | 6 ++---- mainwindow.cpp | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/lib/msk144sync.f90 b/lib/msk144sync.f90 index 12fa3ef4e..92e84dd2a 100644 --- a/lib/msk144sync.f90 +++ b/lib/msk144sync.f90 @@ -1,4 +1,5 @@ -subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest,npklocs,nsuccess,c) +subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, & + npklocs,nsuccess,c) parameter (NSPM=864) complex cdat(NSPM*nframes) @@ -9,6 +10,7 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest,npklocs,nsuc complex cb(42) !Complex waveform for sync word complex cc(0:NSPM-1) + integer*8 count0,count1,clkfreq integer s8(8) integer iloc(1) integer npklocs(npeaks) @@ -22,9 +24,9 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest,npklocs,nsuc logical first data first/.true./ data s8/0,1,1,1,0,0,1,0/ - save first,cb,fs,pi,twopi,dt,s8,pp + save first,cb,fs,pi,twopi,dt,s8,pp,t,ncall -! call system_clock(count0,clkfreq) + call system_clock(count0,clkfreq) if(first) then pi=4.0*atan(1.0) twopi=8.0*atan(1.0) @@ -48,6 +50,8 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest,npklocs,nsuc cbi(37:42)=pp(1:6)*s8(8) cb=cmplx(cbi,cbq) + ncall=0 + t=0.0 first=.false. endif @@ -73,9 +77,15 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest,npklocs,nsuc cc=0 ct2(1:NSPM)=c ct2(NSPM+1:2*NSPM)=c + + nchunk=NSPM/2 +!$OMP PARALLEL SHARED(cb,ct2,cc,nchunk) PRIVATE(ish) +!$OMP DO SCHEDULE(DYNAMIC,nchunk) do ish=0,NSPM-1 cc(ish)=dot_product(ct2(1+ish:42+ish)+ct2(336+ish:377+ish),cb(1:42)) enddo +!$OMP END DO NOWAIT +!$OMP END PARALLEL xcc=abs(cc) xb=maxval(xcc)*fac @@ -106,5 +116,11 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest,npklocs,nsuc nsuccess=1 endif + ncall=ncall+1 + call system_clock(count1,clkfreq) + t=t + float(count1-count0)/clkfreq +! write(*,3001) t,20*t/ncall +!3001 format(2f8.3) + return end subroutine msk144sync diff --git a/lib/mskrtd.f90 b/lib/mskrtd.f90 index 80e3e3db0..291f4482e 100644 --- a/lib/mskrtd.f90 +++ b/lib/mskrtd.f90 @@ -105,7 +105,8 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line) navg=sum(iavmask) deltaf=7.0/real(navg) ! search increment for frequency sync npeaks=2 - call msk144sync(cdat(1:8*NSPM),8,ntol,deltaf,iavmask,npeaks,fc,fest,npkloc,nsyncsuccess,c) + call msk144sync(cdat(1:8*NSPM),8,ntol,deltaf,iavmask,npeaks,fc, & + fest,npkloc,nsyncsuccess,c) if( nsyncsuccess .eq. 0 ) cycle do ipk=1,npeaks @@ -114,9 +115,7 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line) if(is.eq.2) ic0=max(1,ic0-1) if(is.eq.3) ic0=min(NSPM,ic0+1) ct=cshift(c,ic0-1) - call msk144decodeframe(ct,msgreceived,ndecodesuccess) - if(ndecodesuccess .gt. 0) then tdec=tsec+xmc(iavg)*tframe decsym=' ^ ' @@ -156,7 +155,6 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line) write(line,1020) nutc0,nsnr,tdec,nint(fest),decsym,msgreceived,char(0) 1020 format(i6.6,i4,f5.1,i5,a3,a22,a1) endif - 999 tsec0=tsec return diff --git a/mainwindow.cpp b/mainwindow.cpp index 2570f2141..81f1db66f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -3044,7 +3044,7 @@ void MainWindow::guiUpdate() if(m_mode=="MSK144" and m_config.realTimeDecode()) { int npct=int(100.0*m_fCPUmskrtd/0.298667); if(npct>90) tx_status_label.setStyleSheet("QLabel{background-color: #ff0000}"); - t.sprintf("Receiving %2d\%",npct); + t.sprintf("Receiving %2d%%",npct); } tx_status_label.setText (t); }