|
SIRIUS 7.5.0
Electronic structure library and applications
|
Wave-fucntions in the FFT-friendly distribution. More...
#include <wave_functions.hpp>
Inherits sirius::wf::Wave_functions_base< T >.
Public Member Functions | |
| Wave_functions_fft () | |
| Constructor. More... | |
| Wave_functions_fft (std::shared_ptr< fft::Gvec_fft > gkvec_fft__, Wave_functions< T > &wf__, spin_index s__, band_range br__, unsigned int shuffle_flag___) | |
| Constructor. More... | |
| Wave_functions_fft & | operator= (Wave_functions_fft &&src__) |
| Move assignment operator. More... | |
| ~Wave_functions_fft () | |
| Destructor. More... | |
| int | num_wf_local () const |
| Return local number of wave-functions. More... | |
| auto | spl_num_wf () const |
| Return the split index for the number of wave-functions. More... | |
| std::complex< T > & | pw_coeffs (int ig__, band_index b__) |
| Return reference to the plane-wave coefficient. More... | |
| T * | pw_coeffs_spfft (sddk::memory_t mem__, band_index b__) |
| Return pointer to the beginning of wave-functions casted to real type as required by the SpFFT library. More... | |
| auto | on_device () const |
| Return true if data is avaliable on the device memory. More... | |
| std::complex< T > const * | at (sddk::memory_t mem__, int i__, band_index b__) const |
| Return const pointer to the data for a given plane-wave and band indices. More... | |
| auto | at (sddk::memory_t mem__, int i__, band_index b__) |
| Return pointer to the data for a given plane-wave and band indices. More... | |
Public Member Functions inherited from sirius::wf::Wave_functions_base< T > | |
| Wave_functions_base () | |
| Constructor. More... | |
| Wave_functions_base (int num_pw__, int num_mt__, num_mag_dims num_md__, num_bands num_wf__, sddk::memory_t default_mem__) | |
| Constructor. More... | |
| auto | memory_guard (sddk::memory_t mem__, wf::copy_to copy_to__=copy_to::none) const |
| Return an instance of the memory guard. More... | |
| auto | num_sc () const |
| Return number of spin components. More... | |
| auto | num_md () const |
| Return number of magnetic dimensions. More... | |
| auto | num_wf () const |
| Return number of wave-functions. More... | |
| auto | ld () const |
| Return leading dimensions of the wave-functions coefficients array. More... | |
| auto | actual_spin_index (spin_index s__) const |
| Return the actual spin index of the wave-functions. More... | |
| void | zero (sddk::memory_t mem__, spin_index s__, band_range br__) |
| Zero a spin component of the wave-functions in a band range. More... | |
| void | zero (sddk::memory_t mem__) |
| Zero all wave-functions. More... | |
| std::complex< T > const * | at (sddk::memory_t mem__, int i__, spin_index s__, band_index b__) const |
| Return const pointer to the wave-function coefficient at a given index, spin and band. More... | |
| auto | at (sddk::memory_t mem__, int i__, spin_index s__, band_index b__) |
| Return pointer to the wave-function coefficient at a given index, spin and band. More... | |
| void | allocate (sddk::memory_t mem__) |
| Allocate wave-functions. More... | |
| void | deallocate (sddk::memory_t mem__) |
| Deallocate wave-functions. More... | |
| void | copy_to (sddk::memory_t mem__) |
| Copy date to host or device. More... | |
Private Member Functions | |
| auto | grid_layout (int n__) |
| Return COSTA grd layout description. More... | |
| void | shuffle_to_fft_layout (spin_index ispn__, band_range b__) |
| Shuffle wave-function to the FFT distribution. More... | |
| void | shuffle_to_wf_layout (spin_index ispn__, band_range b__) |
| Shuffle wave-function to the original slab layout. More... | |
Private Attributes | |
| std::shared_ptr< fft::Gvec_fft > | gkvec_fft_ |
| Pointer to FFT-friendly G+k vector deistribution. More... | |
| splindex_block | spl_num_wf_ |
| Split number of wave-functions between column communicator. More... | |
| Wave_functions< T > * | wf_ {nullptr} |
| Pointer to the original wave-functions. More... | |
| spin_index | s_ {0} |
| Spin-index of the wave-function component. More... | |
| band_range | br_ {0} |
| Range of bands in the input wave-functions to be swapped. More... | |
| unsigned int | shuffle_flag_ {0} |
| Direction of the reshuffling: to FFT layout or back to WF layout or both. More... | |
| bool | on_device_ {false} |
| True if the FFT wave-functions are also available on the device. More... | |
Additional Inherited Members | |
Protected Attributes inherited from sirius::wf::Wave_functions_base< T > | |
| int | num_pw_ {0} |
| Local number of plane-wave coefficients. More... | |
| int | num_mt_ {0} |
| Local number of muffin-tin coefficients. More... | |
| num_mag_dims | num_md_ {0} |
| Number of magnetic dimensions (0, 1, or 3). More... | |
| num_bands | num_wf_ {0} |
| Total number of wave-functions. More... | |
| num_spins | num_sc_ {0} |
| Number of spin components (1 or 2). More... | |
| std::array< sddk::mdarray< std::complex< T >, 2 >, 2 > | data_ |
| Data storage for the wave-functions. More... | |
Wave-fucntions in the FFT-friendly distribution.
To reduce the FFT MPI communication volume, it is often beneficial to redistribute wave-functions from a default slab layout to a FFT-friendly layout. Often this is a full swap from G-vector to band distribution. In general this is a redistribution of data from [N x 1] to [M x K] MPI grids.
band index band index band index
┌──────────────┐ ┌───────┬──────┐ ┌───┬───┬───┬──┐
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
├──────────────┤ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ partial │ │ │ full │ │ │ │ │
│ │ swap │ │ │ swap │ │ │ │ │
G+k index ├──────────────┤ -> ├───────┼──────┤ -> ├───┼───┼───┼──┤
(distributed) │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
├──────────────┤ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
└──────────────┘ └───────┴──────┘ └───┴───┴───┴──┘Wave-functions in FFT distribution are scalar with only one spin component.
| T | Precision type of the wave-functions (double or float). |
Definition at line 838 of file wave_functions.hpp.
|
inline |
Constructor.
Definition at line 1062 of file wave_functions.hpp.
|
inline |
Constructor.
Definition at line 1067 of file wave_functions.hpp.
|
inline |
Destructor.
Definition at line 1138 of file wave_functions.hpp.
|
inlineprivate |
Return COSTA grd layout description.
Definition at line 857 of file wave_functions.hpp.
|
inlineprivate |
Shuffle wave-function to the FFT distribution.
Definition at line 891 of file wave_functions.hpp.
|
inlineprivate |
Shuffle wave-function to the original slab layout.
Definition at line 968 of file wave_functions.hpp.
|
inline |
Move assignment operator.
Definition at line 1114 of file wave_functions.hpp.
|
inline |
Return local number of wave-functions.
Wave-function band index is distributed over the columns of MPI grid. Each group of FFT communiators is working on its local set of wave-functions.
Definition at line 1158 of file wave_functions.hpp.
|
inline |
Return the split index for the number of wave-functions.
Definition at line 1164 of file wave_functions.hpp.
|
inline |
Return reference to the plane-wave coefficient.
Definition at line 1170 of file wave_functions.hpp.
|
inline |
Return pointer to the beginning of wave-functions casted to real type as required by the SpFFT library.
Definition at line 1176 of file wave_functions.hpp.
|
inline |
Return true if data is avaliable on the device memory.
Definition at line 1182 of file wave_functions.hpp.
|
inline |
Return const pointer to the data for a given plane-wave and band indices.
Definition at line 1189 of file wave_functions.hpp.
|
inline |
Return pointer to the data for a given plane-wave and band indices.
Definition at line 1196 of file wave_functions.hpp.
|
private |
Pointer to FFT-friendly G+k vector deistribution.
Definition at line 842 of file wave_functions.hpp.
|
private |
Split number of wave-functions between column communicator.
Definition at line 844 of file wave_functions.hpp.
|
private |
Pointer to the original wave-functions.
Definition at line 846 of file wave_functions.hpp.
|
private |
Spin-index of the wave-function component.
Definition at line 848 of file wave_functions.hpp.
|
private |
Range of bands in the input wave-functions to be swapped.
Definition at line 850 of file wave_functions.hpp.
|
private |
Direction of the reshuffling: to FFT layout or back to WF layout or both.
Definition at line 852 of file wave_functions.hpp.
|
private |
True if the FFT wave-functions are also available on the device.
Definition at line 854 of file wave_functions.hpp.