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(finufft_t),
public :: finufft
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(finufft_t),
save :: finufft_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
354 integer,
optional,
intent(in) :: nthreads
356 integer :: ii, jj, fft_dim, idir, column_size, row_size, n3
357 integer :: n_1, n_2, n_3, nn_temp(3)
360 integer(int64) :: number_points, alloc_size
368 assert(fft_initialized)
372 if (
present(mpi_grp)) mpi_grp_ = mpi_grp
376 assert(this%howmany > 0)
381 if (nn(ii) <= 1)
exit
382 fft_dim = fft_dim + 1
385 if (fft_dim == 0)
then
386 message(1) =
"Internal error in fft_init: apparently, a 1x1x1 FFT is required."
394 nn_temp(1:fft_dim) = nn(1:fft_dim)
396 select case (library_)
399 if(any(optimize_parity(1:fft_dim) > 1))
then
400 message(1) =
"Internal error in fft_init: optimize_parity must be negative, 0, or 1."
405 nn_temp(ii) =
fft_size(nn(ii), (/2, 3, 5, 7/), optimize_parity(ii))
406 if (fft_optimize .and.
optimize(ii)) nn(ii) = nn_temp(ii)
410 assert(this%howmany == 1)
415 if (int(nn(ii)/2)*2 /= nn(ii) .and. (fft_optimize .and.
optimize(ii)))&
420 assert(this%howmany == 1)
424 if (int(nn(ii)/2)*2 /= nn(ii)) nn(ii) = nn(ii) + 1
427 if (fft_dim < 3)
then
433 if (fft_dim < 3 .and. library_ ==
fftlib_pfft)
then
438 if (any(optimize_parity(1:fft_dim) > 1))
then
439 message(1) =
"Internal error in fft_init: optimize_parity must be negative, 0, or 1."
445 if (fft_optimize .and.
optimize(ii)) nn(ii) = nn_temp(ii)
452 do ii = fft_max, 1, -1
454 if (all(nn(1:dim) == fft_array(ii)%rs_n_global(1:dim)) .and.
type == fft_array(ii)%type &
455 .and. library_ == fft_array(ii)%library .and. library_ /=
fftlib_nfft &
457 .and. this%howmany == fft_array(ii)%howmany &
458 .and. this%aligned_memory .eqv. fft_array(ii)%aligned_memory)
then
463 fft_refs(ii) = fft_refs(ii) + 1
464 if (
present(comm)) comm = fft_array(ii)%comm
474 message(1) =
"Not enough slots for FFTs."
475 message(2) =
"Please increase FFT_MAX in fft.F90 and recompile."
481 fft_array(jj)%slot = jj
482 fft_array(jj)%type =
type
483 fft_array(jj)%library = library_
484 fft_array(jj)%howmany = this%howmany
485 fft_array(jj)%rs_n_global(1:dim) = nn(1:dim)
486 fft_array(jj)%rs_n_global(dim+1:) = 1
487 nullify(fft_array(jj)%drs_data)
488 nullify(fft_array(jj)%zrs_data)
489 nullify(fft_array(jj)%fs_data)
491 fft_array(jj)%aligned_memory = this%aligned_memory
494 select case (library_)
501 ierror = pfft_create_procmesh_2d(mpi_grp_%comm%MPI_VAL, column_size, row_size, fft_array(jj)%comm%MPI_VAL)
503 if (ierror /= 0)
then
504 message(1) =
"The number of rows and columns in PFFT processor grid is not equal to "
505 message(2) =
"the number of processor in the MPI communicator."
506 message(3) =
"Please check it."
520 if (
present(comm)) comm = fft_array(jj)%comm
523 select case (library_)
526 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
527 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
528 fft_array(jj)%rs_istart = 1
529 fft_array(jj)%fs_istart = 1
531 if (this%aligned_memory)
then
533 fft_pack(fft_array(jj)%fs_n_global, this%howmany), &
534 fft_array(jj)%drs_data, fft_array(jj)%zrs_data, fft_array(jj)%fs_data)
538 assert(this%howmany == 1)
541 alloc_size, fft_array(jj)%fs_n_global, fft_array(jj)%rs_n, &
542 fft_array(jj)%fs_n, fft_array(jj)%rs_istart, fft_array(jj)%fs_istart)
549 n_1 = max(1, fft_array(jj)%rs_n(1))
550 n_2 = max(1, fft_array(jj)%rs_n(2))
551 n_3 = max(1, fft_array(jj)%rs_n(3))
553 n3 = ceiling(real(2*alloc_size)/real(n_1*n_2))
554 safe_allocate(fft_array(jj)%drs_data(1:n_1, 1:n_2, 1:n3, 1:1))
556 n3 = ceiling(real(alloc_size)/real(fft_array(jj)%rs_n(1)*fft_array(jj)%rs_n(2)))
557 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))
560 n_1 = max(1, fft_array(jj)%fs_n(1))
561 n_2 = max(1, fft_array(jj)%fs_n(2))
562 n_3 = max(1, fft_array(jj)%fs_n(3))
564 n3 = ceiling(real(alloc_size)/real(n_3*n_1))
565 safe_allocate(fft_array(jj)%fs_data(1:n_3, 1:n_1, 1:n3, 1:1))
569 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
570 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
571 fft_array(jj)%rs_istart = 1
572 fft_array(jj)%fs_istart = 1
575 fft_array(jj)%fs_n_global = fft_array(jj)%rs_n_global
576 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
577 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
578 fft_array(jj)%rs_istart = 1
579 fft_array(jj)%fs_istart = 1
582 fft_array(jj)%fs_n_global = fft_array(jj)%rs_n_global
583 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
584 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
585 fft_array(jj)%rs_istart = 1
586 fft_array(jj)%fs_istart = 1
593 select case (library_)
595 if (.not. this%aligned_memory)
then
596 call fftw_prepare_plan(fft_array(jj)%planf, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
597 type ==
fft_real, fftw_forward, fft_prepare_plan+fftw_unaligned)
598 call fftw_prepare_plan(fft_array(jj)%planb, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
599 type ==
fft_real, fftw_backward, fft_prepare_plan+fftw_unaligned)
602 call fftw_prepare_plan(fft_array(jj)%planf, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
603 type ==
fft_real, fftw_forward, fft_prepare_plan, &
604 din_=fft_array(jj)%drs_data, cout_=fft_array(jj)%fs_data)
605 call fftw_prepare_plan(fft_array(jj)%planb, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
606 type ==
fft_real, fftw_backward, fft_prepare_plan, &
607 din_=fft_array(jj)%drs_data, cout_=fft_array(jj)%fs_data)
609 call fftw_prepare_plan(fft_array(jj)%planf, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
610 type ==
fft_real, fftw_forward, fft_prepare_plan, &
611 cin_=fft_array(jj)%zrs_data, cout_=fft_array(jj)%fs_data)
612 call fftw_prepare_plan(fft_array(jj)%planb, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
613 type ==
fft_real, fftw_backward, fft_prepare_plan, &
614 cin_=fft_array(jj)%zrs_data, cout_=fft_array(jj)%fs_data)
620 call finufft_init(fft_array(jj)%finufft, finufft_options, fft_array(jj)%rs_n_global, &
621 fft_dim, fft_array(jj)%rs_n_global, nthreads=nthreads)
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
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
subroutine, public fft_init(this, nn, dim, type, library, optimize, optimize_parity, comm, mpi_grp, use_aligned, howmany, nthreads)
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).
Non-equispaced FFTs through the C interface of the FINUFFT library.
subroutine, public finufft_write_info(finufft)
subroutine, public finufft_read_options(finufft, namespace)
subroutine, public finufft_init(finufft, finufft_options, N, dim, M, nthreads)
subroutine, public finufft_end(finufft)
subroutine, public finufft_precompute(finufft, X1, X2, X3)
Hand the spatial nodes to FINUFFT.
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
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.