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 :: &
93 integer,
public,
parameter :: &
94 FFT_BATCH_PACKED = 1, &
97 integer,
parameter :: &
106 integer,
public ::
type
107 integer,
public :: library
114 integer,
public :: batch_axis
116 type(MPI_Comm) :: comm
117 integer :: rs_n_global(3)
118 integer :: fs_n_global(3)
121 integer :: rs_istart(1:3)
122 integer :: fs_istart(1:3)
125 integer,
public :: stride_rs(1:3)
126 integer,
public :: stride_fs(1:3)
135 real(real64),
contiguous,
pointer,
public :: drs_data(:,:,:,:)
136 complex(real64),
contiguous,
pointer,
public :: zrs_data(:,:,:,:)
137 complex(real64),
contiguous,
pointer,
public :: fs_data(:,:,:,:)
138 type(c_ptr) :: cuda_plan_fw
139 type(c_ptr) :: cuda_plan_bw
141 type(nfft_t),
public :: nfft
143 type(pnfft_t),
public :: pnfft
145 logical,
public :: aligned_memory
164 logical,
save,
public :: fft_initialized = .false.
165 integer,
save :: fft_refs(FFT_MAX)
166 type(fft_t),
save :: fft_array(FFT_MAX)
167 logical :: fft_optimize
168 integer,
save :: fft_prepare_plan
169 integer,
public :: fft_default_lib = -1
171 type(nfft_t),
save :: nfft_options
173 type(pnfft_t),
save :: pnfft_options
175 integer,
parameter :: &
190 integer :: ii, fft_default
191#if defined(HAVE_OPENMP) && defined(HAVE_FFTW3_THREADS)
253 call parse_variable(namespace,
'FFTPreparePlan', fftw_estimate, fft_prepare_plan)
276 call parse_variable(namespace,
'FFTLibrary', fft_default, fft_default_lib)
283#if ! defined(HAVE_CUDA)
284 call messages_write(
'You have selected the Accelerated FFT, but Octopus was compiled', new_line = .
true.)
289 call messages_write(
'You have selected the accelerated FFT, but acceleration is disabled.')
294#if defined(HAVE_OPENMP) && defined(HAVE_FFTW3_THREADS)
295 if (omp_get_max_threads() > 1)
then
300 iret = fftw_init_threads()
305 call fftw_plan_with_nthreads(omp_get_max_threads())
335#if defined(HAVE_OPENMP) && defined(HAVE_FFTW3_THREADS)
336 call fftw_cleanup_threads()
341 fft_initialized = .false.
347 subroutine fft_init(this, nn, dim, type, library, optimize, optimize_parity, comm, mpi_grp, use_aligned, &
349 type(
fft_t),
intent(inout) :: this
350 integer,
intent(inout) :: nn(3)
351 integer,
intent(in) :: dim
352 integer,
intent(in) ::
type
353 integer,
intent(in) :: library
355 integer,
intent(in) :: optimize_parity(3)
357 type(mpi_comm),
optional,
intent(out) :: comm
358 type(
mpi_grp_t),
optional,
intent(in) :: mpi_grp
359 logical,
optional,
intent(in) :: use_aligned
360 integer,
optional,
intent(in) :: howmany
361 integer,
optional,
intent(in) :: batch_axis
363 integer :: ii, jj, fft_dim, idir, column_size, row_size, n3
364 integer :: n_1, n_2, n_3, nn_temp(3)
367 integer(int64) :: number_points, alloc_size
375 assert(fft_initialized)
379 if (
present(mpi_grp)) mpi_grp_ = mpi_grp
383 assert(this%howmany > 0)
385 assert(this%batch_axis == 1 .or. this%batch_axis == 4)
390 if (nn(ii) <= 1)
exit
391 fft_dim = fft_dim + 1
394 if (fft_dim == 0)
then
395 message(1) =
"Internal error in fft_init: apparently, a 1x1x1 FFT is required."
407 if (this%batch_axis /= 1 .and. library_ ==
fftlib_pfft)
then
408 message(1) =
"The batch-last FFT layout (batch_axis = 4) is not supported by the PFFT library."
412 nn_temp(1:fft_dim) = nn(1:fft_dim)
414 select case (library_)
417 if(any(optimize_parity(1:fft_dim) > 1))
then
418 message(1) =
"Internal error in fft_init: optimize_parity must be negative, 0, or 1."
423 nn_temp(ii) =
fft_size(nn(ii), (/2, 3, 5, 7/), optimize_parity(ii))
424 if (fft_optimize .and.
optimize(ii)) nn(ii) = nn_temp(ii)
428 assert(this%howmany == 1)
433 if (int(nn(ii)/2)*2 /= nn(ii) .and. (fft_optimize .and.
optimize(ii)))&
438 assert(this%howmany == 1)
442 if (int(nn(ii)/2)*2 /= nn(ii)) nn(ii) = nn(ii) + 1
445 if (fft_dim < 3)
then
451 if (fft_dim < 3 .and. library_ ==
fftlib_pfft)
then
456 if (any(optimize_parity(1:fft_dim) > 1))
then
457 message(1) =
"Internal error in fft_init: optimize_parity must be negative, 0, or 1."
463 if (fft_optimize .and.
optimize(ii)) nn(ii) = nn_temp(ii)
470 do ii = fft_max, 1, -1
472 if (all(nn(1:dim) == fft_array(ii)%rs_n_global(1:dim)) .and.
type == fft_array(ii)%type &
473 .and. library_ == fft_array(ii)%library .and. library_ /=
fftlib_nfft &
475 .and. this%howmany == fft_array(ii)%howmany &
476 .and. this%batch_axis == fft_array(ii)%batch_axis &
477 .and. this%aligned_memory .eqv. fft_array(ii)%aligned_memory)
then
482 fft_refs(ii) = fft_refs(ii) + 1
483 if (
present(comm)) comm = fft_array(ii)%comm
493 message(1) =
"Not enough slots for FFTs."
494 message(2) =
"Please increase FFT_MAX in fft.F90 and recompile."
500 fft_array(jj)%slot = jj
501 fft_array(jj)%type =
type
502 fft_array(jj)%library = library_
503 fft_array(jj)%howmany = this%howmany
504 fft_array(jj)%batch_axis = this%batch_axis
505 fft_array(jj)%rs_n_global(1:dim) = nn(1:dim)
506 fft_array(jj)%rs_n_global(dim+1:) = 1
507 nullify(fft_array(jj)%drs_data)
508 nullify(fft_array(jj)%zrs_data)
509 nullify(fft_array(jj)%fs_data)
511 fft_array(jj)%aligned_memory = this%aligned_memory
514 select case (library_)
521 ierror = pfft_create_procmesh_2d(mpi_grp_%comm%MPI_VAL, column_size, row_size, fft_array(jj)%comm%MPI_VAL)
523 if (ierror /= 0)
then
524 message(1) =
"The number of rows and columns in PFFT processor grid is not equal to "
525 message(2) =
"the number of processor in the MPI communicator."
526 message(3) =
"Please check it."
540 if (
present(comm)) comm = fft_array(jj)%comm
543 select case (library_)
546 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
547 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
548 fft_array(jj)%rs_istart = 1
549 fft_array(jj)%fs_istart = 1
551 if (this%aligned_memory)
then
554 fft_pack(this%batch_axis, fft_array(jj)%fs_n_global, this%howmany), &
555 fft_array(jj)%drs_data, fft_array(jj)%zrs_data, fft_array(jj)%fs_data)
561 alloc_size, fft_array(jj)%fs_n_global, fft_array(jj)%rs_n, &
562 fft_array(jj)%fs_n, fft_array(jj)%rs_istart, fft_array(jj)%fs_istart, this%howmany)
570 n_1 = max(1, fft_array(jj)%rs_n(1))
571 n_2 = max(1, fft_array(jj)%rs_n(2))
572 n_3 = max(1, fft_array(jj)%rs_n(3))
574 n3 = ceiling(real(2*alloc_size)/real(this%howmany*n_1*n_2))
575 safe_allocate(fft_array(jj)%drs_data(1:this%howmany, 1:n_1, 1:n_2, 1:n3))
577 n3 = ceiling(real(alloc_size)/real(this%howmany*fft_array(jj)%rs_n(1)*fft_array(jj)%rs_n(2)))
578 safe_allocate(fft_array(jj)%zrs_data(1:this%howmany, 1:fft_array(jj)%rs_n(1), 1:fft_array(jj)%rs_n(2), 1:n3))
581 n_1 = max(1, fft_array(jj)%fs_n(1))
582 n_2 = max(1, fft_array(jj)%fs_n(2))
583 n_3 = max(1, fft_array(jj)%fs_n(3))
585 n3 = ceiling(real(alloc_size)/real(this%howmany*n_3*n_1))
586 safe_allocate(fft_array(jj)%fs_data(1:this%howmany, 1:n_3, 1:n_1, 1:n3))
590 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
591 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
592 fft_array(jj)%rs_istart = 1
593 fft_array(jj)%fs_istart = 1
596 fft_array(jj)%fs_n_global = fft_array(jj)%rs_n_global
597 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
598 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
599 fft_array(jj)%rs_istart = 1
600 fft_array(jj)%fs_istart = 1
603 fft_array(jj)%fs_n_global = fft_array(jj)%rs_n_global
604 fft_array(jj)%rs_n = fft_array(jj)%rs_n_global
605 fft_array(jj)%fs_n = fft_array(jj)%fs_n_global
606 fft_array(jj)%rs_istart = 1
607 fft_array(jj)%fs_istart = 1
614 select case (library_)
616 if (.not. this%aligned_memory)
then
617 call fftw_prepare_plan(fft_array(jj)%planf, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
618 this%batch_axis,
type ==
fft_real, fftw_forward, fft_prepare_plan+fftw_unaligned)
619 call fftw_prepare_plan(fft_array(jj)%planb, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
620 this%batch_axis,
type ==
fft_real, fftw_backward, fft_prepare_plan+fftw_unaligned)
623 call fftw_prepare_plan(fft_array(jj)%planf, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
624 this%batch_axis,
type ==
fft_real, fftw_forward, fft_prepare_plan, &
625 din_=fft_array(jj)%drs_data, cout_=fft_array(jj)%fs_data)
626 call fftw_prepare_plan(fft_array(jj)%planb, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
627 this%batch_axis,
type ==
fft_real, fftw_backward, fft_prepare_plan, &
628 din_=fft_array(jj)%drs_data, cout_=fft_array(jj)%fs_data)
630 call fftw_prepare_plan(fft_array(jj)%planf, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
631 this%batch_axis,
type ==
fft_real, fftw_forward, fft_prepare_plan, &
632 cin_=fft_array(jj)%zrs_data, cout_=fft_array(jj)%fs_data)
633 call fftw_prepare_plan(fft_array(jj)%planb, fft_dim, fft_array(jj)%rs_n_global, this%howmany, &
634 this%batch_axis,
type ==
fft_real, fftw_backward, fft_prepare_plan, &
635 cin_=fft_array(jj)%zrs_data, cout_=fft_array(jj)%fs_data)
642 call nfft_init(fft_array(jj)%nfft, nfft_options, fft_array(jj)%rs_n_global, &
649 fft_array(jj)%fs_data, fftw_forward, fft_prepare_plan, fft_array(jj)%comm%MPI_VAL, this%howmany)
651 fft_array(jj)%drs_data, fftw_backward, fft_prepare_plan, fft_array(jj)%comm%MPI_VAL, this%howmany)
654 fft_array(jj)%fs_data, fftw_forward, fft_prepare_plan, fft_array(jj)%comm%MPI_VAL, this%howmany)
656 fft_array(jj)%zrs_data, fftw_backward, fft_prepare_plan, fft_array(jj)%comm%MPI_VAL, this%howmany)
678 call pnfft_init_plan(fft_array(jj)%pnfft, pnfft_options, comm, fft_array(jj)%fs_n_global, &
679 fft_array(jj)%fs_n, fft_array(jj)%fs_istart, fft_array(jj)%rs_n, fft_array(jj)%rs_istart)
683 fft_array(jj)%stride_rs(1) = 1
684 fft_array(jj)%stride_fs(1) = 1
686 fft_array(jj)%stride_rs(ii) = fft_array(jj)%stride_rs(ii - 1)*fft_array(jj)%rs_n(ii - 1)
687 fft_array(jj)%stride_fs(ii) = fft_array(jj)%stride_fs(ii - 1)*fft_array(jj)%fs_n(ii - 1)
692 call cuda_fft_plan_many(fft_array(jj)%cuda_plan_fw, this%howmany, this%batch_axis, &
693 fft_array(jj)%rs_n_global(3), fft_array(jj)%rs_n_global(2), fft_array(jj)%rs_n_global(1),
cufft_d2z, &
695 call cuda_fft_plan_many(fft_array(jj)%cuda_plan_bw, this%howmany, this%batch_axis, &
696 fft_array(jj)%rs_n_global(3), fft_array(jj)%rs_n_global(2), fft_array(jj)%rs_n_global(1),
cufft_z2d, &
699 call cuda_fft_plan_many(fft_array(jj)%cuda_plan_fw, this%howmany, this%batch_axis, &
700 fft_array(jj)%rs_n_global(3), fft_array(jj)%rs_n_global(2), fft_array(jj)%rs_n_global(1),
cufft_z2z, &
702 call cuda_fft_plan_many(fft_array(jj)%cuda_plan_bw, this%howmany, this%batch_axis, &
703 fft_array(jj)%rs_n_global(3), fft_array(jj)%rs_n_global(2), fft_array(jj)%rs_n_global(1),
cufft_z2z, &
723 number_points = number_points * fft_array(jj)%rs_n_global(idir)
732 if (any(nn(1:fft_dim) /= nn_temp(1:fft_dim)))
then
734 call messages_write(
' Inefficient FFT grid. A better grid would be: ')
742 select case (library_)
744 write(
message(1),
'(a)')
"Info: FFT library = PFFT"
745 write(
message(2),
'(a)')
"Info: PFFT processor grid"
746 write(
message(3),
'(a, i9)')
" No. of processors = ", mpi_grp_%size
747 write(
message(4),
'(a, i9)')
" No. of columns in the proc. grid = ", column_size
748 write(
message(5),
'(a, i9)')
" No. of rows in the proc. grid = ", row_size
749 write(
message(6),
'(a, i9)')
" The size of integer is = ", c_intptr_t
774 type(
fft_t),
intent(inout) :: this
778 real(real64),
intent(in) :: xx(:,:)
779 integer,
optional,
intent(in) :: nn(:)
785 assert(
size(xx,2) == 3)
788 select case (fft_array(slot)%library)
795 xx(1:nn(1),1), xx(1:nn(2),2), xx(1:nn(3),3))
816 type(
fft_t),
intent(inout) :: this
824 message(1) =
"Trying to deallocate FFT that has not been allocated."
827 if (fft_refs(ii) > 1)
then
828 fft_refs(ii) = fft_refs(ii) - 1
830 select case (fft_array(ii)%library)
832 call fftw_destroy_plan(fft_array(ii)%planf)
833 call fftw_destroy_plan(fft_array(ii)%planb)
835 if (this%aligned_memory)
then
837 fft_array(ii)%drs_data, fft_array(ii)%zrs_data, fft_array(ii)%fs_data)
842 call pfft_destroy_plan(fft_array(ii)%planf)
843 call pfft_destroy_plan(fft_array(ii)%planb)
845 safe_deallocate_p(fft_array(ii)%drs_data)
846 safe_deallocate_p(fft_array(ii)%zrs_data)
847 safe_deallocate_p(fft_array(ii)%fs_data)
851 call cuda_fft_destroy(fft_array(ii)%cuda_plan_fw)
852 call cuda_fft_destroy(fft_array(ii)%cuda_plan_bw)
874 type(
fft_t),
intent(in) :: fft_i
875 type(
fft_t),
intent(inout) :: fft_o
879 if (fft_o%slot > 0)
then
882 assert(fft_i%slot >= 1.and.fft_i%slot <= fft_max)
883 assert(fft_refs(fft_i%slot) > 0)
886 fft_refs(fft_i%slot) = fft_refs(fft_i%slot) + 1
895 function fft_pack(batch_axis, dims3, howmany)
result(dims4)
896 integer,
intent(in) :: batch_axis
897 integer,
intent(in) :: dims3(3)
898 integer,
intent(in) :: howmany
901 if (batch_axis == 1)
then
903 dims4(2:4) = dims3(1:3)
904 else if (batch_axis == 4)
then
905 dims4(1:3) = dims3(1:3)
913 subroutine fft_get_dims(fft, rs_n_global, fs_n_global, rs_n, fs_n, rs_istart, fs_istart)
914 type(
fft_t),
intent(in) :: fft
915 integer,
intent(out) :: rs_n_global(1:3)
916 integer,
intent(out) :: fs_n_global(1:3)
917 integer,
intent(out) :: rs_n(1:3)
918 integer,
intent(out) :: fs_n(1:3)
919 integer,
intent(out) :: rs_istart(1:3)
920 integer,
intent(out) :: fs_istart(1:3)
927 rs_n_global(1:3) = fft_array(slot)%rs_n_global(1:3)
928 fs_n_global(1:3) = fft_array(slot)%fs_n_global(1:3)
929 rs_n(1:3) = fft_array(slot)%rs_n(1:3)
930 fs_n(1:3) = fft_array(slot)%fs_n(1:3)
931 rs_istart(1:3) = fft_array(slot)%rs_istart(1:3)
932 fs_istart(1:3) = fft_array(slot)%fs_istart(1:3)
939 pure function pad_feq(ii, nn, mode)
940 integer,
intent(in) :: ii,nn
941 logical,
intent(in) ::
mode
947 if (ii <= nn/2 + 1)
then
964 integer function fft_size(size, factors, parity)
965 integer,
intent(in) :: size
966 integer,
intent(in) :: factors(:)
967 integer,
intent(in) :: parity
971 integer,
allocatable :: exponents(:)
975 nfactors = ubound(factors, dim = 1)
977 safe_allocate(exponents(1:nfactors))
982 if (nondiv == 1 .and. mod(
fft_size, 2) == parity)
exit
986 safe_deallocate_a(exponents)
993 subroutine get_exponents(num, nfactors, factors, exponents, nondiv)
994 integer,
intent(in) :: num
995 integer,
intent(in) :: nfactors
996 integer,
intent(in) :: factors(:)
997 integer,
intent(out) :: exponents(:)
998 integer,
intent(out) :: nondiv
1005 do ifactor = 1, nfactors
1006 exponents(ifactor) = 0
1008 if (mod(nondiv, factors(ifactor)) /= 0)
exit
1009 nondiv = nondiv/factors(ifactor)
1010 exponents(ifactor) = exponents(ifactor) + 1
1021 type(
fft_t),
intent(in) :: fft
1023 real(real64) :: fullsize
1027 fullsize = real(fft%howmany, real64)*product(real(fft%fs_n(1:3), real64))
1035 pure subroutine fft_gg_transform(gg_in, temp, periodic_dim, latt, qq, gg, modg2)
1036 integer,
intent(in) :: gg_in(:)
1037 real(real64),
intent(in) :: temp(:)
1038 integer,
intent(in) :: periodic_dim
1040 real(real64),
intent(in) :: qq(:)
1041 real(real64),
intent(out) :: gg(:)
1042 real(real64),
intent(out) :: modg2
1046 gg(1:3) = real(gg_in(1:3), real64)
1047 gg(1:periodic_dim) = gg(1:periodic_dim) + qq(1:periodic_dim)
1048 gg(1:3) = gg(1:3) * temp(1:3)
1049 gg(1:3) = matmul(latt%klattice_primitive(1:3,1:3),gg(1:3))
1050 modg2 = sum(gg(1:3)**2)
1059 type(
fft_t),
intent(in) :: fft
1062 scaling_factor =
m_one
1064 select case (fft_array(fft%slot)%library)
1067 scaling_factor =
m_one/real(fft_array(fft%slot)%rs_n_global(1), real64)
1068 scaling_factor = scaling_factor/real(fft_array(fft%slot)%rs_n_global(2), real64)
1069 scaling_factor = scaling_factor/real(fft_array(fft%slot)%rs_n_global(3), real64)
1080 real(real64) function
fft_get_ecut_from_box(box_dim, fs_istart, latt, gspacing, periodic_dim, qq) result(ecut)
1081 integer,
intent(in) :: box_dim(:)
1082 integer,
intent(in) :: fs_istart(:)
1084 real(real64),
intent(in) :: gspacing(:)
1085 integer,
intent(in) :: periodic_dim
1086 real(real64),
intent(in) :: qq(:)
1088 integer :: lx, ix, iy, iz, idir, idir2, idir3
1089 real(real64) :: dminsq, gg(3), modg2
1090 integer :: box_dim_(3), ixx(3)
1091 integer :: ming(3), maxg(3)
1095 assert(periodic_dim > 0)
1097 box_dim_(1:periodic_dim) = box_dim(1:periodic_dim)
1098 if (periodic_dim < 3) box_dim_(periodic_dim+1:3) = 1
1103 do idir = 1, periodic_dim
1104 do lx = 1, box_dim(idir)
1105 ix = fs_istart(idir) + lx - 1
1107 ming(idir) = min(ming(idir), ixx(idir))
1108 maxg(idir) = max(maxg(idir), ixx(idir))
1110 maxg(idir) = min(abs(ming(idir)), maxg(idir))
1115 do idir = 1, periodic_dim
1116 idir2 = mod(idir, 3)+1
1117 idir3 = mod(idir+1, 3)+1
1120 ixx(idir) = -maxg(idir)
1121 do iy = -maxg(idir2), maxg(idir2)
1123 do iz = -maxg(idir3), maxg(idir3)
1126 dminsq = min(dminsq, sum(gg(1:periodic_dim)**2))
1130 ixx(idir) = maxg(idir)
1131 do iy = -maxg(idir2), maxg(idir2)
1133 do iz = -maxg(idir3), maxg(idir3)
1136 dminsq = min(dminsq, sum(gg(1:periodic_dim)**2))
1147#include "fft_inc.F90"
1150#include "complex.F90"
1151#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
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 function, dimension(4) fft_pack(batch_axis, dims3, howmany)
Build a rank-4 dimension array from the three spatial dimensions and the batch size,...
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)
integer, parameter cufft_r2c
subroutine zfft_forward_1d(fft, in, out)
subroutine, public fft_init(this, nn, dim, type, library, optimize, optimize_parity, comm, mpi_grp, use_aligned, howmany, batch_axis)
integer, parameter, public fft_batch_unpacked
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_prepare_plan(plan, dim, n, howmany, batch_axis, is_real, sign, flags, din_, cin_, cout_)
subroutine, public fftw_get_dims(rs_n, is_real, fs_n)
subroutine, public fftw_alloc_memory(rs_dims, is_real, fs_dims, drs_data, zrs_data, fs_data)
Allocate the FFTW work buffers. The rank-4 dimension arrays (which already carry the batch axis at th...
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_c2c(plan, n, in, out, fft_sign, flags, mpi_comm, howmany)
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, howmany)
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, fft_sign, flags, mpi_comm, howmany)
Octopus subroutine to prepare a PFFT plan real to complex.
subroutine, public pfft_prepare_plan_c2r(plan, n, in, out, fft_sign, flags, mpi_comm, howmany)
Octopus subroutine to prepare a PFFT plan real to complex.
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.