Classes to represent graphs and functions to manipulate them (coloring, etc.).
More...
|
| class | CCompressedSparsePattern< Index_t > |
| | A simple class to store adjacency information in a compressed format suitable for sparse matrix operations. If built for row-major storage the inner indices are column indices and the pattern should be used as (row,icol), otherwise as (col,irow). More...
|
| |
| struct | GridColor< T > |
| | A way to represent one grid color that allows range-for syntax. More...
|
| |
| struct | DummyGridColor< T > |
| | A way to represent natural coloring {0,1,2,...,size-1} with zero overhead (behaves like looping with an integer index, after optimization...). More...
|
| |
| class | CGraphColoringStructure |
| | Class, which provides distributed graph coloring algorithms. More...
|
| |
|
| template<class Geometry_t , typename Index_t > |
| CCompressedSparsePattern< Index_t > | buildCSRPattern (Geometry_t &geometry, ConnectivityType type, Index_t fillLvl) |
| | Build a sparse pattern from geometry information, of type FVM or FEM, for a given fill-level. At fill-level N, the immediate neighbors of the points in level N-1 are also considered neighbors of the base point. The resulting pattern is that of A^{N+1} where A is the sparse matrix of immediate neighbors.
|
| |
| template<typename Index_t > |
| CCompressedSparsePattern< Index_t > | buildLowerPattern (const CCompressedSparsePattern< Index_t > &csr) |
| | Extract the strictly-lower part of a symmetric compressed sparse pattern. For each row i, the lower entries are those at positions [outerPtr[i], diagPtr[i]).
|
| |
| template<typename Index_t > |
| CCompressedSparsePattern< Index_t > | buildUpperPattern (const CCompressedSparsePattern< Index_t > &csr) |
| | Extract the strictly-upper part of a symmetric compressed sparse pattern. For each row i, the upper entries are those at positions (diagPtr[i], outerPtr[i+1]).
|
| |
| template<typename Index_t > |
| void | buildLUTransposeMaps (const CCompressedSparsePattern< Index_t > &pattern_l, const CCompressedSparsePattern< Index_t > &pattern_u, su2vector< Index_t > &l_to_u, su2vector< Index_t > &u_to_l) |
| | Build bijective maps between strictly-lower (L) and strictly-upper (U) non-zero entries that are each other's transposes. Requires a symmetric pattern. l_to_u[k_l] = k_u such that U-entry k_u is the transpose of L-entry k_l, and vice-versa.
|
| |
| template<class T = CCompressedSparsePatternUL, class Index_t = typename T::IndexType> |
| T | createNaturalColoring (Index_t numInnerIndexes) |
| | Create the natural coloring (equivalent to the normal sequential loop order) for a given number of inner indexes.
|
| |
| template<typename Color_t = unsigned char, size_t MaxColors = 255, size_t MaxMB = 128, class T > |
| T | colorSparsePattern (const T &pattern, size_t groupSize=1, bool includeOuterIdx=false, bool balanceColors=false, std::vector< Color_t > *indexColor=nullptr) |
| | Color contiguous groups of outer indices of a sparse pattern such that within each color, any two groups do not have inner indices in common.
|
| |
| template<class SparsePattern > |
| su2double | coloringEfficiency (const SparsePattern &coloring, int numThreads, int chunkSize) |
| | Computes the efficiency of a grid coloring for given number of threads and chunk size.
|
| |
| template<class T > |
| T | computeLevels (const T &pattern) |
| | Compute the levels for the lower part of a sparse pattern. For example, corresponding to the dependencies of forward substitution.
|
| |
Classes to represent graphs and functions to manipulate them (coloring, etc.).
template<class Geometry_t , typename Index_t >
Build a sparse pattern from geometry information, of type FVM or FEM, for a given fill-level. At fill-level N, the immediate neighbors of the points in level N-1 are also considered neighbors of the base point. The resulting pattern is that of A^{N+1} where A is the sparse matrix of immediate neighbors.
- Note
- Algorithm is equivalent to the implementation by F. Palacios, A. Bueno, and T. Economon from CSysMatrix.
- Parameters
-
| [in] | geometry | - Definition of the grid. |
| [in] | type | - Of connectivity. |
| [in] | fillLvl | - Target degree of neighborhood (immediate neighbors always added). |
- Returns
- Compressed-Storage-Row sparse pattern.
template<typename Color_t = unsigned char, size_t MaxColors = 255, size_t MaxMB = 128, class T >
| T colorSparsePattern |
( |
const T & |
pattern, |
|
|
size_t |
groupSize = 1, |
|
|
bool |
includeOuterIdx = false, |
|
|
bool |
balanceColors = false, |
|
|
std::vector< Color_t > * |
indexColor = nullptr |
|
) |
| |
Color contiguous groups of outer indices of a sparse pattern such that within each color, any two groups do not have inner indices in common.
- Note
- Within a group, two outer indices will generally have common inner indices. The coloring is returned as a compressed sparse pattern where the colors are outer indices, and the outer indices of the input pattern are the inner indices of the coloring. A simple greedy algorithm is used. Using a sparse pattern as input allows "anything" to be colored e.g. FVM edges, FEM elements, the rows/columns of a sparse matrix, etc.
-
The worst that can happen in this method is needing an unreasonable number of colors, or too much memory due to a large range of the inner indices. The last two template parameters limit both, in case of failure an empty pattern is returned.
- Parameters
-
| [in] | pattern | - Sparse pattern to be colored. |
| [in] | groupSize | - Size of the outer index groups, default 1. |
| [in] | includeOuterIdx | - If the outer indices are the same type of entity as the inner indices this must be true. For example, when both are point indices, i.e. the pattern is the adjacency matrix. |
| [in] | balanceColors | - Try to balance number of indexes per color, tends to result in worse locality (thus false by default). |
| [out] | indexColor | - Optional, vector with colors given to the outer indices. |
- Returns
- Coloring in the same type of the input pattern.