ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Parallel_Orbitals Class Reference

#include <parallel_orbitals.h>

Inheritance diagram for Parallel_Orbitals:
Collaboration diagram for Parallel_Orbitals:

Public Member Functions

 Parallel_Orbitals ()
 
 ~Parallel_Orbitals ()
 
int set_nloc_wfc_Eij (const int &N_A, std::ofstream &ofs_running, std::ofstream &ofs_warning)
 set the local size of wavefunction and Eij
 
void set_desc_wfc_Eij (const int &nbasis, const int &nbands, const int &lld)
 set the desc[9] of the 2D-block-cyclic distribution of wavefunction and Eij
 
int get_wfc_global_nbands () const
 
int get_wfc_global_nbasis () const
 
void set_atomic_trace (const int *iat2iwt, const int &nat, const int &nlocal)
 set row and col begin index for each atom it should be called after:
 
int get_col_size () const
 dimension getters for 2D-block-cyclic division of Hamiltonian matrix get_col_size() : total number of columns of Hamiltonian matrix in this processor get_row_size() : total number of rows of Hamiltonian matrix in this processor get_col_size(iat) : number of columns of Hamiltonian matrix in atom iat get_row_size(iat) : number of rows of Hamiltonian matrix in atom iat
 
int get_row_size () const
 
int get_col_size (int iat) const
 
int get_row_size (int iat) const
 
int get_nbands () const
 
std::vector< int > get_indexes_row () const
 gather global indexes of orbitals in this processor get_indexes_row() : global indexes (~NLOCAL) of rows of Hamiltonian matrix in this processor get_indexes_col() : global indexes (~NLOCAL) of columns of Hamiltonian matrix in this processor get_indexes_row(iat) : global indexes (~nw) of rows of Hamiltonian matrix in atom iat get_indexes_col(iat) : global indexes (~nw) of columns of Hamiltonian matrix in atom iat
 
std::vector< int > get_indexes_col () const
 
std::vector< int > get_indexes_row (int iat) const
 
std::vector< int > get_indexes_col (int iat) const
 
- Public Member Functions inherited from Parallel_2D
 Parallel_2D ()=default
 
 ~Parallel_2D ()=default
 
Parallel_2Doperator= (Parallel_2D &&rhs)=default
 
 Parallel_2D (Parallel_2D &&rhs)=default
 
int get_row_size () const
 number of local rows
 
int get_col_size () const
 number of local columns
 
int get_global_row_size () const
 number of global rows
 
int get_global_col_size () const
 number of global columns
 
int64_t get_local_size () const
 number of local matrix elements
 
int global2local_row (const int igr) const
 get the local index of a global index (row)
 
int global2local_col (const int igc) const
 get the local index of a global index (col)
 
int local2global_row (const int ilr) const
 get the global index of a local index (row)
 
int local2global_col (const int ilc) const
 get the global index of a local index (col)
 
bool in_this_processor (const int iw1_all, const int iw2_all) const
 check whether a global index is in this process
 
int get_block_size () const
 side length of 2d square block
 
int init (const int mg, const int ng, const int nb, const MPI_Comm comm, bool mode=false)
 Initialize a BLACS grid with the given MPI communicator and set up the info of a block-cyclic distribution.
 
int set (const int mg, const int ng, const int nb, const int blacs_ctxt)
 Set up the info of a block-cyclic distribution using given BLACS context.
 
MPI_Comm comm () const
 
void set_serial (const int mg, const int ng)
 

Public Attributes

int ncol_bands
 
int nrow_bands
 
long nloc_wfc
 ncol_bands*nrow
 
long nloc_Eij
 
int lastband_in_proc
 
int lastband_number
 
int nnr =1
 
int * nlocdim
 
int * nlocstart
 
int desc_wfc [9]
 
int desc_Eij [9]
 
int desc_wfc1 [9]
 
int * loc_sizes
 
int loc_size
 
int nbands
 
std::vector< int > atom_begin_row
 
std::vector< int > atom_begin_col
 
const int * iat2iwt_ = nullptr
 
- Public Attributes inherited from Parallel_2D
int blacs_ctxt = -1
 BLACS context.
 
int desc [9] = {}
 ScaLAPACK descriptor.
 
int nrow = 0
 local size (nloc = nrow * ncol)
 
int ncol = 0
 
int64_t nloc = 0
 
int nb = 1
 block size
 
int dim0 = 0
 number of processes in each dimension of the MPI Cartesian grid
 
int dim1 = 0
 
int coord [2] = {-1, -1}
 process coordinate in the BLACS grid
 
bool is_serial = false
 whether to use the serial mode
 

Additional Inherited Members

- Protected Member Functions inherited from Parallel_2D
void _init_proc_grid (const MPI_Comm comm, const bool mode)
 
void _set_dist_info (const int mg, const int ng, const int nb)
 
- Protected Attributes inherited from Parallel_2D
std::vector< int > global2local_row_
 map from global index to local index
 
std::vector< int > global2local_col_
 
std::vector< int > local2global_row_
 map from local index to global index
 
std::vector< int > local2global_col_
 

Detailed Description

This class packs the information of 2D-block-cyclic for LCAO code: parallel distribution of basis, wavefunction and matrix.

Constructor & Destructor Documentation

◆ Parallel_Orbitals()

Parallel_Orbitals::Parallel_Orbitals ( )
  • Tested Functions:
  • Tested Function
    • upsi
      • apply U_operator to the wave function of the previous step for new wave function.

◆ ~Parallel_Orbitals()

Parallel_Orbitals::~Parallel_Orbitals ( )

Member Function Documentation

◆ get_col_size() [1/2]

int Parallel_Orbitals::get_col_size ( ) const
inline

dimension getters for 2D-block-cyclic division of Hamiltonian matrix get_col_size() : total number of columns of Hamiltonian matrix in this processor get_row_size() : total number of rows of Hamiltonian matrix in this processor get_col_size(iat) : number of columns of Hamiltonian matrix in atom iat get_row_size(iat) : number of rows of Hamiltonian matrix in atom iat

Here is the caller graph for this function:

◆ get_col_size() [2/2]

int Parallel_Orbitals::get_col_size ( int  iat) const

◆ get_indexes_col() [1/2]

std::vector< int > Parallel_Orbitals::get_indexes_col ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_indexes_col() [2/2]

std::vector< int > Parallel_Orbitals::get_indexes_col ( int  iat) const
Here is the call graph for this function:

◆ get_indexes_row() [1/2]

std::vector< int > Parallel_Orbitals::get_indexes_row ( ) const

gather global indexes of orbitals in this processor get_indexes_row() : global indexes (~NLOCAL) of rows of Hamiltonian matrix in this processor get_indexes_col() : global indexes (~NLOCAL) of columns of Hamiltonian matrix in this processor get_indexes_row(iat) : global indexes (~nw) of rows of Hamiltonian matrix in atom iat get_indexes_col(iat) : global indexes (~nw) of columns of Hamiltonian matrix in atom iat

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_indexes_row() [2/2]

std::vector< int > Parallel_Orbitals::get_indexes_row ( int  iat) const
Here is the call graph for this function:

◆ get_nbands()

int Parallel_Orbitals::get_nbands ( ) const

◆ get_row_size() [1/2]

int Parallel_Orbitals::get_row_size ( ) const
inline
Here is the caller graph for this function:

◆ get_row_size() [2/2]

int Parallel_Orbitals::get_row_size ( int  iat) const

◆ get_wfc_global_nbands()

int Parallel_Orbitals::get_wfc_global_nbands ( ) const
Here is the caller graph for this function:

◆ get_wfc_global_nbasis()

int Parallel_Orbitals::get_wfc_global_nbasis ( ) const
Here is the caller graph for this function:

◆ set_atomic_trace()

void Parallel_Orbitals::set_atomic_trace ( const int *  iat2iwt,
const int &  nat,
const int &  nlocal 
)

set row and col begin index for each atom it should be called after:

  1. nrow and ncol are set;
  2. global2local_row_ and global2local_col_ are set;
    Parameters
    iat2iwt: the map from atom index to global oribtal indexes
    nat: number of atoms
    nlocal: number of global orbitals
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_desc_wfc_Eij()

void Parallel_Orbitals::set_desc_wfc_Eij ( const int &  nbasis,
const int &  nbands,
const int &  lld 
)

set the desc[9] of the 2D-block-cyclic distribution of wavefunction and Eij

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_nloc_wfc_Eij()

int Parallel_Orbitals::set_nloc_wfc_Eij ( const int &  N_A,
std::ofstream &  ofs_running,
std::ofstream &  ofs_warning 
)

set the local size of wavefunction and Eij

Parameters
N_Aglobal row size
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ atom_begin_col

std::vector<int> Parallel_Orbitals::atom_begin_col

◆ atom_begin_row

std::vector<int> Parallel_Orbitals::atom_begin_row

◆ desc_Eij

int Parallel_Orbitals::desc_Eij[9]

◆ desc_wfc

int Parallel_Orbitals::desc_wfc[9]

◆ desc_wfc1

int Parallel_Orbitals::desc_wfc1[9]

◆ iat2iwt_

const int* Parallel_Orbitals::iat2iwt_ = nullptr

◆ lastband_in_proc

int Parallel_Orbitals::lastband_in_proc

◆ lastband_number

int Parallel_Orbitals::lastband_number

◆ loc_size

int Parallel_Orbitals::loc_size

◆ loc_sizes

int* Parallel_Orbitals::loc_sizes

◆ nbands

int Parallel_Orbitals::nbands

◆ ncol_bands

int Parallel_Orbitals::ncol_bands

local size of bands, used for 2d wavefunction must divided on dim1 because of elpa interface

◆ nloc_Eij

long Parallel_Orbitals::nloc_Eij

◆ nloc_wfc

long Parallel_Orbitals::nloc_wfc

ncol_bands*nrow

◆ nlocdim

int* Parallel_Orbitals::nlocdim

◆ nlocstart

int* Parallel_Orbitals::nlocstart

◆ nnr

int Parallel_Orbitals::nnr =1

number of elements(basis-pairs) in this processon

on all adjacent atoms-pairs(2D division)

◆ nrow_bands

int Parallel_Orbitals::nrow_bands

The documentation for this class was generated from the following files: