Skip to content

Commit

Permalink
modfftw: fix zeroing unused part of workspace in last tile in row or …
Browse files Browse the repository at this point in the history
…column

fix for the case when the data *is* evenly divisible over the tiles.
Found by Frans Liqui Lung
  • Loading branch information
fjansson committed Apr 24, 2024
1 parent 8f2c585 commit d6612ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modfftw.f90
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,10 @@ subroutine fftwf(p, Fp)

call transpose_a2(p210, p201)
! zero the unused part, avoinds SIGFPE from the FFT (Debug mode)
if (myidx == nprocx-1 .and. konx_last < konx) p201(:,konx_last+1:, :) = 0
if (myidy == nprocy-1 .and. iony_last < iony) p201(:,:,iony_last+1:) = 0
! p201(jtot,konx,iony)
if (myidx == nprocx-1) p201(:,konx_last+1:, :) = 0
if (myidy == nprocy-1) p201(:,:,iony_last+1:) = 0

call fftw_execute_r2r_if(plany, p201_flat, p201_flat)

call transpose_a3(p201, Fp)
Expand Down

0 comments on commit d6612ce

Please sign in to comment.