You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multi-threaded FFTW starts to be useful when arrays have a few thousand entries, which is currently not the case in the Biot-Savart computations. Thus it would be more useful to use single-threaded FFTW instead and parallelize the surrounding loop, i.e. instead of
p_fft_output = fftw_alloc_complex(int(nfft, c_size_t))
call c_f_pointer(p_fft_output, fft_output, [nfft])
p_AR = fftw_alloc_real(int(nphi, c_size_t))
call c_f_pointer(p_AR, AR, [nphi])
! ... further input arrays
do kZ =1, nZ
do kR =1, nR
!$omp parallel do shared(AR) ...
do kphi =1, nphi
! ... fill input arrays
end do
!$omp end parallel docall fftw_execute_dft_r2c(plan_nphi, AR, fft_output)
AnR(0:nmax, kR, kZ, kc) = fft_output(1:nmax+1) /dble(nphi)
! ... further transforms
end doend do
do
!$omp parallel private(AR, fft_output), shared(AnR)
p_fft_output = fftw_alloc_complex(int(nfft, c_size_t))
call c_f_pointer(p_fft_output, fft_output, [nfft])
p_AR = fftw_alloc_real(int(nphi, c_size_t))
call c_f_pointer(p_AR, AR, [nphi])
! ... further input arrays
!$omp do collapse(3) ...
do kZ =1, nZ
do kR =1, nR
do kphi =1, nphi
! ... fill input arrays
end docall fftw_execute_dft_r2c(plan_nphi, AR, fft_output)
AnR(0:nmax, kR, kZ, kc) = fft_output(1:nmax+1) /dble(nphi)
! ... further transforms
end doend do
!$omp end do
!$omp end parallel
Finally, the question is whether to link fftw3orfftw3_omp.
The text was updated successfully, but these errors were encountered:
Multi-threaded FFTW starts to be useful when arrays have a few thousand entries, which is currently not the case in the Biot-Savart computations. Thus it would be more useful to use single-threaded FFTW instead and parallelize the surrounding loop, i.e. instead of
do
Finally, the question is whether to link
fftw3
orfftw3_omp
.The text was updated successfully, but these errors were encountered: