23 use,
intrinsic :: iso_c_binding
34 pfft_create_procmesh_2d, &
38 pfft_local_size_dft_r2c_3d, &
39 pfft_local_size_dft_3d, &
40 pfft_plan_dft_c2r_3d, &
41 pfft_plan_dft_r2c_3d, &
50 pfft_transposed_out, &
62 integer(C_INTPTR_T),
parameter :: FFTW_MPI_DEFAULT_BLOCK = 0
74 use,
intrinsic :: iso_c_binding
95 integer,
intent(in) :: n_proc
96 integer,
intent(out) :: dim1
97 integer,
intent(out) :: dim2
120 if (dim1 <= dim2)
then
128 assert(dim1*dim2 == n_proc)
136 type(C_PTR),
intent(out) :: plan
137 integer,
intent(in) :: n(:)
138 real(real64),
pointer,
intent(inout) :: in(:,:,:)
139 complex(real64),
pointer,
intent(inout) :: out(:,:,:)
140 integer,
intent(in) :: sign
141 integer,
intent(in) :: flags
143 integer,
intent(in) :: mpi_comm
145 integer(C_INTPTR_T) :: tmp_n(3)
151 assert(sign == pfft_forward)
154 tmp_n(1:3) = n(3:1:-1)
157 plan = pfft_plan_dft_r2c_3d(tmp_n,in,out,mpi_comm,sign,&
158 pfft_transposed_out + pfft_measure + pfft_destroy_input + pfft_tune)
170 type(C_PTR),
intent(out) :: plan
171 integer,
intent(in) :: n(:)
172 complex(real64),
pointer,
intent(inout) :: in(:,:,:)
173 real(real64),
pointer,
intent(inout) :: out(:,:,:)
174 integer,
intent(in) :: sign
175 integer,
intent(in) :: flags
177 integer,
intent(in) :: mpi_comm
179 integer(C_INTPTR_T) :: tmp_n(3)
184 assert(sign == pfft_backward)
187 tmp_n(1:3) = n(3:1:-1)
190 plan = pfft_plan_dft_c2r_3d(tmp_n,in,out,mpi_comm, sign, &
191 pfft_transposed_in + pfft_measure + pfft_destroy_input + pfft_tune)
205 type(c_ptr),
intent(out) :: plan
206 integer,
intent(in) :: n(:)
207 complex(real64),
pointer,
intent(inout) :: in(:,:,:)
208 complex(real64),
pointer,
intent(inout) :: out(:,:,:)
209 integer,
intent(in) :: sign
211 integer,
intent(in) :: flags
213 integer,
intent(in) :: mpi_comm
216 integer(C_INT) :: pfft_flags
218 integer(C_INTPTR_T) :: tmp_n(3)
222 tmp_n(1:3) = n(3:1:-1)
225 if (sign == pfft_forward)
then
226 pfft_flags = pfft_transposed_out
228 pfft_flags = pfft_transposed_in
231 plan = pfft_plan_dft_3d(tmp_n,in,out,mpi_comm, sign, pfft_flags)
241 subroutine pfft_get_dims(rs_n_global, mpi_comm, is_real, alloc_size, fs_n_global, rs_n, fs_n, rs_istart, fs_istart)
242 integer,
intent(in) :: rs_n_global(1:3)
243 integer,
intent(in) :: mpi_comm
244 logical,
intent(in) :: is_real
245 integer(int64),
intent(out) :: alloc_size
246 integer,
intent(out) :: fs_n_global(1:3)
247 integer,
intent(out) :: rs_n(1:3)
248 integer,
intent(out) :: fs_n(1:3)
249 integer,
intent(out) :: rs_istart(1:3)
250 integer,
intent(out) :: fs_istart(1:3)
252 integer(C_INTPTR_T) :: tmp_alloc_size, tmp_n(3)
253 integer(C_INTPTR_T) :: tmp_rs_n(3), tmp_rs_istart(3)
254 integer(C_INTPTR_T) :: tmp_fs_n(3), tmp_fs_istart(3)
258 fs_n_global(1:3) = rs_n_global(1:3)
261 tmp_n(1:3) = rs_n_global(3:1:-1)
266 tmp_alloc_size = pfft_local_size_dft_r2c_3d(tmp_n, mpi_comm, pfft_transposed_out, &
267 tmp_rs_n, tmp_rs_istart, tmp_fs_n, tmp_fs_istart)
270 fs_n_global(1) = rs_n_global(1)/2 + 1
272 tmp_alloc_size = pfft_local_size_dft_3d(tmp_n,mpi_comm, pfft_transposed_out, &
273 tmp_rs_n,tmp_rs_istart,tmp_fs_n,tmp_fs_istart)
283 alloc_size = int(tmp_alloc_size, int64)
284 rs_n(1:3) = int(tmp_rs_n(3:1:-1))
285 fs_n(1:3) = int(tmp_fs_n(3:1:-1))
286 rs_istart(1:3) = int(tmp_rs_istart(3:1:-1)+1)
287 fs_istart(1:3) = int(tmp_fs_istart(3:1:-1)+1)
This module is intended to contain "only mathematical" functions and procedures.
logical function, public is_prime(n)
The low level module to work with the PFFT library. http:
subroutine, public pfft_prepare_plan_c2c(plan, n, in, out, sign, flags, mpi_comm)
Octopus subroutine to prepare a PFFT plan real to complex.
subroutine, public pfft_prepare_plan_c2r(plan, n, in, out, sign, flags, mpi_comm)
Octopus subroutine to prepare a PFFT plan real to complex.
subroutine, public pfft_decompose(n_proc, dim1, dim2)
Decompose all available processors in 2D processor grid, most equally possible.
subroutine, public pfft_prepare_plan_r2c(plan, n, in, out, sign, flags, mpi_comm)
Octopus subroutine to prepare a PFFT plan real to complex.
subroutine, public pfft_get_dims(rs_n_global, mpi_comm, is_real, alloc_size, fs_n_global, rs_n, fs_n, rs_istart, fs_istart)
The includes for the PFFT.
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.