Fix a crash which appears to be a stack size limitation

This issue was probably triggered  by OpenMP forcing some large arrays
onto the  stack where  Fortran might normally  make them  static.  The
change  that  seemed to  make  the  difference  was putting  cdat2  in
msk144_freq_search into  static storage. I  am not convinced  that the
problem is really solved but it works for now.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7130 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2016-09-30 23:32:01 +00:00
parent 98cfad968f
commit c7c50830bf
5 changed files with 9 additions and 9 deletions

View File

@ -775,8 +775,8 @@ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++11 -fexceptions -
if (NOT APPLE) if (NOT APPLE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas")
if (${OPENMP_FOUND}) if (${OPENMP_FOUND})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
endif () endif ()
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fdata-sections -ffunction-sections") set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fdata-sections -ffunction-sections")
set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections") set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections")

View File

@ -12,6 +12,7 @@ subroutine msk144_freq_search(cdat,fc,if1,if2,delf,nframes,navmask,cb, &
real xcc(0:NSPM-1) real xcc(0:NSPM-1)
real xccs(0:NSPM-1) real xccs(0:NSPM-1)
integer navmask(nframes) ! defines which frames to average integer navmask(nframes) ! defines which frames to average
save cdat2
navg=sum(navmask) navg=sum(navmask)
n=nframes*NSPM n=nframes*NSPM

View File

@ -8,7 +8,7 @@ subroutine msk144decodeframe(c,msgreceived,nsuccess)
complex c(NSPM) complex c(NSPM)
integer*1 decoded(80) integer*1 decoded(80)
integer s8(8),hardbits(144) integer s8(8),hardbits(144)
real*8 dt, df, fs, pi, twopi real*8 dt, fs, pi, twopi
real cbi(42),cbq(42) real cbi(42),cbq(42)
real pp(12) real pp(12)
real softbits(144) real softbits(144)
@ -16,7 +16,7 @@ subroutine msk144decodeframe(c,msgreceived,nsuccess)
logical first logical first
data first/.true./ data first/.true./
data s8/0,1,1,1,0,0,1,0/ data s8/0,1,1,1,0,0,1,0/
save df,first,cb,fs,pi,twopi,dt,s8,pp save first,cb,fs,pi,twopi,dt,s8,pp
if(first) then if(first) then
! define half-sine pulse and raised-cosine edge window ! define half-sine pulse and raised-cosine edge window
@ -24,7 +24,6 @@ subroutine msk144decodeframe(c,msgreceived,nsuccess)
twopi=8d0*datan(1d0) twopi=8d0*datan(1d0)
fs=12000.0 fs=12000.0
dt=1.0/fs dt=1.0/fs
df=fs/NFFT
do i=1,12 do i=1,12
angle=(i-1)*pi/12.0 angle=(i-1)*pi/12.0
@ -103,5 +102,6 @@ subroutine msk144decodeframe(c,msgreceived,nsuccess)
nsuccess=1 nsuccess=1
endif endif
endif endif
return return
end subroutine msk144decodeframe end subroutine msk144decodeframe

View File

@ -60,9 +60,8 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, &
nthreads=1 nthreads=1
!$ nthreads=min(8,int(OMP_GET_MAX_THREADS(),4)) !$ nthreads=min(8,int(OMP_GET_MAX_THREADS(),4))
nstep=nfreqs/nthreads nstep=nfreqs/nthreads
!$ call OMP_SET_NUM_THREADS(nthreads)
!$OMP PARALLEL PRIVATE(id,if1,if2) !$OMP PARALLEL NUM_THREADS(nthreads) PRIVATE(id,if1,if2)
id=1 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 if1=-nint(ntol/delf) + (id-1)*nstep
@ -72,7 +71,7 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, &
xm(id),bf(id),cs(1,id),xccs(1,id)) xm(id),bf(id),cs(1,id),xccs(1,id))
! write(73,3002) id,if1,if2,nfreqs,nthreads,bf(id),xm(id) ! write(73,3002) id,if1,if2,nfreqs,nthreads,bf(id),xm(id)
!3002 format(5i5,2f10.3) !3002 format(5i5,2f10.3)
!$OMP END PARALLEL !$OMP END PARALLEL
xmax=xm(1) xmax=xm(1)
fest=fc+bf(1) fest=fc+bf(1)

View File

@ -37,7 +37,7 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line)
1,1,1,1,1,1,1,0/ 1,1,1,1,1,1,1,0/
data xmc/2.0,4.5,2.5,3.5/ !Used to label decode with time at center of averaging mask data xmc/2.0,4.5,2.5,3.5/ !Used to label decode with time at center of averaging mask
save first,tsec0,nutc00,pnoise,nsnrlast,msglast save first,tsec0,nutc00,pnoise,nsnrlast,msglast,cdat
if(first) then if(first) then
tsec0=tsec tsec0=tsec