CP2K 2.4 (Revision 12889)
Classes | Functions | Variables

fft_tools Namespace Reference

Classes

struct  fft_scratch_sizes
struct  fft_scratch_type
struct  fft_scratch_pool_type
interface  fft3d

Functions

subroutine, public init_fft (fftlib, alltoall, fftsg_sizes, pool_limit, wisdom_file, plan_style, error)
subroutine, public finalize_fft (para_env, error)
 does whatever is needed to finalize the current fft setup
subroutine, public fft_radix_operations (radix_in, radix_out, operation)
 Determine the allowed lengths of FFT's '''.
subroutine fft3d_s (fsign, n, zin, zout, scale, status, debug)
 Calls the 3D-FFT function from the initialized library.
subroutine fft3d_ps (fsign, n, cin, gin, gs_group, rs_group, yzp, nyzray, bo, scale, status, debug)
subroutine fft3d_pb (fsign, n, zin, gin, group, bo, scale, status, debug)
subroutine x_to_yz (sb, group, my_pos, p2p, yzp, nray, bo, tb, fft_scratch, error)
subroutine yz_to_x (tb, group, my_pos, p2p, yzp, nray, bo, sb, fft_scratch, error)
subroutine yz_to_xz (sb, group, dims, my_pos, p2p, yzp, nray, bo, tb, fft_scratch, error)
subroutine xz_to_yz (sb, group, dims, my_pos, p2p, yzp, nray, bo, tb, fft_scratch, error)
subroutine cube_transpose_1 (cin, group, boin, boout, sout, fft_scratch, error)
subroutine cube_transpose_2 (cin, group, boin, boout, sout, fft_scratch, error)
subroutine cube_transpose_3 (cin, group, boin, boout, sout, fft_scratch, error)
subroutine cube_transpose_4 (cin, group, boin, boout, sout, fft_scratch, error)
subroutine cube_transpose_5 (cin, group, boin, boout, sout, fft_scratch, error)
subroutine cube_transpose_6 (cin, group, boin, boout, sout, fft_scratch, error)
subroutine init_fft_scratch_pool (error)
subroutine deallocate_fft_scratch_type (fft_scratch, error)
subroutine release_fft_scratch_pool (error)
subroutine resize_fft_scratch_pool (error)
subroutine get_fft_scratch (fft_scratch, tf_type, n, fft_sizes, error)
subroutine release_fft_scratch (fft_scratch, error)
subroutine sparse_alltoall (rs, scount, sdispl, rq, rcount, rdispl, group)
subroutine is_equal (fft_size_1, fft_size_2, equal)
 test data structures for equality. It is assumed that if they are different for one mpi task they are different for all (]

Variables

CHARACTER(len=*), parameter,
private 
moduleN = 'fft_tools'
INTEGER, save init_fft_pool = 0
INTEGER, save tick_fft_pool = 0
INTEGER, save fft_pool_scratch_limit = 15
TYPE(fft_scratch_pool_type),
pointer, save 
fft_scratch_first
INTEGER, parameter, public FWFFT = +1
INTEGER, parameter, public BWFFT = -1
INTEGER, parameter, public FFT_RADIX_CLOSEST = 493
INTEGER, parameter, public FFT_RADIX_NEXT = 494
INTEGER, parameter, public FFT_RADIX_ALLOWED = 495
INTEGER, parameter, public FFT_RADIX_DISALLOWED = 496
INTEGER, parameter, public FFT_RADIX_NEXT_ODD = 497
REAL(KIND=dp), parameter ratio_sparse_alltoall = 0.5_dp
INTEGER, save fft_type = 0
LOGICAL, save alltoall_sgl = .FALSE.
LOGICAL, save use_fftsg_sizes = .TRUE.
INTEGER, save fft_plan_style = 1

Detailed Description

History
JGH (30-Nov-2000): ESSL FFT Library added JGH (05-Jan-2001): Added SGI library FFT JGH (14-Jan-2001): Added parallel 3d FFT JGH (10-Feb-2006): New interface type JGH (31-Mar-2008): Remove local allocates and reshapes (performance) Possible problems can be related with setting arrays not to zero Some interfaces could be further simplified by avoiding an initial copy. However, this assumes contiguous arrays IAB (15-Oct-2008): Moved mp_cart_sub calls out of cube_tranpose_* and into fft_scratch type, reducing number of calls dramatically IAB (05-Dec-2008): Moved all other non-essential MPI calls into scratch type IAB (09-Jan-2009): Added fft_plan_type to store FFT data, including cached FFTW plans IAB (13-Feb-2009): Extended plan caching to serial 3D FFT (fft3d_s) IAB (09-Oct-2009): Added OpenMP directives to parallel 3D FFT (c) The Numerical Algorithms Group (NAG) Ltd, 2008-2009 on behalf of the HECToR project
Author:
JGH

Function Documentation

subroutine fft_tools::cube_transpose_1 ( COMPLEX(KIND=dp),dimension(:, :),intent(in)  cin,
INTEGER,intent(in)  group,
INTEGER,dimension(:, :, 0:),intent(in)  boin,
INTEGER,dimension(:, :, 0:),intent(in)  boout,
COMPLEX(KIND=dp),dimension(:, :),intent(out)  sout,
TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type)  error 
) [private]
History
none
Author:
JGH (20-Jan-2001)

Definition at line 1972 of file fft_tools.f90.

References timings::timeset().

Referenced by fft3d_pb(), and fft3d_ps().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::cube_transpose_2 ( COMPLEX(KIND=dp),dimension(:, :),intent(in)  cin,
INTEGER,intent(in)  group,
INTEGER,dimension(:, :, 0:),intent(in)  boin,
INTEGER,dimension(:, :, 0:),intent(in)  boout,
COMPLEX(KIND=dp),dimension(:, :),intent(out)  sout,
TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type)  error 
) [private]

Definition at line 2059 of file fft_tools.f90.

References timings::timeset().

Referenced by fft3d_pb(), and fft3d_ps().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::cube_transpose_3 ( COMPLEX(KIND=dp),dimension(:, :),intent(in)  cin,
INTEGER,intent(in)  group,
INTEGER,dimension(:, :, 0:),intent(in)  boin,
INTEGER,dimension(:, :, 0:),intent(in)  boout,
COMPLEX(KIND=dp),dimension(:, :),intent(out)  sout,
TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type)  error 
) [private]

Definition at line 2144 of file fft_tools.f90.

References timings::timeset().

Referenced by fft3d_pb().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::cube_transpose_4 ( COMPLEX(KIND=dp),dimension(:, :),intent(in)  cin,
INTEGER,intent(in)  group,
INTEGER,dimension(:, :, 0:),intent(in)  boin,
INTEGER,dimension(:, :, 0:),intent(in)  boout,
COMPLEX(KIND=dp),dimension(:, :),intent(out)  sout,
TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type)  error 
) [private]

Definition at line 2246 of file fft_tools.f90.

References timings::timeset().

Referenced by fft3d_pb().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::cube_transpose_5 ( COMPLEX(KIND=dp),dimension(:, :),intent(in)  cin,
INTEGER,intent(in)  group,
INTEGER,dimension(:, :, 0:),intent(in)  boin,
INTEGER,dimension(:, :, 0:),intent(in)  boout,
COMPLEX(KIND=dp),dimension(:, :),intent(out)  sout,
TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type)  error 
) [private]

Definition at line 2344 of file fft_tools.f90.

References timings::timeset().

Referenced by fft3d_pb().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::cube_transpose_6 ( COMPLEX(KIND=dp),dimension(:, :),intent(in)  cin,
INTEGER,intent(in)  group,
INTEGER,dimension(:, :, 0:),intent(in)  boin,
INTEGER,dimension(:, :, 0:),intent(in)  boout,
COMPLEX(KIND=dp),dimension(:, :),intent(out)  sout,
TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type)  error 
) [private]

Definition at line 2437 of file fft_tools.f90.

References timings::timeset().

Referenced by fft3d_pb().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::deallocate_fft_scratch_type ( TYPE(fft_scratch_type),intent(inout)  fft_scratch,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Definition at line 2593 of file fft_tools.f90.

References fft_destroy_plan(), message_passing::mp_comm_free(), and message_passing::mp_comm_null.

Referenced by release_fft_scratch_pool(), and resize_fft_scratch_pool().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::fft3d_pb ( INTEGER,intent(in)  fsign,
INTEGER,dimension(3),intent(in)  n,
COMPLEX(KIND=dp),dimension(:, :, :),intent(inout)  zin,
COMPLEX(KIND=dp),dimension(:, :),intent(inout)  gin,
INTEGER,intent(in)  group,
INTEGER,dimension(:, :, 0:, :),intent(in)  bo,
REAL(KIND=dp),intent(in),optional  scale,
INTEGER,intent(out),optional  status,
LOGICAL,intent(in),optional  debug 
) [private]
subroutine fft_tools::fft3d_ps ( INTEGER,intent(in)  fsign,
INTEGER,dimension(:),intent(in)  n,
COMPLEX(KIND=dp),dimension(:, :, :),intent(inout)  cin,
COMPLEX(KIND=dp),dimension(:, :),intent(inout)  gin,
INTEGER,intent(in)  gs_group,
INTEGER,intent(in)  rs_group,
INTEGER,dimension(:, :, 0:),intent(in)  yzp,
INTEGER,dimension(0:),intent(in)  nyzray,
INTEGER,dimension(:, :, 0:, :),intent(in)  bo,
REAL(KIND=dp),intent(in),optional  scale,
INTEGER,intent(out),optional  status,
LOGICAL,intent(in),optional  debug 
) [private]
subroutine fft_tools::fft3d_s ( INTEGER,intent(in)  fsign,
INTEGER,dimension(:),intent(inout)  n,
COMPLEX(KIND=dp),dimension(:, :, :),intent(inout)  zin,
COMPLEX(KIND=dp),dimension(:, :, :),intent(inout),optional,target  zout,
REAL(KIND=dp),intent(in),optional  scale,
INTEGER,intent(out),optional  status,
LOGICAL,intent(in),optional  debug 
) [private]

Calls the 3D-FFT function from the initialized library.

History
none
Author:
JGH

Definition at line 357 of file fft_tools.f90.

References fft_3d(), FWFFT, get_fft_scratch(), release_fft_scratch(), and timings::timeset().

Here is the call graph for this function:

subroutine,public fft_tools::fft_radix_operations ( INTEGER,intent(in)  radix_in,
INTEGER,intent(out)  radix_out,
INTEGER,intent(in)  operation 
)

Determine the allowed lengths of FFT's '''.

History
new library structure (JGH)
Author:
Ari Seitsonen

Definition at line 264 of file fft_tools.f90.

References fft_get_lengths(), FFT_RADIX_ALLOWED, FFT_RADIX_CLOSEST, FFT_RADIX_DISALLOWED, FFT_RADIX_NEXT, FFT_RADIX_NEXT_ODD, fft_type, and use_fftsg_sizes.

Here is the call graph for this function:

subroutine,public fft_tools::finalize_fft ( TYPE(cp_para_env_type),pointer  para_env,
TYPE(cp_error_type),intent(inout)  error 
)

does whatever is needed to finalize the current fft setup

History
10.2007 created [Joost VandeVondele]

Definition at line 229 of file fft_tools.f90.

References fft_type, fftw_export_wisdom_to_file(), cp_files::get_unit_number(), and release_fft_scratch_pool().

Here is the call graph for this function:

subroutine fft_tools::get_fft_scratch ( TYPE(fft_scratch_type),pointer  fft_scratch,
INTEGER,intent(in)  tf_type,
INTEGER,dimension(:),intent(in)  n,
TYPE(fft_scratch_sizes),intent(in),optional  fft_sizes,
TYPE(cp_error_type),intent(inout)  error 
) [private]
subroutine,public fft_tools::init_fft ( CHARACTER(LEN=*),intent(in)  fftlib,
LOGICAL,intent(in)  alltoall,
LOGICAL,intent(in)  fftsg_sizes,
INTEGER,intent(in)  pool_limit,
CHARACTER(LEN=*),intent(in)  wisdom_file,
INTEGER,intent(in)  plan_style,
TYPE(cp_error_type),intent(inout)  error 
)
subroutine fft_tools::init_fft_scratch_pool ( TYPE(cp_error_type),intent(inout)  error) [private]

Definition at line 2525 of file fft_tools.f90.

References fft_scratch_first, init_fft_pool, and release_fft_scratch_pool().

Referenced by init_fft().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::is_equal ( TYPE(fft_scratch_sizes)  fft_size_1,
TYPE(fft_scratch_sizes)  fft_size_2,
LOGICAL  equal 
) [private]

test data structures for equality. It is assumed that if they are different for one mpi task they are different for all (]

Definition at line 3402 of file fft_tools.f90.

Referenced by get_fft_scratch().

Here is the caller graph for this function:

subroutine fft_tools::release_fft_scratch ( TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Definition at line 3317 of file fft_tools.f90.

References fft_scratch_first.

Referenced by fft3d_pb(), fft3d_ps(), and fft3d_s().

Here is the caller graph for this function:

subroutine fft_tools::release_fft_scratch_pool ( TYPE(cp_error_type),intent(inout)  error) [private]

Definition at line 2777 of file fft_tools.f90.

References deallocate_fft_scratch_type(), fft_scratch_first, and init_fft_pool.

Referenced by finalize_fft(), init_fft(), and init_fft_scratch_pool().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::resize_fft_scratch_pool ( TYPE(cp_error_type),intent(inout)  error) [private]

Definition at line 2815 of file fft_tools.f90.

References deallocate_fft_scratch_type(), fft_pool_scratch_limit, and fft_scratch_first.

Referenced by get_fft_scratch().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::sparse_alltoall ( COMPLEX(KIND=dp),dimension(:),pointer  rs,
INTEGER,dimension(:),pointer  scount,
INTEGER,dimension(:),pointer  sdispl,
COMPLEX(KIND=dp),dimension(:),pointer  rq,
INTEGER,dimension(:),pointer  rcount,
INTEGER,dimension(:),pointer  rdispl,
INTEGER,intent(in)  group 
) [private]

Definition at line 3352 of file fft_tools.f90.

References message_passing::mp_sync().

Referenced by xz_to_yz(), and yz_to_xz().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::x_to_yz ( COMPLEX(KIND=dp),dimension(:, :),intent(in)  sb,
INTEGER,intent(in)  group,
INTEGER,intent(in)  my_pos,
INTEGER,dimension(0:),intent(in)  p2p,
INTEGER,dimension(:, :, 0:),intent(in)  yzp,
INTEGER,dimension(0:),intent(in)  nray,
INTEGER,dimension(:, :, 0:),intent(in)  bo,
COMPLEX(KIND=dp),dimension(:, :, :),intent(inout)  tb,
TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type)  error 
) [private]
History
15. Feb. 2006 : single precision all_to_all
Author:
JGH (14-Jan-2001)

Definition at line 1369 of file fft_tools.f90.

References alltoall_sgl, and timings::timeset().

Referenced by fft3d_ps().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::xz_to_yz ( COMPLEX(KIND=dp),dimension(:, :),intent(in)  sb,
INTEGER,intent(in)  group,
INTEGER,dimension(2),intent(in)  dims,
INTEGER,intent(in)  my_pos,
INTEGER,dimension(0:),intent(in)  p2p,
INTEGER,dimension(:, :, 0:),intent(in)  yzp,
INTEGER,dimension(0:),intent(in)  nray,
INTEGER,dimension(:, :, 0:),intent(in)  bo,
COMPLEX(KIND=dp),dimension(:, :),intent(inout)  tb,
TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type)  error 
) [private]
History
15. Feb. 2006 : single precision all_to_all
Author:
JGH (19-Jan-2001)

Definition at line 1780 of file fft_tools.f90.

References alltoall_sgl, ratio_sparse_alltoall, sparse_alltoall(), and timings::timeset().

Referenced by fft3d_ps().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::yz_to_x ( COMPLEX(KIND=dp),dimension(:, :, :),intent(in)  tb,
INTEGER,intent(in)  group,
INTEGER,intent(in)  my_pos,
INTEGER,dimension(0:),intent(in)  p2p,
INTEGER,dimension(:, :, 0:),intent(in)  yzp,
INTEGER,dimension(0:),intent(in)  nray,
INTEGER,dimension(:, :, 0:),intent(in)  bo,
COMPLEX(KIND=dp),dimension(:, :),intent(inout)  sb,
TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type)  error 
) [private]
History
15. Feb. 2006 : single precision all_to_all
Author:
JGH (14-Jan-2001)

Definition at line 1473 of file fft_tools.f90.

References alltoall_sgl, and timings::timeset().

Referenced by fft3d_ps().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine fft_tools::yz_to_xz ( COMPLEX(KIND=dp),dimension(:, :),intent(in)  sb,
INTEGER,intent(in)  group,
INTEGER,dimension(2),intent(in)  dims,
INTEGER,intent(in)  my_pos,
INTEGER,dimension(0:),intent(in)  p2p,
INTEGER,dimension(:, :, 0:),intent(in)  yzp,
INTEGER,dimension(0:),intent(in)  nray,
INTEGER,dimension(:, :, 0:),intent(in)  bo,
COMPLEX(KIND=dp),dimension(:, :),intent(inout)  tb,
TYPE(fft_scratch_type),pointer  fft_scratch,
TYPE(cp_error_type)  error 
) [private]
History
15. Feb. 2006 : single precision all_to_all
Author:
JGH (18-Jan-2001)

Definition at line 1578 of file fft_tools.f90.

References alltoall_sgl, ratio_sparse_alltoall, sparse_alltoall(), and timings::timeset().

Referenced by fft3d_ps().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

LOGICAL,save fft_tools::alltoall_sgl = .FALSE.

Definition at line 146 of file fft_tools.f90.

Referenced by get_fft_scratch(), init_fft(), x_to_yz(), xz_to_yz(), yz_to_x(), and yz_to_xz().

INTEGER,parameter,public fft_tools::BWFFT = -1

Definition at line 148 of file fft_tools.f90.

Referenced by get_fft_scratch(), and init_fft().

Definition at line 126 of file fft_tools.f90.

Referenced by init_fft(), and resize_fft_scratch_pool().

INTEGER,parameter,public fft_tools::FFT_RADIX_ALLOWED = 495

Definition at line 139 of file fft_tools.f90.

Referenced by fft_radix_operations().

INTEGER,parameter,public fft_tools::FFT_RADIX_CLOSEST = 493

Definition at line 138 of file fft_tools.f90.

Referenced by fft_radix_operations().

INTEGER,parameter,public fft_tools::FFT_RADIX_DISALLOWED = 496

Definition at line 139 of file fft_tools.f90.

Referenced by fft_radix_operations().

INTEGER,parameter,public fft_tools::FFT_RADIX_NEXT = 494
INTEGER,parameter,public fft_tools::FFT_RADIX_NEXT_ODD = 497

Definition at line 140 of file fft_tools.f90.

Referenced by fft_radix_operations().

Definition at line 145 of file fft_tools.f90.

Referenced by fft_radix_operations(), finalize_fft(), get_fft_scratch(), and init_fft().

INTEGER,parameter,public fft_tools::FWFFT = +1

Definition at line 137 of file fft_tools.f90.

Referenced by fft3d_pb(), fft3d_ps(), fft3d_s(), and get_fft_scratch().

Definition at line 122 of file fft_tools.f90.

Referenced by init_fft_scratch_pool(), and release_fft_scratch_pool().

CHARACTER(len=*),parameter,private fft_tools::moduleN = 'fft_tools'

Definition at line 47 of file fft_tools.f90.

REAL(KIND=dp),parameter fft_tools::ratio_sparse_alltoall = 0.5_dp

Definition at line 142 of file fft_tools.f90.

Referenced by xz_to_yz(), and yz_to_xz().

Definition at line 124 of file fft_tools.f90.

Referenced by get_fft_scratch().

LOGICAL,save fft_tools::use_fftsg_sizes = .TRUE.

Definition at line 147 of file fft_tools.f90.

Referenced by fft_radix_operations(), and init_fft().