From 2068d358c4a0b16e79e5492bf1eada9634c0773c Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 3 Oct 2016 13:48:30 +0000 Subject: [PATCH] More complete definition of CPU usage for MSK144 RT decoding. Speed is back to that of r7139. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7143 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/msk144sync.f90 | 10 +++++----- mainwindow.cpp | 9 ++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/msk144sync.f90 b/lib/msk144sync.f90 index 751d99902..eec4d9d08 100644 --- a/lib/msk144sync.f90 +++ b/lib/msk144sync.f90 @@ -1,7 +1,7 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, & npklocs,nsuccess,c) - !$ use omp_lib +!$ use omp_lib parameter (NSPM=864) complex cdat(NSPM*nframes) @@ -59,12 +59,12 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, & xm=0.0 bf=0.0 nthreads=1 - !$ nthreads=min(8,int(OMP_GET_MAX_THREADS(),4)) +!$ nthreads=min(8,int(OMP_GET_MAX_THREADS(),4)) nstep=nfreqs/nthreads - !$OMP PARALLEL NUM_THREADS(nthreads) PRIVATE(id,if1,if2) +!$OMP PARALLEL NUM_THREADS(nthreads) PRIVATE(id,if1,if2) id=1 - !$ id=OMP_GET_THREAD_NUM() + 1 !Thread id = 1,2,... +!$ id=OMP_GET_THREAD_NUM() + 1 !Thread id = 1,2,... if1=-nint(ntol/delf) + (id-1)*nstep if2=if1+nstep-1 if(id.eq.nthreads) if2=nint(ntol/delf) @@ -72,7 +72,7 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, & cdat2(1,id),xm(id),bf(id),cs(1,id),xccs(1,id)) ! write(73,3002) id,if1,if2,nfreqs,nthreads,bf(id),xm(id) !3002 format(5i5,2f10.3) - !$OMP END PARALLEL +!$OMP END PARALLEL xmax=xm(1) fest=fc+bf(1) diff --git a/mainwindow.cpp b/mainwindow.cpp index 56a399b97..edd1ceded 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1279,23 +1279,20 @@ void MainWindow::fastSink(qint64 frames) bmsk144=bmsk144 && m_config.realTimeDecode(); line[0]=0; - //### m_RxFreq=ui->RxFreqSpinBox->value (); int nTRpDepth=m_TRperiod + 1000*(m_ndepth & 3); qint64 ms0 = QDateTime::currentMSecsSinceEpoch(); hspec_(dec_data.d2,&k,&nutc0,&nTRpDepth,&m_RxFreq,&m_Ftol,&bmsk144,&m_inGain, fast_green,fast_s,&fast_jh, &line[0],80); - float tsec=0.001*(QDateTime::currentMSecsSinceEpoch() - ms0); - m_fCPUmskrtd=0.9*m_fCPUmskrtd + 0.1*tsec; float px = fast_green[fast_jh]; QString t; t.sprintf(" Rx noise: %5.1f ",px); ui->signal_meter_widget->setValue(px); // Update thermometer m_fastGraph->plotSpec(m_diskData,m_UTCdisk); - DecodedText decodedtext; - QString message; if(bmsk144 and (line[0]!=0)) { + DecodedText decodedtext; + QString message; message=QString::fromLatin1(line); decodedtext=message.replace("\n",""); ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(), @@ -1365,6 +1362,8 @@ void MainWindow::fastSink(qint64 frames) } m_bFastDone=false; } + float tsec=0.001*(QDateTime::currentMSecsSinceEpoch() - ms0); + m_fCPUmskrtd=0.9*m_fCPUmskrtd + 0.1*tsec; } void MainWindow::showSoundInError(const QString& errorMsg)