From b63b331d3205fdfcbab8d1eb0b9a72972d5f6d01 Mon Sep 17 00:00:00 2001 From: Ye Luo Date: Sun, 5 Jul 2020 18:30:25 -0400 Subject: [PATCH] Add safe-guard in fft_parallel.f90 --- FFTXlib/fft_parallel.f90 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/FFTXlib/fft_parallel.f90 b/FFTXlib/fft_parallel.f90 index 718f51f71..5eb1449dd 100644 --- a/FFTXlib/fft_parallel.f90 +++ b/FFTXlib/fft_parallel.f90 @@ -257,6 +257,10 @@ CONTAINS ! INTEGER :: comm2s ! +#if defined(_OPENMP) && !defined(__FFT_SCALAR_THREAD_SAFE) + CALL errore('many_cft3s::execute_using_tasks','needs thread-safe fft_scalar backend selected at compile time.',1) +#endif + ! IF ( isgn > 0 ) THEN ! G -> R !$omp parallel default(none) & !$omp private(i, j, comm2s) & @@ -350,6 +354,11 @@ CONTAINS ! This implementation requires thread-safe cft_1z ! IMPLICIT NONE + ! +#if defined(_OPENMP) && !defined(__FFT_SCALAR_THREAD_SAFE) + CALL errore('many_cft3s::execute_using_threads','needs thread-safe fft_scalar backend selected at compile time.',1) +#endif + ! IF ( isgn > 0 ) THEN ! G -> R !$omp parallel default(none) & !$omp private(i, j) &