ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Parallel_Orbitals Class Reference

#include <parallel_orbitals.h>

Collaboration diagram for Parallel_Orbitals:

Public Member Functions

 Parallel_Orbitals ()
 ~Parallel_Orbitals ()
Parallel_Blkcyclic & para_2d ()
const Parallel_Blkcyclic & para_2d () const
const Parallel_Blkcyclic & wfc_layout () const
const Parallel_Blkcyclic & mo_repr_layout () const
int set_wfc_and_mo_sizes (const int &nmo, std::ofstream &ofs_running, std::ofstream &ofs_warning)
 set the local sizes of the wavefunction and the MO representation
void set_wfc_and_mo_layouts (const int &nbasis, const int &nmo)
 set the 2D-block-cyclic layouts of the wavefunction and the MO representation
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_ncol_atom (int iat) const
 dimension getters for 2D-block-cyclic division of Hamiltonian matrix ncloc() : total number of columns of Hamiltonian matrix in this processor nrloc() : total number of rows of Hamiltonian matrix in this processor get_ncol_atom(iat) : number of columns of Hamiltonian matrix in atom iat get_nrow_atom(iat) : number of rows of Hamiltonian matrix in atom iat
int get_nrow_atom (int iat) const
bool is_invalid_atom_pair (int iat1, int iat2) 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 Attributes

int ncol_bands
int nrow_bands
long nloc_wfc
 ncol_bands*nrow
int lastband_in_proc
int lastband_number
int nnr =1
std::vector< int > nlocdim
std::vector< int > nlocstart
int desc_wfc [9]
int nbands
std::vector< int > atom_begin_row
std::vector< int > atom_begin_col
const int * iat2iwt_ = nullptr

Private Attributes

Parallel_Blkcyclic para_2d_
Parallel_Blkcyclic wfc_layout_
Parallel_Blkcyclic mo_repr_layout_

Detailed Description

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

R4 (single storage): this class must never add a copy of any Parallel_Blkcyclic state field (nrow/ncol/nloc/nb/dim0/dim1/desc/blacs_ctxt). The only authoritative copy lives in the para_2d_ member below; re-deriving the distribution from a duplicated field would silently desynchronize the LCAO band/atom layers that are computed from it.

Constructor & Destructor Documentation

◆ Parallel_Orbitals()

Parallel_Orbitals::Parallel_Orbitals ( )

◆ ~Parallel_Orbitals()

Parallel_Orbitals::~Parallel_Orbitals ( )

Member Function Documentation

◆ get_indexes_col() [1/2]

std::vector< int > Parallel_Orbitals::get_indexes_col ( ) const
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 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_ncol_atom()

int Parallel_Orbitals::get_ncol_atom ( int iat) const

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

Here is the caller graph for this function:

◆ get_nrow_atom()

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

◆ 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:

◆ is_invalid_atom_pair()

bool Parallel_Orbitals::is_invalid_atom_pair ( int iat1,
int iat2 ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mo_repr_layout()

const Parallel_Blkcyclic & Parallel_Orbitals::mo_repr_layout ( ) const
inline

Block-cyclic layout of the MO representation: S and H represented in the MOs defined by the DFT reference determinant, i.e. Psi^dagger * S * Psi and Psi^dagger * H * Psi. The square global extent of this layout follows from the number nmo of MOs. Shares the process grid of para_2d_.

Here is the caller graph for this function:

◆ para_2d() [1/2]

Parallel_Blkcyclic & Parallel_Orbitals::para_2d ( )
inline

Access to the block-cyclic distribution information. The non-const overload exists only for the two cases a const getter cannot serve: non-const mutation by setup_2d_division, and test-side descriptor writes.

◆ para_2d() [2/2]

const Parallel_Blkcyclic & Parallel_Orbitals::para_2d ( ) const
inline

◆ 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_wfc_and_mo_layouts()

void Parallel_Orbitals::set_wfc_and_mo_layouts ( const int & nbasis,
const int & nmo )

set the 2D-block-cyclic layouts of the wavefunction and the MO representation

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

◆ set_wfc_and_mo_sizes()

int Parallel_Orbitals::set_wfc_and_mo_sizes ( const int & nmo,
std::ofstream & ofs_running,
std::ofstream & ofs_warning )

set the local sizes of the wavefunction and the MO representation

Parameters
nmonumber of MOs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfc_layout()

const Parallel_Blkcyclic & Parallel_Orbitals::wfc_layout ( ) const
inline

Block-cyclic distribution of the wavefunction (nbasis x nbands). This is a distinct layout from the square Hamiltonian distribution, shared with the same process grid; it is a temporary adapter seam, not a duplicate of para_2d_.

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_wfc

int Parallel_Orbitals::desc_wfc[9]

◆ iat2iwt_

const int* Parallel_Orbitals::iat2iwt_ = nullptr

◆ lastband_in_proc

int Parallel_Orbitals::lastband_in_proc

◆ lastband_number

int Parallel_Orbitals::lastband_number

◆ mo_repr_layout_

Parallel_Blkcyclic Parallel_Orbitals::mo_repr_layout_
private

Block-cyclic layout of S and H represented in the MOs defined by the DFT reference determinant. Its square global extent follows from the number nmo of MOs; it shares the process grid of para_2d_.

◆ 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_wfc

long Parallel_Orbitals::nloc_wfc

ncol_bands*nrow

◆ nlocdim

std::vector<int> Parallel_Orbitals::nlocdim

◆ nlocstart

std::vector<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

◆ para_2d_

Parallel_Blkcyclic Parallel_Orbitals::para_2d_
private

Block-cyclic distribution of the Hamiltonian matrix. Single source of truth for nrow/ncol/nloc/nb/dim0/dim1/desc/blacs_ctxt (R4).

◆ wfc_layout_

Parallel_Blkcyclic Parallel_Orbitals::wfc_layout_
private

Block-cyclic distribution of the wavefunction (nbasis x nbands), sharing the process grid of para_2d_. Temporary adapter seam for runtime consumers; not a duplicate of the Hamiltonian distribution.


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