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

bgroup parallel domain: band group communication topology. More...

#include <para_bgroup_world.h>

Inheritance diagram for Parallel::ParaBgroupWorld:
Collaboration diagram for Parallel::ParaBgroupWorld:

Public Member Functions

 ParaBgroupWorld ()
 Construct a serial bgroup domain (single band group).
 ParaBgroupWorld (const MPI_Comm &intra_comm, const MPI_Comm &inter_comm, int nbndgroup)
 Construct a bgroup domain from intra and inter communicators.
int my_bndgroup () const
 Band group index of this process.
int nbndgroup () const
 Number of band groups.
int rank_in_bpgroup () const
 Rank within the band group (alias for rank()).
int nproc_in_bndgroup () const
 Number of processes in the band group (alias for size()).
MPI_Comm inter_comm () const
 Inter-group communicator (BP_WORLD equivalent).
Public Member Functions inherited from Parallel::ParaWorld
virtual ~ParaWorld ()=default
const std::string & tag () const
 Domain tag string.
int rank () const
 Rank of this process inside the domain (0 in serial builds).
int size () const
 Number of processes in the domain (1 in serial builds).
bool valid () const
 True if this process belongs to the domain.
MPI_Comm comm () const
 Underlying MPI communicator (MPI builds only).

Private Attributes

int my_bndgroup_ = 0
int nbndgroup_ = 1
MPI_Comm inter_comm_ = MPI_COMM_NULL

Additional Inherited Members

Static Public Member Functions inherited from Parallel::ParaWorld
static ParaWorld serial (const std::string &tag)
 Build a serial (size=1, rank=0) domain for the given tag.
static std::unique_ptr< ParaWorld > make_serial (const std::string &tag)
 Build a serial domain as a heap-allocated unique_ptr.
static ParaWorld make_mpi (const std::string &tag, const MPI_Comm &comm)
 Build a domain wrapping an MPI communicator.
static std::unique_ptr< ParaWorld > make_mpi_ptr (const std::string &tag, const MPI_Comm &comm)
Protected Member Functions inherited from Parallel::ParaWorld
 ParaWorld (const std::string &tag)
 Construct a serial (single-process) domain.
 ParaWorld (const std::string &tag, const MPI_Comm &comm)
 Construct a domain wrapping an existing MPI communicator.

Detailed Description

bgroup parallel domain: band group communication topology.

Self-contained replacement for INT_BGROUP + BP_WORLD + GlobalV::MY_BNDGROUP/NPROC_IN_BNDGROUP/RANK_IN_BPGROUP.

The band group domain has two communicators:

  • intra: INT_BGROUP (same band group, different k/pw)
  • inter: BP_WORLD (different band groups, same k)

Tests only need this header.

Constructor & Destructor Documentation

◆ ParaBgroupWorld() [1/2]

Parallel::ParaBgroupWorld::ParaBgroupWorld ( )

Construct a serial bgroup domain (single band group).

Here is the call graph for this function:

◆ ParaBgroupWorld() [2/2]

Parallel::ParaBgroupWorld::ParaBgroupWorld ( const MPI_Comm & intra_comm,
const MPI_Comm & inter_comm,
int nbndgroup )

Construct a bgroup domain from intra and inter communicators.

Parameters
[in]intra_commintra-group communicator (e.g. INT_BGROUP)
[in]inter_comminter-group communicator (e.g. BP_WORLD)
[in]nbndgroupnumber of band groups
Here is the call graph for this function:

Member Function Documentation

◆ inter_comm()

MPI_Comm Parallel::ParaBgroupWorld::inter_comm ( ) const
inline

Inter-group communicator (BP_WORLD equivalent).

Here is the caller graph for this function:

◆ my_bndgroup()

int Parallel::ParaBgroupWorld::my_bndgroup ( ) const
inline

Band group index of this process.

Here is the caller graph for this function:

◆ nbndgroup()

int Parallel::ParaBgroupWorld::nbndgroup ( ) const
inline

Number of band groups.

Here is the caller graph for this function:

◆ nproc_in_bndgroup()

int Parallel::ParaBgroupWorld::nproc_in_bndgroup ( ) const
inline

Number of processes in the band group (alias for size()).

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

◆ rank_in_bpgroup()

int Parallel::ParaBgroupWorld::rank_in_bpgroup ( ) const
inline

Rank within the band group (alias for rank()).

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

Member Data Documentation

◆ inter_comm_

MPI_Comm Parallel::ParaBgroupWorld::inter_comm_ = MPI_COMM_NULL
private

◆ my_bndgroup_

int Parallel::ParaBgroupWorld::my_bndgroup_ = 0
private

◆ nbndgroup_

int Parallel::ParaBgroupWorld::nbndgroup_ = 1
private

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