Advertisement
Guest User

Untitled

a guest
Jun 6th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   subroutine test_real_3D_threads(input, output, array_ref)
  2.     double precision ::  input(N, N, N)
  3.     double complex :: output(N, N, N)
  4.     double complex :: array_ref(N, N, N)
  5.     integer*8 :: plan
  6.     integer :: i
  7.     integer :: id, nb_threads
  8.  
  9.     !call dfftw_plan_with_nthreads(omp_get_max_threads())
  10.     call dfftw_plan_with_nthreads(3)
  11.     call dfftw_plan_dft_r2c_3d(plan, N,N,N, input, output, FFTW_ESTIMATE)
  12. !$OMP PARALLEL SHARED(input, output) PRIVATE(plan, id)
  13.     id = omp_get_thread_num()
  14.     call init(input)
  15.     ! Don't forget to initialize
  16. !$OMP END PARALLEL
  17.     output(:,:,:) = 0
  18.  
  19.     call dfftw_execute_dft_r2c(plan, input, output)
  20.  
  21.     print *, "thread ", id
  22.     call compare(output, array_ref)
  23.     call dfftw_destroy_plan(plan)
  24.  
  25.   end subroutine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement