From 7644a79c0b5bee65586f6f4a3a464c83e8747910 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 30 Sep 2016 16:59:18 +0000 Subject: [PATCH] Make new OpenMP code compile without OpenMP support git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7128 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/msk144sync.f90 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/msk144sync.f90 b/lib/msk144sync.f90 index c8500e796..35c1b827b 100644 --- a/lib/msk144sync.f90 +++ b/lib/msk144sync.f90 @@ -1,6 +1,8 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, & npklocs,nsuccess,c) + !$ use omp_lib + parameter (NSPM=864) complex cdat(NSPM*nframes) complex c(NSPM) !Coherently averaged complex data @@ -12,7 +14,6 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, & integer iloc(1) integer npklocs(npeaks) integer navmask(nframes) ! defines which frames to average - integer OMP_GET_THREAD_NUM,OMP_GET_MAX_THREADS real cbi(42),cbq(42) real pkamps(npeaks) @@ -56,12 +57,14 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, & nfreqs=2*nint(ntol/delf) + 1 xm=0.0 bf=0.0 - nthreads=min(8,OMP_GET_MAX_THREADS()) + nthreads=1 + !$ nthreads=min(8,int(OMP_GET_MAX_THREADS(),4)) nstep=nfreqs/nthreads - call OMP_SET_NUM_THREADS(nthreads) + !$ call OMP_SET_NUM_THREADS(nthreads) !$OMP PARALLEL PRIVATE(id,if1,if2) - id=OMP_GET_THREAD_NUM() + 1 !Thread id = 1,2,... + id=1 + !$ 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)