Graph (abstract data type)
Distributed memory

In the distributed memory model, the usual approach is to partition the vertex set V {\displaystyle V} of the graph into p {\displaystyle p} sets V 0, …, V p − 1 {\displaystyle V_{0},\dots,V_{p-1}}. Here, p {\displaystyle p} is the amount of available processing elements (PE). The vertex set partitions are then distributed to the PEs with matching index, additionally to the corresponding edges. Every PE has its own subgraph representation, where edges with an endpoint in another partition require special attention. For standard communication interfaces like MPI, the ID of the PE owning the other endpoint has to be identifiable. During computation in a distributed graph algorithms, passing information along these edges implies communication.

Partitioning the graph needs to be done carefully - there is a trade-off between low communication and even size partitioning But partitioning a graph is a NP-hard problem, so it is not feasible to calculate them. Instead, the following heuristics are used.

1D partitioning: Every processor gets n / p {\displaystyle n/p} vertices and the corresponding outgoing edges. This can be understood as a row-wise or column-wise decomposition of the adjacency matrix. For algorithms operating on this representation, this requires an All-to-All communication step as well as O (m) {\displaystyle {\mathcal {O}}(m)} message buffer sizes, as each PE potentially has outgoing edges to every other PE.

2D partitioning: Every processor gets a submatrix of the adjacency matrix. Assume the processors are aligned in a rectangle p = p r × p c {\displaystyle p=p_{r}\times p_{c}}, where p r {\displaystyle p_{r}} and p c {\displaystyle p_{c}} are the amount of processing elements in each row and column, respectively. Then each processor gets a submatrix of the adjacency matrix of dimension (n / p r) × (n / p c) {\displaystyle (n/p_{r})\times (n/p_{c})}. This can be visualized as a checkerboard pattern in a matrix. Therefore, each processing unit can only have outgoing edges to PEs in the same row and column. This bounds the amount of communication partners for each PE to p r + p c − 1 {\displaystyle p_{r}+p_{c}-1} out of p = p r × p c {\displaystyle p=p_{r}\times p_{c}} possible ones.
oulipo:avoid_letter[a], change_case:capital_word_frequency[2]