DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
|
#include <process_grid.h>
Public Member Functions | |
ProcessGrid (const MPI_Comm &mpi_communicator, const unsigned int n_rows, const unsigned int n_columns) | |
ProcessGrid (const MPI_Comm &mpi_communicator, const unsigned int n_rows_matrix, const unsigned int n_columns_matrix, const unsigned int row_block_size, const unsigned int column_block_size) | |
~ProcessGrid () | |
int | get_blacs_context () const |
unsigned int | get_process_grid_rows () const |
unsigned int | get_process_grid_columns () const |
int | get_this_process_row () const |
int | get_this_process_column () const |
template<typename NumberType> | |
void | send_to_inactive (NumberType *value, const int count=1) const |
bool | is_process_active () const |
Private Member Functions | |
ProcessGrid (const MPI_Comm &mpi_communicator, const std::pair< unsigned int, unsigned int > &grid_dimensions) | |
Private Attributes | |
MPI_Comm | mpi_communicator |
MPI_Comm | mpi_communicator_inactive_with_root |
int | blacs_context |
const unsigned int | this_mpi_process |
const unsigned int | n_mpi_processes |
int | n_process_rows |
int | n_process_columns |
int | this_process_row |
int | this_process_column |
bool | mpi_process_is_active |
Friends | |
template<typename NumberType> | |
class | dftfe::ScaLAPACKMatrix |
A class taking care of setting up a two-dimensional processor grid. For example an MPI communicator with 5 processes can be arranged into a 2x2 grid with the 5-th processor being inactive:
A shared pointer to this class is provided to ScaLAPACKMatrix matrices to perform block-cyclic distribution.
Note that this class allows to setup a process grid which has fewer MPI cores than the total number of cores in the communicator.
Currently the only place where one would use a ProcessGrid object is in connection with a ScaLAPACKMatrix object.
dftfe::ProcessGrid::ProcessGrid | ( | const MPI_Comm & | mpi_communicator, |
const unsigned int | n_rows, | ||
const unsigned int | n_columns ) |
Constructor for a process grid with n_rows
and n_columns
for a given mpi_communicator
. The product of rows and columns should be less or equal to the total number of cores in the mpi_communicator
.
dftfe::ProcessGrid::ProcessGrid | ( | const MPI_Comm & | mpi_communicator, |
const unsigned int | n_rows_matrix, | ||
const unsigned int | n_columns_matrix, | ||
const unsigned int | row_block_size, | ||
const unsigned int | column_block_size ) |
$, where $M,N$ are the matrix dimension and $MB,NB$ are the block sizes and $Np$ is the number of processes in the mpi_communicator
. This function then creates a 2D processor grid assuming the ratio between number of process row $p$ and columns $q$ to be equal the ratio between matrix dimensions $M$ and $N$.
For example, a square matrix $640x640$ with the block size $32$ and the mpi_communicator
with 11 cores will result in the $3x3$ process grid.
dftfe::ProcessGrid::~ProcessGrid | ( | ) |
Destructor.
|
private |
A private constructor which takes grid dimensions as an std::pair
.
|
inline |
Return the blacs_context.
|
inline |
Return the number of columns in the processes grid.
|
inline |
Return the number of rows in the processes grid.
|
inline |
Return column of this process in the process grid.
It's negative for inactive processes.
|
inline |
Return row of this process in the process grid.
It's negative for inactive processes.
|
inline |
Return true
if the process is active within the grid.
void dftfe::ProcessGrid::send_to_inactive | ( | NumberType * | value, |
const int | count = 1 ) const |
Send count
values stored consequently starting at value
from the process with rank zero to processes which are not in the process grid.
|
friend |
|
private |
BLACS context. This is equivalent to MPI communicators and is used by ScaLAPACK.
|
private |
An MPI communicator with all processes (active and inactive).
|
private |
An MPI communicator with inactive processes and the process with rank zero.
|
private |
A flag which is true for processes within the 2D process grid.
|
private |
Total number of MPI processes.
|
private |
Number of columns in the processes grid.
|
private |
Number of rows in the processes grid.
|
private |
Rank of this MPI process.
|
private |
Column of this process in the grid.
It's negative for in-active processes.
|
private |
Row of this process in the grid.
It's negative for in-active processes.