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

Describe replicated or contiguous band-group storage. More...

#include <para_band_output.h>

Collaboration diagram for Parallel::ParaBandOutput:

Public Member Functions

 ParaBandOutput (int local_nbands, int global_nbands, const ParaWorld &band_world)
 Construct and validate the layout collectively on a valid band domain.
bool bands_are_replicated () const
int global_nbands () const
int local_nbands () const
int band_group () const
int local_offset () const
int owner_group (const int global_band) const
int local_index (const int global_band) const
void bcast_band (int global_band, double *data, int count) const
 Broadcast host data from the group owning a global band.
void bcast_band (int global_band, std::complex< double > *data, int count) const
 Broadcast complex host data with the same contract as the real overload.
ModuleBase::matrix gather_matrix (const ModuleBase::matrix &local_matrix) const
 Obtain a complete matrix on every rank from local band columns. Replicated input is returned locally without synchronizing replicas. Distributed columns are gathered in band-group order; row counts must match across groups. Empty band sets and empty local shards are valid.

Private Attributes

ParaWorld band_world_
bool bands_are_replicated_ = true
int global_nbands_ = 0
int local_nbands_ = 0
int band_group_ = 0
std::vector< int > band_counts_
std::vector< int > band_offsets_

Detailed Description

Describe replicated or contiguous band-group storage.

The layout is constructed collectively on the supplied band domain. Replicated storage designates group 0 as the representative for broadcasting; every group still stores all bands. Distributed storage assigns each contiguous range to the band group that stores it.

Constructor & Destructor Documentation

◆ ParaBandOutput()

Parallel::ParaBandOutput::ParaBandOutput ( int local_nbands,
int global_nbands,
const ParaWorld & band_world )

Construct and validate the layout collectively on a valid band domain.

Parameters
local_nbandsNumber of bands stored by this group.
global_nbandsGlobal band count, identical across the domain.
band_worldDomain connecting corresponding k-point and PW ranks across band groups. Its communicator must outlive this object.
Here is the call graph for this function:

Member Function Documentation

◆ band_group()

int Parallel::ParaBandOutput::band_group ( ) const

Return the current rank within the band domain.

Here is the caller graph for this function:

◆ bands_are_replicated()

bool Parallel::ParaBandOutput::bands_are_replicated ( ) const

Return whether every band group stores all global bands.

◆ bcast_band() [1/2]

void Parallel::ParaBandOutput::bcast_band ( int global_band,
double * data,
int count ) const

Broadcast host data from the group owning a global band.

All groups must call in the same band/component order with matching element counts. A serial build validates the band and leaves data unchanged.

Parameters
global_bandZero-based global band index.
dataHost buffer to broadcast in place.
countNumber of elements; zero is allowed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bcast_band() [2/2]

void Parallel::ParaBandOutput::bcast_band ( int global_band,
std::complex< double > * data,
int count ) const

Broadcast complex host data with the same contract as the real overload.

Here is the call graph for this function:

◆ gather_matrix()

ModuleBase::matrix Parallel::ParaBandOutput::gather_matrix ( const ModuleBase::matrix & local_matrix) const

Obtain a complete matrix on every rank from local band columns. Replicated input is returned locally without synchronizing replicas. Distributed columns are gathered in band-group order; row counts must match across groups. Empty band sets and empty local shards are valid.

Parameters
local_matrixMatrix with local_nbands() columns.
Returns
Complete matrix with global_nbands() columns on every rank.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ global_nbands()

int Parallel::ParaBandOutput::global_nbands ( ) const

Return the global band count.

Here is the caller graph for this function:

◆ local_index()

int Parallel::ParaBandOutput::local_index ( const int global_band) const

Return a global band's local index on its owner.

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

◆ local_nbands()

int Parallel::ParaBandOutput::local_nbands ( ) const

Return the current band group's local band count.

Here is the caller graph for this function:

◆ local_offset()

int Parallel::ParaBandOutput::local_offset ( ) const

Return the current band group's global starting offset.

Here is the caller graph for this function:

◆ owner_group()

int Parallel::ParaBandOutput::owner_group ( const int global_band) const

Return the band-domain rank designated as a global band's owner.

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

Member Data Documentation

◆ band_counts_

std::vector<int> Parallel::ParaBandOutput::band_counts_
private

◆ band_group_

int Parallel::ParaBandOutput::band_group_ = 0
private

◆ band_offsets_

std::vector<int> Parallel::ParaBandOutput::band_offsets_
private

◆ band_world_

ParaWorld Parallel::ParaBandOutput::band_world_
private

◆ bands_are_replicated_

bool Parallel::ParaBandOutput::bands_are_replicated_ = true
private

◆ global_nbands_

int Parallel::ParaBandOutput::global_nbands_ = 0
private

◆ local_nbands_

int Parallel::ParaBandOutput::local_nbands_ = 0
private

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