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

matrix parallel domain: 2D block-cyclic distribution. More...

#include <para_matrix_world.h>

Inheritance diagram for Parallel::ParaMatrixWorld:
Collaboration diagram for Parallel::ParaMatrixWorld:

Public Member Functions

 ParaMatrixWorld ()
 Construct a serial matrix domain (1x1 process grid).
 ParaMatrixWorld (const MPI_Comm &comm)
 Construct a matrix domain on an existing communicator.
int dim0 () const
 Process grid row count.
int dim1 () const
 Process grid column count.
int coord_row () const
 Row coordinate of this process in the grid.
int coord_col () const
 Column coordinate of this process in the grid.
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 Member Functions

void compute_proc_grid ()

Private Attributes

int dim0_ = 1
int dim1_ = 1
int coord_row_ = 0
int coord_col_ = 0

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

matrix parallel domain: 2D block-cyclic distribution.

Self-contained wrapper for the matrix-level parallel topology. Replaces the process-grid part of Parallel_Blkcyclic (dim0/dim1/coord) with a cleaner interface. The actual ScaLAPACK descriptor and BLACS context management stay in Parallel_Blkcyclic; this class only holds the process grid dimensions and coordinates.

Tests only need this header.

Constructor & Destructor Documentation

◆ ParaMatrixWorld() [1/2]

Parallel::ParaMatrixWorld::ParaMatrixWorld ( )

Construct a serial matrix domain (1x1 process grid).

Here is the call graph for this function:

◆ ParaMatrixWorld() [2/2]

Parallel::ParaMatrixWorld::ParaMatrixWorld ( const MPI_Comm & comm)

Construct a matrix domain on an existing communicator.

The process grid is computed automatically: dim0 = largest divisor of nproc with dim0 >= dim1 (square-ish), dim1 = nproc / dim0.

Parameters
[in]commmatrix communicator (e.g. DIAG_WORLD or MPI_COMM_WORLD)
Here is the call graph for this function:

Member Function Documentation

◆ compute_proc_grid()

void Parallel::ParaMatrixWorld::compute_proc_grid ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ coord_col()

int Parallel::ParaMatrixWorld::coord_col ( ) const
inline

Column coordinate of this process in the grid.

Here is the caller graph for this function:

◆ coord_row()

int Parallel::ParaMatrixWorld::coord_row ( ) const
inline

Row coordinate of this process in the grid.

Here is the caller graph for this function:

◆ dim0()

int Parallel::ParaMatrixWorld::dim0 ( ) const
inline

Process grid row count.

Here is the caller graph for this function:

◆ dim1()

int Parallel::ParaMatrixWorld::dim1 ( ) const
inline

Process grid column count.

Here is the caller graph for this function:

Member Data Documentation

◆ coord_col_

int Parallel::ParaMatrixWorld::coord_col_ = 0
private

◆ coord_row_

int Parallel::ParaMatrixWorld::coord_row_ = 0
private

◆ dim0_

int Parallel::ParaMatrixWorld::dim0_ = 1
private

◆ dim1_

int Parallel::ParaMatrixWorld::dim1_ = 1
private

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