|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Namespaces | |
| namespace | ParaTag |
| Domain tag constants for the parallel communication domains. | |
Classes | |
| class | ParaBandOutput |
| Describe replicated or contiguous band-group storage. More... | |
| class | ParaBgroupWorld |
| bgroup parallel domain: band group communication topology. More... | |
| class | ParaCollection |
| Container for all parallel communication domains. More... | |
| class | ParaDiagWorld |
| diag parallel domain: diagonalization group topology. More... | |
| class | ParaKmeshWorld |
| k-mesh parallel domain: k-point distribution across pools. More... | |
| class | ParaMatrixWorld |
| matrix parallel domain: 2D block-cyclic distribution. More... | |
| class | ParaPwWorld |
| pw parallel domain: plane-wave distribution within a pool. More... | |
| class | ParaRgridWorld |
| rgrid parallel domain: real-space FFT grid distribution. More... | |
| class | ParaWorld |
| Value type describing one MPI communication domain. More... | |
Functions | |
| ParaWorld | make_pw_world () |
| Temporary bridge: construct a pw-domain ParaWorld from the old global POOL_WORLD (MPI) or as a serial domain (non-MPI). | |
| ParaWorld | make_band_world () |
| Wrap the legacy BP_WORLD as a band domain, or return a serial domain. The caller must keep the underlying communicator alive while using the domain. Remove this bridge once callers receive the domain from driver initialization. | |
| template void | ParaKmeshWorld::pool_collection< std::complex< double > > (std::complex< double > *, const std::complex< double > *, int, int) const |
| void | bcast_bool (bool &v, const ParaWorld &world, int root) |
| void | bcast_int (int &v, const ParaWorld &world, int root) |
| void | bcast_double (double &v, const ParaWorld &world, int root) |
| void | bcast_complex (std::complex< double > &v, const ParaWorld &world, int root) |
| void | bcast_string (std::string &s, const ParaWorld &world, int root) |
| void | bcast_int (int *v, int n, const ParaWorld &world, int root) |
| void | bcast_double (double *v, int n, const ParaWorld &world, int root) |
| void | bcast_complex (std::complex< double > *v, int n, const ParaWorld &world, int root) |
| void | bcast_char (char *v, int n, const ParaWorld &world, int root) |
| void | bcast_string (std::string *v, int n, const ParaWorld &world, int root) |
| void | reduce_all (double &v, const ParaWorld &world) |
| void | reduce_all (int &v, const ParaWorld &world) |
| void | reduce_all (double *v, int n, const ParaWorld &world) |
| void | reduce_min (double &v, const ParaWorld &world) |
| void | reduce_max (double &v, const ParaWorld &world) |
| void | reduce_min (int &v, const ParaWorld &world) |
| void | reduce_max (int &v, const ParaWorld &world) |
| void | barrier (const ParaWorld &world) |
| void | allgather_int (int &v, int *all, const ParaWorld &world) |
| void | allgatherv_double (const double *send, int send_count, double *recv, const int *recv_counts, const int *displs, const ParaWorld &world) |
| Gather variable-sized double buffers onto every rank in the domain. | |
| void | divide_mpi_groups (int nproc, int num_groups, int rank, bool even, int &procs_in_group, int &my_group, int &rank_in_group) |
| Divide nproc processes into num_groups groups. | |
| void | split_images (int nproc, int my_rank, int nimage, int &image_id, int &rank_in_esolver, int &esolver_size, ParaWorld &esolver_world, ParaWorld &images_world) |
| Split MPI_COMM_WORLD into nimage independent images. | |
| void | split_pools (int parent_size, int parent_rank, int bndpar, int kpar, const MPI_Comm &parent_comm, int &nproc_in_pool, int &rank_in_pool, int &my_pool, int &nproc_in_bndgroup, int &rank_in_bpgroup, int &my_bndgroup, ParaWorld &pw_world, ParaWorld &kmesh_world, ParaWorld &bgroup_int, ParaWorld &bgroup_bp) |
| Split a parent domain into k-pools and band groups. | |
| ParaWorld | split_diag_world (int diag_np, int parent_size, int parent_rank, const MPI_Comm &parent_comm, int &drank, int &dsize, int &dcolor) |
| Split a parent domain for diagonalization. | |
| ParaWorld | split_grid_world (int diag_np, int parent_size, int parent_rank, const MPI_Comm &parent_comm, int &grank, int &gsize) |
| Split a parent domain for the real-space grid. | |
| ParaCollection | setup_para_worlds (int nproc, int my_rank, int nimage, int bndpar, int kpar, int diag_np) |
| Assemble the full parallel domain hierarchy. | |
| void Parallel::allgather_int | ( | int & | v, |
| int * | all, | ||
| const ParaWorld & | world ) |
| void Parallel::allgatherv_double | ( | const double * | send, |
| int | send_count, | ||
| double * | recv, | ||
| const int * | recv_counts, | ||
| const int * | displs, | ||
| const ParaWorld & | world ) |
Gather variable-sized double buffers onto every rank in the domain.
| send | Local input buffer; may be null when send_count is zero. |
| send_count | Number of local elements. |
| recv | Output buffer large enough for all received segments. |
| recv_counts | Element counts indexed by domain rank. |
| displs | Element offsets in recv indexed by domain rank. |
| world | Communication domain; invalid domains are skipped. |
| void Parallel::barrier | ( | const ParaWorld & | world | ) |
| void Parallel::bcast_bool | ( | bool & | v, |
| const ParaWorld & | world, | ||
| int | root ) |
| void Parallel::bcast_char | ( | char * | v, |
| int | n, | ||
| const ParaWorld & | world, | ||
| int | root ) |
| void Parallel::bcast_complex | ( | std::complex< double > & | v, |
| const ParaWorld & | world, | ||
| int | root ) |
| void Parallel::bcast_complex | ( | std::complex< double > * | v, |
| int | n, | ||
| const ParaWorld & | world, | ||
| int | root ) |
| void Parallel::bcast_double | ( | double & | v, |
| const ParaWorld & | world, | ||
| int | root ) |
| void Parallel::bcast_double | ( | double * | v, |
| int | n, | ||
| const ParaWorld & | world, | ||
| int | root ) |
| void Parallel::bcast_int | ( | int & | v, |
| const ParaWorld & | world, | ||
| int | root ) |
| void Parallel::bcast_int | ( | int * | v, |
| int | n, | ||
| const ParaWorld & | world, | ||
| int | root ) |
| void Parallel::bcast_string | ( | std::string & | s, |
| const ParaWorld & | world, | ||
| int | root ) |
| void Parallel::bcast_string | ( | std::string * | v, |
| int | n, | ||
| const ParaWorld & | world, | ||
| int | root ) |
| void Parallel::divide_mpi_groups | ( | int | nproc, |
| int | num_groups, | ||
| int | rank, | ||
| bool | even, | ||
| int & | procs_in_group, | ||
| int & | my_group, | ||
| int & | rank_in_group ) |
Divide nproc processes into num_groups groups.
Replaces Parallel_Global::divide_mpi_groups. Works in both serial and MPI builds.
| [in] | nproc | total number of processes |
| [in] | num_groups | desired number of groups |
| [in] | rank | global rank |
| [in] | even | if true, require an even split (assert on failure) |
| [out] | procs_in_group | processes per group |
| [out] | my_group | which group this rank belongs to |
| [out] | rank_in_group | rank within the group |
| ParaWorld Parallel::make_band_world | ( | ) |
Wrap the legacy BP_WORLD as a band domain, or return a serial domain. The caller must keep the underlying communicator alive while using the domain. Remove this bridge once callers receive the domain from driver initialization.
| ParaWorld Parallel::make_pw_world | ( | ) |
Temporary bridge: construct a pw-domain ParaWorld from the old global POOL_WORLD (MPI) or as a serial domain (non-MPI).
Hides the #ifdef __MPI from call sites so they stay one-liner. Delete this function (and this file) once ParaCollection is wired into driver initialization and callers receive a ParaWorld& from above.
| template void Parallel::ParaKmeshWorld::pool_collection< std::complex< double > > | ( | std::complex< double > * | , |
| const std::complex< double > * | , | ||
| int | , | ||
| int | ) const |
| void Parallel::reduce_all | ( | double & | v, |
| const ParaWorld & | world ) |
| void Parallel::reduce_all | ( | double * | v, |
| int | n, | ||
| const ParaWorld & | world ) |
| void Parallel::reduce_all | ( | int & | v, |
| const ParaWorld & | world ) |
| void Parallel::reduce_max | ( | double & | v, |
| const ParaWorld & | world ) |
| void Parallel::reduce_max | ( | int & | v, |
| const ParaWorld & | world ) |
| void Parallel::reduce_min | ( | double & | v, |
| const ParaWorld & | world ) |
| void Parallel::reduce_min | ( | int & | v, |
| const ParaWorld & | world ) |
| ParaCollection Parallel::setup_para_worlds | ( | int | nproc, |
| int | my_rank, | ||
| int | nimage, | ||
| int | bndpar, | ||
| int | kpar, | ||
| int | diag_np ) |
Assemble the full parallel domain hierarchy.
Top-level initialization: splits images first, then derives every solver domain from the esolver domain (see the tree diagram in the file header). Replaces the old divide_pools + split_diag_world + split_grid_world sequence in driver.cpp.
| [in] | nproc | total MPI processes (GlobalV::NPROC) |
| [in] | my_rank | global rank (GlobalV::MY_RANK) |
| [in] | nimage | number of independent images (1 for a normal run) |
| [in] | bndpar | number of band groups |
| [in] | kpar | number of k-pools |
| [in] | diag_np | number of diag/grid groups |
| ParaWorld Parallel::split_diag_world | ( | int | diag_np, |
| int | parent_size, | ||
| int | parent_rank, | ||
| const MPI_Comm & | parent_comm, | ||
| int & | drank, | ||
| int & | dsize, | ||
| int & | dcolor ) |
Split a parent domain for diagonalization.
Replaces Parallel_Global::split_diag_world.
| [in] | diag_np | number of diag groups |
| [in] | parent_size | number of processes in the parent domain |
| [in] | parent_rank | rank of this process in the parent domain |
| [in] | parent_comm | communicator the diag domain is split from |
| [out] | drank | rank in the diag domain |
| [out] | dsize | size of the diag domain |
| [out] | dcolor | color (diag group index) |
| ParaWorld Parallel::split_grid_world | ( | int | diag_np, |
| int | parent_size, | ||
| int | parent_rank, | ||
| const MPI_Comm & | parent_comm, | ||
| int & | grank, | ||
| int & | gsize ) |
Split a parent domain for the real-space grid.
Replaces Parallel_Global::split_grid_world.
| [in] | diag_np | number of grid groups (same parameter as diag) |
| [in] | parent_size | number of processes in the parent domain |
| [in] | parent_rank | rank of this process in the parent domain |
| [in] | parent_comm | communicator the grid domain is split from |
| [out] | grank | rank in the grid domain |
| [out] | gsize | size of the grid domain |
| void Parallel::split_images | ( | int | nproc, |
| int | my_rank, | ||
| int | nimage, | ||
| int & | image_id, | ||
| int & | rank_in_esolver, | ||
| int & | esolver_size, | ||
| ParaWorld & | esolver_world, | ||
| ParaWorld & | images_world ) |
Split MPI_COMM_WORLD into nimage independent images.
Produces the two top-level domains:
| [in] | nproc | total number of MPI processes |
| [in] | my_rank | global rank |
| [in] | nimage | number of images (>= 1) |
| [out] | image_id | image this rank belongs to |
| [out] | rank_in_esolver | rank inside the esolver domain |
| [out] | esolver_size | number of processes in the esolver domain |
| [out] | esolver_world | intra-image domain (tag: ParaTag::esolver) |
| [out] | images_world | inter-image domain (tag: ParaTag::images, invalid when nimage == 1 or uneven split) |
| void Parallel::split_pools | ( | int | parent_size, |
| int | parent_rank, | ||
| int | bndpar, | ||
| int | kpar, | ||
| const MPI_Comm & | parent_comm, | ||
| int & | nproc_in_pool, | ||
| int & | rank_in_pool, | ||
| int & | my_pool, | ||
| int & | nproc_in_bndgroup, | ||
| int & | rank_in_bpgroup, | ||
| int & | my_bndgroup, | ||
| ParaWorld & | pw_world, | ||
| ParaWorld & | kmesh_world, | ||
| ParaWorld & | bgroup_int, | ||
| ParaWorld & | bgroup_bp ) |
Split a parent domain into k-pools and band groups.
Replaces Parallel_Global::divide_pools. All splits are performed inside parent_comm (normally the esolver domain), so the same code works for both single-image and multi-image runs.
| [in] | parent_size | number of processes in the parent domain |
| [in] | parent_rank | rank of this process in the parent domain |
| [in] | bndpar | number of band groups |
| [in] | kpar | number of k-pools |
| [in] | parent_comm | communicator the pools are split from |
| [out] | nproc_in_pool | processes per pool |
| [out] | rank_in_pool | rank within pool |
| [out] | my_pool | pool index |
| [out] | nproc_in_bndgroup | processes per band group |
| [out] | rank_in_bpgroup | rank within the band group |
| [out] | my_bndgroup | band group index |
| [out] | pw_world | domain for POOL_WORLD |
| [out] | kmesh_world | domain for KP_WORLD (invalid when kpar == 1) |
| [out] | bgroup_int | domain for INT_BGROUP |
| [out] | bgroup_bp | domain for BP_WORLD |