26 use,
intrinsic :: iso_c_binding
27 use,
intrinsic :: ieee_arithmetic
34 use,
intrinsic :: iso_fortran_env
44#if defined(HAVE_OPENMP) && defined(HAVE_FFTW3_THREADS)
79 integer,
public,
parameter :: &
84 integer,
public,
parameter :: &
92 integer,
parameter :: &
101 integer,
public ::
type
102 integer,
public :: library
109 type(MPI_Comm) :: comm
110 integer :: rs_n_global(3)
111 integer :: fs_n_global(3)
114 integer :: rs_istart(1:3)
115 integer :: fs_istart(1:3)
118 integer,
public :: stride_rs(1:3)
119 integer,
public :: stride_fs(1:3)
128 real(real64),
contiguous,
pointer,
public :: drs_data(:,:,:,:)
129 complex(real64),
contiguous,
pointer,
public :: zrs_data(:,:,:,:)
130 complex(real64),
contiguous,
pointer,
public :: fs_data(:,:,:,:)
131 type(c_ptr) :: cuda_plan_fw
132 type(c_ptr) :: cuda_plan_bw
134 type(nfft_t),
public :: nfft
136 type(pnfft_t),
public :: pnfft
138 logical,
public :: aligned_memory
157 logical,
save,
public :: fft_initialized = .false.
158 integer,
save :: fft_refs(FFT_MAX)
159 type(fft_t),
save :: fft_array(FFT_MAX)
160 logical :: fft_optimize
161 integer,
save :: fft_prepare_plan
162 integer,
public :: fft_default_lib = -1
164 type(nfft_t),
save :: nfft_options
166 type(pnfft_t),
save :: pnfft_options
168 integer,
parameter :: &
169 CUFFT_R2C = int(z
'2a'), &
183 integer :: ii, fft_default
184#if defined(HAVE_OPENMP) && defined(HAVE_FFTW3_THREADS)
190 fft_initialized = .
true.
246 call parse_variable(namespace,
'FFTPreparePlan', fftw_estimate, fft_prepare_plan)
269 call parse_variable(namespace,
'FFTLibrary', fft_default, fft_default_lib)
276#if ! defined(HAVE_CUDA)
277 call messages_write(
'You have selected the Accelerated FFT, but Octopus was compiled', new_line = .
true.)
282 call messages_write(
'You have selected the accelerated FFT, but acceleration is disabled.')
287#if defined(HAVE_OPENMP) && defined(HAVE_FFTW3_THREADS)
288 if (omp_get_max_threads() > 1)
then
293 iret = fftw_init_threads()
298 call fftw_plan_with_nthreads(omp_get_max_threads())
328#if defined(HAVE_OPENMP) && defined(HAVE_FFTW3_THREADS)
329 call fftw_cleanup_threads()
334 fft_initialized = .false.
340 subroutine fft_init(this, nn, dim, type, library, optimize, optimize_parity, comm, mpi_grp, use_aligned, &
342 type(
fft_t),
intent(inout) :: this
343 integer,
intent(inout) :: nn(3)
344 integer,
intent(in) :: dim
345 integer,
intent(in) ::
type
346 integer,
intent(in) :: library
348 integer,
intent(in) :: optimize_parity(3)
350 type(mpi_comm),
optional,
intent(out) :: comm
351 type(
mpi_grp_t),
optional,
intent(in) :: mpi_grp
352 logical,
optional,
intent(in) :: use_aligned
353 integer,
optional,
intent(in) :: howmany
355 integer :: ii, jj, fft_dim, idir, column_size, row_size, n3
356 integer :: n_1, n_2, n_3, nn_temp(3)
359 integer(int64) :: number_points, alloc_size
367 assert(fft_initialized)
371 if (
present(mpi_grp)) mpi_grp_ = mpi_grp
375 assert(this%howmany > 0)
380 if (nn(ii) <= 1)
exit
381 fft_dim = fft_dim + 1
384 if (fft_dim == 0)
then
385 message(1) =
"Internal error in fft_init: apparently, a 1x1x1 FFT is required."
393 nn_temp(1:fft_dim) = nn(1:fft_dim)
395 select case (library_)
398 if(any(optimize_parity(1:fft_dim) > 1))
then
399 message(1) =
"Internal error in fft_init: optimize_parity must be negative, 0, or 1."
404 nn_temp(ii) =
fft_size(nn(ii), (/2, 3, 5, 7/), optimize_parity(ii))
405 if (fft_optimize .and.
optimize(ii)) nn(ii) = nn_temp(ii)
409 assert(this%howmany == 1)
414 if (int(nn(ii)/2)*2 /= nn(ii) .and. (fft_optimize .and.
optimize(ii)))&
419 assert(this%howmany == 1)
423 if (int(nn(ii)/2)*2 /= nn(ii)) nn(ii) = nn(ii) + 1
426 if (fft_dim < 3)
then
432 if (fft_dim < 3 .and. library_ ==
fftlib_pfft)
then
437 if (any(optimize_parity(1:fft_dim) > 1))
then
438 message(1) =
"Internal error in fft_init: optimize_parity must be negative, 0, or 1."
444 if (fft_optimize .and.
optimize(ii)) nn(ii) = nn_temp(ii)
451 do ii = fft_max, 1, -1
453 if (all(nn(1:dim) == fft_array(ii)%rs_n_global(1:dim)) .and.
type == fft_array(ii)%type &
454 .and. library_ == fft_array(ii)%library .and. library_ /=
fftlib_nfft &
456 .and. this%howmany == fft_array(ii)%howmany &
457 .and. this%aligned_memory .eqv. fft_array(ii)%aligned_memory)
then
462 fft_refs(ii) = fft_refs(ii) + 1
463 if (
present(comm)) comm = fft_array(ii)%comm
473 message(1) =
"Not enough slots for FFTs."
474 message(2) =
"Please increase FFT_MAX in fft.F90 and recompile."
480 fft_array(jj)%slot = jj
481 fft_array(jj)%type =
type
482 fft_array(jj)%library = library_
483 fft_array(jj)%howmany = this%howmany
484 fft_array(jj)%rs_n_global(1:dim) = nn(1:dim)
485 fft_array(jj)%rs_n_global(dim+1:) = 1
486 nullify(fft_array(jj)%drs_data)
487 nullify(fft_array(jj)%zrs_data)
488 nullify(fft_array(jj)%fs_data)
490 fft_array(jj)%aligned_memory = this%aligned_memory
493 select case (library_)
500 ierror = pfft_create_procmesh_2d(mpi_grp_%comm%MPI_VAL, column_size, row_size, fft_array(jj)%comm%MPI_VAL)
502 if (ierror /= 0)
then
503 message(1) =
"The number of rows and columns in PFFT processor grid is not equal to "
504 message(2) =
"the number of processor in the MPI communicator."
505 message(3) =
"Please check it."
519 if (
present(comm)) comm = fft_array(jj)%comm
522 select case (library_)
525 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
526 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
527 fft_array(jj)%rs_istart = 1
528 fft_array(jj)%fs_istart = 1
530 if (this%aligned_memory)
then
532 fft_pack(fft_array(jj)%fs_n_global, this%howmany), &
533 fft_array(jj)%drs_data, fft_array(jj)%zrs_data, fft_array(jj)%fs_data)
537 assert(this%howmany == 1)
540 alloc_size, fft_array(jj)%fs_n_global, fft_array(jj)%rs_n, &
541 fft_array(jj)%fs_n, fft_array(jj)%rs_istart, fft_array(jj)%fs_istart)
548 n_1 = max(1, fft_array(jj)%rs_n(1))
549 n_2 = max(1, fft_array(jj)%rs_n(2))
550 n_3 = max(1, fft_array(jj)%rs_n(3))
552 n3 = ceiling(real(2*alloc_size)/real(n_1*n_2))
553 safe_allocate(fft_array(jj)%drs_data(1:n_1, 1:n_2, 1:n3, 1:1))
555 n3 = ceiling(real(alloc_size)/real(fft_array(jj)%rs_n(1)*fft_array(jj)%rs_n(2)))
556 safe_allocate(fft_array(jj)%zrs_data(1:fft_array(jj)%rs_n(1), 1:fft_array(jj)%rs_n(2), 1:n3, 1:1))
559 n_1 = max(1, fft_array(jj)%fs_n(1))
560 n_2 = max(1, fft_array(jj)%fs_n(2))
561 n_3 = max(1, fft_array(jj)%fs_n(3))
563 n3 = ceiling(real(alloc_size)/real(n_3*n_1))
564 safe_allocate(fft_array(jj)%fs_data(1:n_3, 1:n_1, 1:n3, 1:1))
568 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
569 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
570 fft_array(jj)%rs_istart = 1
571 fft_array(jj)%fs_istart = 1
574 fft_array(jj)%fs_n_global = fft_array(jj)%rs_n_global
575 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
576 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
577 fft_array(jj)%rs_istart = 1
578 fft_array(jj)%fs_istart = 1
581 fft_array(jj)%fs_n_global = fft_array(jj)%rs_n_global
582 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
583 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
584 fft_array(jj)%rs_istart = 1
585 fft_array(jj)%fs_istart = 1
592 select case (library_)
594 if (.not. this%aligned_memory)
then
595 call fftw_prepare_plan(fft_array(jj)%planf, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
596 type ==
fft_real, fftw_forward, fft_prepare_plan+fftw_unaligned)
597 call fftw_prepare_plan(fft_array(jj)%planb, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
598 type ==
fft_real, fftw_backward, fft_prepare_plan+fftw_unaligned)
601 call fftw_prepare_plan(fft_array(jj)%planf, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
602 type ==
fft_real, fftw_forward, fft_prepare_plan, &
603 din_=fft_array(jj)%drs_data, cout_=fft_array(jj)%fs_data)
604 call fftw_prepare_plan(fft_array(jj)%planb, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
605 type ==
fft_real, fftw_backward, fft_prepare_plan, &
606 din_=fft_array(jj)%drs_data, cout_=fft_array(jj)%fs_data)
608 call fftw_prepare_plan(fft_array(jj)%planf, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
609 type ==
fft_real, fftw_forward, fft_prepare_plan, &
610 cin_=fft_array(jj)%zrs_data, cout_=fft_array(jj)%fs_data)
611 call fftw_prepare_plan(fft_array(jj)%planb, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
612 type ==
fft_real, fftw_backward, fft_prepare_plan, &
613 cin_=fft_array(jj)%zrs_data, cout_=fft_array(jj)%fs_data)
620 call nfft_init(fft_array(jj)%nfft, nfft_options, fft_array(jj)%rs_n_global, &
627 fft_array(jj)%fs_data, fftw_forward, fft_prepare_plan, fft_array(jj)%comm%MPI_VAL)
629 fft_array(jj)%drs_data, fftw_backward, fft_prepare_plan, fft_array(jj)%comm%MPI_VAL)
632 fft_array(jj)%fs_data, fftw_forward, fft_prepare_plan, fft_array(jj)%comm%MPI_VAL)
634 fft_array(jj)%zrs_data, fftw_backward, fft_prepare_plan, fft_array(jj)%comm%MPI_VAL)
656 call pnfft_init_plan(fft_array(jj)%pnfft, pnfft_options, comm, fft_array(jj)%fs_n_global, &
657 fft_array(jj)%fs_n, fft_array(jj)%fs_istart, fft_array(jj)%rs_n, fft_array(jj)%rs_istart)
661 fft_array(jj)%stride_rs(1) = 1
662 fft_array(jj)%stride_fs(1) = 1
664 fft_array(jj)%stride_rs(ii) = fft_array(jj)%stride_rs(ii - 1)*fft_array(jj)%rs_n(ii - 1)
665 fft_array(jj)%stride_fs(ii) = fft_array(jj)%stride_fs(ii - 1)*fft_array(jj)%fs_n(ii - 1)
670 call cuda_fft_plan_many(fft_array(jj)%cuda_plan_fw, this%howmany, &
671 fft_array(jj)%rs_n_global(3), fft_array(jj)%rs_n_global(2), fft_array(jj)%rs_n_global(1),
cufft_d2z, &
673 call cuda_fft_plan_many(fft_array(jj)%cuda_plan_bw, this%howmany, &
674 fft_array(jj)%rs_n_global(3), fft_array(jj)%rs_n_global(2), fft_array(jj)%rs_n_global(1),
cufft_z2d, &
677 call cuda_fft_plan_many(fft_array(jj)%cuda_plan_fw, this%howmany, &
678 fft_array(jj)%rs_n_global(3), fft_array(jj)%rs_n_global(2), fft_array(jj)%rs_n_global(1),
cufft_z2z, &
680 call cuda_fft_plan_many(fft_array(jj)%cuda_plan_bw, this%howmany, &
681 fft_array(jj)%rs_n_global(3), fft_array(jj)%rs_n_global(2), fft_array(jj)%rs_n_global(1),
cufft_z2z, &
701 number_points = number_points * fft_array(jj)%rs_n_global(idir)
710 if (any(nn(1:fft_dim) /= nn_temp(1:fft_dim)))
then
712 call messages_write(
' Inefficient FFT grid. A better grid would be: ')
720 select case (library_)
722 write(
message(1),
'(a)')
"Info: FFT library = PFFT"
723 write(
message(2),
'(a)')
"Info: PFFT processor grid"
724 write(
message(3),
'(a, i9)')
" No. of processors = ", mpi_grp_%size
725 write(
message(4),
'(a, i9)')
" No. of columns in the proc. grid = ", column_size
726 write(
message(5),
'(a, i9)')
" No. of rows in the proc. grid = ", row_size
727 write(
message(6),
'(a, i9)')
" The size of integer is = ", c_intptr_t
752 type(
fft_t),
intent(inout) :: this
756 real(real64),
intent(in) :: xx(:,:)
757 integer,
optional,
intent(in) :: nn(:)
763 assert(
size(xx,2) == 3)
766 select case (fft_array(slot)%library)
773 xx(1:nn(1),1), xx(1:nn(2),2), xx(1:nn(3),3))
794 type(
fft_t),
intent(inout) :: this
802 message(1) =
"Trying to deallocate FFT that has not been allocated."
805 if (fft_refs(ii) > 1)
then
806 fft_refs(ii) = fft_refs(ii) - 1
808 select case (fft_array(ii)%library)
810 call fftw_destroy_plan(fft_array(ii)%planf)
811 call fftw_destroy_plan(fft_array(ii)%planb)
813 if (this%aligned_memory)
then
815 fft_array(ii)%drs_data, fft_array(ii)%zrs_data, fft_array(ii)%fs_data)
820 call pfft_destroy_plan(fft_array(ii)%planf)
821 call pfft_destroy_plan(fft_array(ii)%planb)
823 safe_deallocate_p(fft_array(ii)%drs_data)
824 safe_deallocate_p(fft_array(ii)%zrs_data)
825 safe_deallocate_p(fft_array(ii)%fs_data)
829 call cuda_fft_destroy(fft_array(ii)%cuda_plan_fw)
830 call cuda_fft_destroy(fft_array(ii)%cuda_plan_bw)
852 type(
fft_t),
intent(in) :: fft_i
853 type(
fft_t),
intent(inout) :: fft_o
857 if (fft_o%slot > 0)
then
860 assert(fft_i%slot >= 1.and.fft_i%slot <= fft_max)
861 assert(fft_refs(fft_i%slot) > 0)
864 fft_refs(fft_i%slot) = fft_refs(fft_i%slot) + 1
871 function fft_pack(dims3, howmany)
result(dims4)
872 integer,
intent(in) :: dims3(3)
873 integer,
intent(in) :: howmany
876 dims4(1:3) = dims3(1:3)
881 subroutine fft_get_dims(fft, rs_n_global, fs_n_global, rs_n, fs_n, rs_istart, fs_istart)
882 type(
fft_t),
intent(in) :: fft
883 integer,
intent(out) :: rs_n_global(1:3)
884 integer,
intent(out) :: fs_n_global(1:3)
885 integer,
intent(out) :: rs_n(1:3)
886 integer,
intent(out) :: fs_n(1:3)
887 integer,
intent(out) :: rs_istart(1:3)
888 integer,
intent(out) :: fs_istart(1:3)
895 rs_n_global(1:3) = fft_array(slot)%rs_n_global(1:3)
896 fs_n_global(1:3) = fft_array(slot)%fs_n_global(1:3)
897 rs_n(1:3) = fft_array(slot)%rs_n(1:3)
898 fs_n(1:3) = fft_array(slot)%fs_n(1:3)
899 rs_istart(1:3) = fft_array(slot)%rs_istart(1:3)
900 fs_istart(1:3) = fft_array(slot)%fs_istart(1:3)
907 pure function pad_feq(ii, nn, mode)
908 integer,
intent(in) :: ii,nn
909 logical,
intent(in) ::
mode
915 if (ii <= nn/2 + 1)
then
932 integer function fft_size(size, factors, parity)
933 integer,
intent(in) :: size
934 integer,
intent(in) :: factors(:)
935 integer,
intent(in) :: parity
939 integer,
allocatable :: exponents(:)
943 nfactors = ubound(factors, dim = 1)
945 safe_allocate(exponents(1:nfactors))
950 if (nondiv == 1 .and. mod(
fft_size, 2) == parity)
exit
954 safe_deallocate_a(exponents)
961 subroutine get_exponents(num, nfactors, factors, exponents, nondiv)
962 integer,
intent(in) :: num
963 integer,
intent(in) :: nfactors
964 integer,
intent(in) :: factors(:)
965 integer,
intent(out) :: exponents(:)
966 integer,
intent(out) :: nondiv
973 do ifactor = 1, nfactors
974 exponents(ifactor) = 0
976 if (mod(nondiv, factors(ifactor)) /= 0)
exit
977 nondiv = nondiv/factors(ifactor)
978 exponents(ifactor) = exponents(ifactor) + 1
989 type(
fft_t),
intent(in) :: fft
991 real(real64) :: fullsize
995 fullsize = real(fft%howmany, real64)*product(real(fft%fs_n(1:3), real64))
1003 pure subroutine fft_gg_transform(gg_in, temp, periodic_dim, latt, qq, gg, modg2)
1004 integer,
intent(in) :: gg_in(:)
1005 real(real64),
intent(in) :: temp(:)
1006 integer,
intent(in) :: periodic_dim
1008 real(real64),
intent(in) :: qq(:)
1009 real(real64),
intent(out) :: gg(:)
1010 real(real64),
intent(out) :: modg2
1014 gg(1:3) = real(gg_in(1:3), real64)
1015 gg(1:periodic_dim) = gg(1:periodic_dim) + qq(1:periodic_dim)
1016 gg(1:3) = gg(1:3) * temp(1:3)
1017 gg(1:3) = matmul(latt%klattice_primitive(1:3,1:3),gg(1:3))
1018 modg2 = sum(gg(1:3)**2)
1027 type(
fft_t),
intent(in) :: fft
1030 scaling_factor =
m_one
1032 select case (fft_array(fft%slot)%library)
1035 scaling_factor =
m_one/real(fft_array(fft%slot)%rs_n_global(1), real64)
1036 scaling_factor = scaling_factor/real(fft_array(fft%slot)%rs_n_global(2), real64)
1037 scaling_factor = scaling_factor/real(fft_array(fft%slot)%rs_n_global(3), real64)
1048 real(real64) function
fft_get_ecut_from_box(box_dim, fs_istart, latt, gspacing, periodic_dim, qq) result(ecut)
1049 integer,
intent(in) :: box_dim(:)
1050 integer,
intent(in) :: fs_istart(:)
1052 real(real64),
intent(in) :: gspacing(:)
1053 integer,
intent(in) :: periodic_dim
1054 real(real64),
intent(in) :: qq(:)
1056 integer :: lx, ix, iy, iz, idir, idir2, idir3
1057 real(real64) :: dminsq, gg(3), modg2
1058 integer :: box_dim_(3), ixx(3)
1059 integer :: ming(3), maxg(3)
1063 assert(periodic_dim > 0)
1065 box_dim_(1:periodic_dim) = box_dim(1:periodic_dim)
1066 if (periodic_dim < 3) box_dim_(periodic_dim+1:3) = 1
1071 do idir = 1, periodic_dim
1072 do lx = 1, box_dim(idir)
1073 ix = fs_istart(idir) + lx - 1
1075 ming(idir) = min(ming(idir), ixx(idir))
1076 maxg(idir) = max(maxg(idir), ixx(idir))
1078 maxg(idir) = min(abs(ming(idir)), maxg(idir))
1083 do idir = 1, periodic_dim
1084 idir2 = mod(idir, 3)+1
1085 idir3 = mod(idir+1, 3)+1
1088 ixx(idir) = -maxg(idir)
1089 do iy = -maxg(idir2), maxg(idir2)
1091 do iz = -maxg(idir3), maxg(idir3)
1094 dminsq = min(dminsq, sum(gg(1:periodic_dim)**2))
1098 ixx(idir) = maxg(idir)
1099 do iy = -maxg(idir2), maxg(idir2)
1101 do iz = -maxg(idir3), maxg(idir3)
1104 dminsq = min(dminsq, sum(gg(1:periodic_dim)**2))
1115#include "fft_inc.F90"
1118#include "complex.F90"
1119#include "fft_inc.F90"
if write to the Free Software Franklin Fifth USA !If the compiler accepts long Fortran it is better to use that and build all the preprocessor definitions in one line In !this the debuggers will provide the right line numbers !If the compiler accepts line number then CARDINAL and ACARDINAL !will put them just a new line or a ampersand plus a new line !These macros should be used in macros that span several lines They should by !put immedialty before a line where a compilation error might occur and at the !end of the macro !Note that the cardinal and newline words are substituted by the program !preprocess pl by the ampersand and by a real new line just before compilation !The assertions are ignored if the code is compiled in not debug mode(NDEBUG ! is defined). Otherwise it is merely a logical assertion that
double log(double __x) __attribute__((__nothrow__
pure logical function, public accel_is_enabled()
type(accel_t), public accel
Fast Fourier Transform module. This module provides a single interface that works with different FFT ...
subroutine zfft_forward_accel(fft, in, out)
subroutine dfft_backward_1d(fft, in, out)
integer, parameter cufft_z2d
subroutine get_exponents(num, nfactors, factors, exponents, nondiv)
subroutine, public fft_all_init(namespace)
initialize the table
subroutine, public fft_init(this, nn, dim, type, library, optimize, optimize_parity, comm, mpi_grp, use_aligned, howmany)
real(real64) function, public fft_get_ecut_from_box(box_dim, fs_istart, latt, gspacing, periodic_dim, qq)
Given an fft box (fixed by the real-space grid), it returns the cutoff energy of the sphere that fits...
subroutine zfft_forward_many_3d(fft, in, out, norm)
subroutine zfft_backward_single_3d(fft, in, out, norm)
subroutine dfft_forward_accel(fft, in, out)
subroutine dfft_forward_single_3d(fft, in, out, norm)
subroutine, public fft_end(this)
real(real64) pure function, public fft_scaling_factor(fft)
This function returns the factor required to normalize a function after a forward and backward transf...
integer, parameter cufft_z2z
pure integer function, public pad_feq(ii, nn, mode)
convert between array index and G-vector
subroutine dfft_backward_single_3d(fft, in, out, norm)
subroutine zfft_backward_1d(fft, in, out)
integer, parameter, public fftlib_accel
integer function, dimension(4) fft_pack(dims3, howmany)
Rank-4 data-array shape (dims3, howmany) with the batch as the trailing (batch-last) axis.
subroutine, public fft_all_end()
delete all plans
integer function fft_size(size, factors, parity)
subroutine fft_operation_count(fft)
subroutine zfft_backward_accel(fft, in, out)
integer, parameter cufft_c2r
integer, parameter cufft_c2c
integer, parameter, public fft_real
subroutine, public fft_get_dims(fft, rs_n_global, fs_n_global, rs_n, fs_n, rs_istart, fs_istart)
integer, parameter, public fft_complex
integer, parameter, public fftlib_nfft
subroutine, public fft_copy(fft_i, fft_o)
subroutine dfft_backward_many_3d(fft, in, out, norm)
subroutine zfft_forward_single_3d(fft, in, out, norm)
subroutine zfft_backward_many_3d(fft, in, out, norm)
subroutine dfft_forward_1d(fft, in, out)
integer, parameter cufft_d2z
integer, parameter fft_null
integer, parameter, public fftlib_pnfft
subroutine dfft_forward_many_3d(fft, in, out, norm)
subroutine zfft_forward_1d(fft, in, out)
pure subroutine, public fft_gg_transform(gg_in, temp, periodic_dim, latt, qq, gg, modg2)
Convert FFT grid index into the Cartesian reciprocal-space vector .
integer, parameter, public fftlib_pfft
subroutine dfft_backward_accel(fft, in, out)
integer, parameter, public fftlib_fftw
subroutine, public fft_init_stage1(this, namespace, XX, nn)
Some fft-libraries (only NFFT for the moment) need an additional precomputation stage that depends on...
subroutine, public fftw_free_memory(is_real, drs_data, zrs_data, fs_data)
subroutine, public fftw_get_dims(rs_n, is_real, fs_n)
subroutine, public fftw_prepare_plan(plan, dim, n, howmany, is_real, sign, flags, din_, cin_, cout_)
subroutine, public fftw_alloc_memory(rs_dims, is_real, fs_dims, drs_data, zrs_data, fs_data)
Allocate the FFTW work buffers from the rank-4 (batch-last) dimension arrays (see fft_pack).
real(real64), parameter, public m_two
real(real64), parameter, public m_huge
real(real64), parameter, public m_half
real(real64), parameter, public m_one
subroutine, public messages_not_implemented(feature, namespace)
subroutine, public messages_warning(no_lines, all_nodes, namespace)
subroutine, public messages_new_line()
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_input_error(namespace, var, details, row, column)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
type(mpi_comm), parameter, public mpi_comm_undefined
used to indicate a communicator has not been initialized
type(mpi_grp_t), public mpi_world
subroutine, public nfft_write_info(nfft)
subroutine, public nfft_end(nfft)
subroutine, public nfft_init(nfft, nfft_options, N, dim, M, optimize)
subroutine, public nfft_copy_info(in, out)
subroutine, public nfft_precompute(nfft, X1, X2, X3)
subroutine, public nfft_guru_options(nfft, namespace)
The low level module to work with the PFFT library. http:
subroutine, public pfft_prepare_plan_r2c(plan, n, in, out, fft_sign, flags, mpi_comm)
Octopus subroutine to prepare a PFFT plan real to complex.
subroutine, public pfft_prepare_plan_c2c(plan, n, in, out, fft_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_c2r(plan, n, in, out, fft_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.
The low level module to work with the PNFFT library. http:
subroutine, public pnfft_copy_params(in, out)
subroutine, public pnfft_set_sp_nodes(pnfft, namespace, X)
subroutine, public pnfft_init_plan(pnfft, pnfft_options, comm, fs_n_global, fs_n, fs_istart, rs_n, rs_istart)
subroutine, public pnfft_write_info(pnfft)
subroutine, public pnfft_guru_options(pnfft, namespace)
subroutine, public pnfft_end(pnfft)
subroutine, public pnfft_init_procmesh(pnfft, mpi_grp, comm)
This module defines the unit system, used for input and output.
type(unit_t), public unit_megabytes
For large amounts of data (natural code units are bytes)
This is defined even when running serial.