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

pw parallel domain: plane-wave distribution within a pool. More...

#include <para_pw_world.h>

Inheritance diagram for Parallel::ParaPwWorld:
Collaboration diagram for Parallel::ParaPwWorld:

Public Member Functions

 ParaPwWorld (int npw)
 Construct a serial (single-process) pw domain.
 ParaPwWorld (const MPI_Comm &comm, const std::vector< int > &npw_per)
 Construct a pw domain on an existing pool communicator.
int npw () const
 Number of plane waves on this process.
int npwtot () const
 Total number of plane waves in the pool.
int npw_per (int p) const
 Number of plane waves on process p in the pool.
int poolnproc () const
 Number of processes in the pool (same as size()).
int poolrank () const
 Rank within the pool (same as rank()).
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 npw_ = 0
 local plane-wave count
int npwtot_ = 0
 total plane waves in pool
std::vector< int > npw_per_
 per-process plane-wave counts

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

pw parallel domain: plane-wave distribution within a pool.

Self-contained replacement for poolnproc/poolrank/npw_per/npwtot members scattered across PW_Basis and GlobalV::NPROC_IN_POOL. Owns the pool-level parallel topology and plane-wave count distribution.

The actual FFT-based distribution algorithm (method1/method2) stays in PW_Basis; this class only holds the result: how many plane waves each process in the pool gets.

Tests only need this header; no PW_Basis, no parallel_comm.h.

Constructor & Destructor Documentation

◆ ParaPwWorld() [1/2]

Parallel::ParaPwWorld::ParaPwWorld ( int npw)
explicit

Construct a serial (single-process) pw domain.

Parameters
[in]npwnumber of plane waves on this process
Here is the call graph for this function:

◆ ParaPwWorld() [2/2]

Parallel::ParaPwWorld::ParaPwWorld ( const MPI_Comm & comm,
const std::vector< int > & npw_per )

Construct a pw domain on an existing pool communicator.

Parameters
[in]commpool communicator (e.g. POOL_WORLD)
[in]npw_perarray of plane-wave counts per process (size = pool size)
Here is the call graph for this function:

Member Function Documentation

◆ npw()

int Parallel::ParaPwWorld::npw ( ) const
inline

Number of plane waves on this process.

Here is the caller graph for this function:

◆ npw_per()

int Parallel::ParaPwWorld::npw_per ( int p) const

Number of plane waves on process p in the pool.

Here is the caller graph for this function:

◆ npwtot()

int Parallel::ParaPwWorld::npwtot ( ) const
inline

Total number of plane waves in the pool.

Here is the caller graph for this function:

◆ poolnproc()

int Parallel::ParaPwWorld::poolnproc ( ) const
inline

Number of processes in the pool (same as size()).

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

◆ poolrank()

int Parallel::ParaPwWorld::poolrank ( ) const
inline

Rank within the pool (same as rank()).

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

Member Data Documentation

◆ npw_

int Parallel::ParaPwWorld::npw_ = 0
private

local plane-wave count

◆ npw_per_

std::vector<int> Parallel::ParaPwWorld::npw_per_
private

per-process plane-wave counts

◆ npwtot_

int Parallel::ParaPwWorld::npwtot_ = 0
private

total plane waves in pool


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