.. index:: pair: class; gpr::linalg::DistributedState .. _doxid-classgpr_1_1linalg_1_1_distributed_state: class gpr::linalg::DistributedState =================================== .. toctree:: :hidden: struct_gpr_linalg_DistributedState_CholeskyFactorSnapshot.rst struct_gpr_linalg_DistributedState_DescCacheEntry.rst struct_gpr_linalg_DistributedState_TileCommunicators.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class DistributedState { public: // structs struct :ref:`CholeskyFactorSnapshot`; struct :ref:`DescCacheEntry`; struct :ref:`TileCommunicators`; // construction :ref:`DistributedState`(std::shared_ptr`> communication); :target:`~DistributedState`(); // methods static :ref:`DistributedState`& :target:`instance`(); static std::uint64_t :ref:`factorization_generation`(); static :ref:`DistributedBackendKind` :target:`compiled_backend`(); static int :target:`recommended_block_size`(int requested_block, int nprocs); static int :target:`recommended_nprow`(int nprocs, int block_size); static void :ref:`release`(std::vector& buffer); const std::shared_ptr`>& :target:`communication`() const; std::uint64_t :target:`grid_generation`() const; :ref:`DistributedFactorization` :ref:`factorization`() const; bool :target:`reproducible`() const; bool :ref:`exceeds_lp64`(const int* desc) const; bool :ref:`tile_kernels`(const int* desc, const char* routine, const int* other = nullptr) const; void :ref:`require_lp64`(const int* desc, const char* routine) const; void :ref:`set_factorization`(:ref:`DistributedFactorization` mode); :ref:`DistributedBackendKind` :target:`backend_kind`() const; const char* :target:`backend_name`() const; void :ref:`configure`(int block_size, int nprow, bool computation_tile = false); int :target:`configured_block_size`() const; int :ref:`effective_configured_block_size`() const; int :target:`configured_nprow`() const; void :target:`initialize`(int block_size = 0, int nprow = 0); int :ref:`node_ranks`() const; int :ref:`cpu_share`() const; void :target:`make_lin_desc`(int m, int n, int* desc) const; int :target:`lin_local_rows`(int m) const; int :target:`col_block_nb`(int n) const; void :target:`col_block_range`(int n, int& start, int& count) const; void :target:`make_col_desc`(int m, int n, int* desc) const; int :target:`compute_ictxt`() const; int :target:`lin_local_cols`(int n) const; std::vector :target:`scatter_lin`(const :ref:`EigenMatrix`& global, int m, int n, int* desc) const; std::vector :target:`scatter_lin_colvector_root`(const Eigen::VectorXd& global, int m, int* desc) const; Eigen::VectorXd :target:`gather_lin_colvector_root`(const double* local, const int* desc, int m) const; void :target:`make_desc`(int m, int n, int* desc) const; int :target:`local_rows`(int m) const; int :target:`local_cols`(int n) const; int :target:`local_index_for_global`(int global_index, int block_size, int proc_coord, int nprocs_dim) const; int :target:`global_index_for_local`(int local_index, int block_size, int proc_coord, int nprocs_dim) const; std::vector :target:`scatter`(const :ref:`EigenMatrix`& global, int m, int n, int* desc) const; void :target:`scatter_by_panels`(const double* global, int m, int n, const int* desc, double* local, int row, int col, int nprow, int npcol) const; std::vector :target:`alloc_local`(int m, int n, int* desc) const; std::vector :target:`scatter_colvector_root`(const Eigen::VectorXd& global, int m, int* desc) const; :ref:`EigenMatrix` :target:`gather`(const double* local, const int* desc, int m, int n, bool broadcast_result = true) const; :ref:`EigenMatrix` :target:`gather_block`(const double* local, const int* desc, int row0, int col0, int m, int n, bool broadcast_result = true) const; Eigen::VectorXd :target:`gather_colvector_root`(const double* local, const int* desc, int m, bool broadcast_result = true) const; void :target:`cache_L`(std::vector L_dist, const int* desc, int n); void :target:`claim_cached_L`(const void* owner); bool :target:`cached_L_owned_by`(const void* owner) const; bool :target:`cached_L_is_unowned`() const; :ref:`CholeskyFactorSnapshot` :target:`take_cached_L`(const void* owner); bool :target:`restore_cached_L`(:ref:`CholeskyFactorSnapshot` snapshot, const void* owner); bool :target:`has_cached_L`() const; const double* :target:`cached_L`() const; double* :target:`cached_L_mut`(); bool :target:`has_cached_U`() const; void :target:`cache_U`(std::vector U); const double* :target:`cached_U`() const; const int* :target:`cached_L_desc`() const; int :target:`cached_n`() const; void :target:`invalidate_L`(); void :target:`cache_L_lin`(std::vector L_dist, const int* desc, int n); bool :target:`has_cached_L_lin`() const; const double* :target:`cached_L_lin`() const; double* :target:`cached_L_lin_mut`(); const int* :target:`cached_L_lin_desc`() const; int :target:`cached_lin_n`() const; void :target:`cache_inv`(std::vector inv_dist, const int* desc, int n); std::size_t :target:`inverse_builds`() const; bool :target:`has_cached_inv`() const; const double* :target:`cached_inv`() const; const int* :target:`cached_inv_desc`() const; int :target:`cached_inv_n`() const; void :target:`invalidate_inv`(); void :target:`invalidate_derived_cholesky`(); bool :target:`owns_global_entry`(int global_row, int global_col) const; bool :target:`owns_lin_entry`(int global_row, int global_col) const; const double* :ref:`cached_inv_block`(int global_row, int global_col, int& leading_dimension) const; double :target:`cached_inv_local_entry`(int global_row, int global_col) const; int :target:`context`() const; int :target:`lin_context`() const; MPI_Comm :target:`world_comm`() const; int :target:`lin_myrow`() const; int :target:`lin_mycol`() const; int :target:`nprocs`() const; int :target:`myrank`() const; int :target:`myrow`() const; int :target:`mycol`() const; int :target:`nprow`() const; int :target:`npcol`() const; int :target:`block_size`() const; bool :target:`is_root`() const; :ref:`TileCommunicators` :target:`tile_communicators`(int context = -1); }; .. _details-classgpr_1_1linalg_1_1_distributed_state: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Construction ------------ .. index:: pair: function; DistributedState .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1aa6aa5f46163eba31a046c05e69b95b72: .. ref-code-block:: cpp :class: doxyrest-title-code-block DistributedState(std::shared_ptr`> communication) Construct independent factor storage on a shared process group. Grid initialization and destruction are collective on that group. Methods ------- .. index:: pair: function; factorization_generation .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1af1b1f163f20de2218b738fcab932cd21: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::uint64_t factorization_generation() Generation of the factorization selection; a factor held outside this state records it and is not reused under another selection. .. index:: pair: function; release .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1a137843e23fdd4bf3d4d8e2a4e54fb95d: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void release(std::vector& buffer) Returns the storage of buffer to the allocator. .. index:: pair: function; factorization .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1adebddaee1af00cc52238e7f1fd3a17f8: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DistributedFactorization` factorization() const Distributed factorization the solves of this state use. The selection is process-wide; see configureDistributedFactorization. .. index:: pair: function; exceeds_lp64 .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1a14caf8ed6e19878def98c94dde73c938: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool exceeds_lp64(const int* desc) const True when an LP64 ScaLAPACK routine cannot index the local arrays of desc on its process grid (``Lp64Limits.h``). The answer depends on the descriptor fields only, so every process of the grid agrees. .. index:: pair: function; tile_kernels .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1a3825ce17200df1862286599600f0a6e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool tile_kernels(const int* desc, const char* routine, const int* other = nullptr) const True when a factorization, substitution or inverse on desc (and on the second operand other, when given) runs on the tile kernels: always under the reproducible selection, and under the library selection when the LP64 ScaLAPACK routine would overflow its element offsets on either operand. The tile kernels index in 64 bits. The first rerouted call of a process prints one line on the root rank. .. index:: pair: function; require_lp64 .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1a626907e78c0631f508629c05afa4909e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void require_lp64(const int* desc, const char* routine) const Throws std::length_error, on every process alike, when routine has no tile counterpart and its LP64 offsets on desc would overflow. .. index:: pair: function; set_factorization .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1ad3a32a6999f307365300cadb6262a05a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void set_factorization(:ref:`DistributedFactorization` mode) Select the factorization and drop every cached factor, transpose, replica and inverse. Caches of other states compare the generation they were computed under and read as absent after the change. .. index:: pair: function; configure .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1a176286519b1f883e2d850be30a87bd29: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configure(int block_size, int nprow, bool computation_tile = false) Fix the grid that initialize builds. A positive block_size or nprow overrides what callers request. With computation_tile, a non-positive block_size selects the automatic computation tile (recommended_block_size) wherever the block also sets the arithmetic: in SLATE builds and under the reproducible factorization. Block sizes callers pass to initialize then describe a data layout, such as an observation stride, and do not choose the tile. The choice follows the factorization selected when initialize runs. .. index:: pair: function; effective_configured_block_size .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1a20f36f27fd35179109918cf81aa12b82: .. ref-code-block:: cpp :class: doxyrest-title-code-block int effective_configured_block_size() const Block size initialize takes over the caller's request; zero when the caller's request stands. .. index:: pair: function; node_ranks .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1adf9c87b04a7fd62ec4fd298c9e8b90d0: .. ref-code-block:: cpp :class: doxyrest-title-code-block int node_ranks() const Ranks of this process group on this node (one before initialize). .. index:: pair: function; cpu_share .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1ae857fcfbb6ca5c4229c1657803a971db: .. ref-code-block:: cpp :class: doxyrest-title-code-block int cpu_share() const CPUs of this process's affinity mask divided among the ranks of the group on this node whose masks overlap it, at least one; zero before initialize or where affinity is unknown. Unbound ranks launched on one node all see the whole mask and share it; ranks bound to disjoint CPUs keep their own. .. index:: pair: function; cached_inv_block .. _doxid-classgpr_1_1linalg_1_1_distributed_state_1a7929b4ed05449817a1ae222a638a78b3: .. ref-code-block:: cpp :class: doxyrest-title-code-block const double* cached_inv_block(int global_row, int global_col, int& leading_dimension) const Local storage of the cached inverse at a global entry this rank owns, with the leading dimension of the local buffer; entries of the same block-cyclic block follow at unit row and leading-dimension column offsets.