Distributed-Memory Breadth-First Search on Massive Graphs

Aydin Buluç, Scott Beamer, Kamesh Madduri, Krste Asanovic, David A. PattersonarXiv 2017

Abstract

This chapter studies the problem of traversing large graphs using the breadth-first search order on distributed-memory supercomputers. We consider both the traditional level-synchronous top-down algorithm as well as the recently discovered direction optimizing algorithm. We analyze the performance and scalability trade-offs in using different local data structures such as CSR and DCSC, enabling in-node multithreading, and graph decompositions such as 1D and 2D decomposition.

Introduction

Traversing large graphs is a fundamental building block for data science, social network analysis, and bioinformatics. However, parallelizing Breadth-First Search (BFS) is notoriously difficult on distributed-memory systems. The primary challenges include low computational intensity—where the work per edge is minimal, making the algorithm bound by memory bandwidth and network latency—and irregular access patterns that hinder traditional caching and communication strategies.

On distributed-memory clusters, the "communication wall" often prevents scaling. Traditional 1D partitioning, which assigns vertices to processors, requires every processor to potentially communicate with every other processor, creating a massive $O(p)$ communication bottleneck as the number of processors $p$ increases. This paper presents a highly scalable distributed BFS algorithm that overcomes these limitations by combining 2D matrix decomposition with direction-optimization.

Methodology

The proposed approach leverages several key innovations to achieve high performance and scalability.

2D Data Decomposition

Instead of partitioning vertices (1D), the graph's adjacency matrix is partitioned into a 2D grid of $p_r \times p_c$ blocks. This limits communication: a processor only needs to communicate with others in its own row or column, reducing the number of communicating partners to $O(\sqrt{p})$.

2D Data Decomposition and Communication Pattern

As shown in the figure, the adjacency matrix $A$ is divided into sub-blocks $A_{i,j}$. Communication of the frontier (represented by vectors $c$) occurs along rows and columns, significantly reducing the total number of messages compared to 1D partitioning schemes.

Direction-Optimization

The algorithm switches between two search strategies based on the size of the frontier:

  • Top-Down: The standard approach where the current frontier looks for unvisited neighbors. This is efficient when the frontier is small.
  • Bottom-Up: Unvisited nodes look for parents in the frontier. This is particularly effective for "small-world" graphs. When the frontier is large, an unvisited node can stop searching as soon as it finds any parent in the frontier, skipping a vast majority of edge examinations.

Hypersparse Data Structures and Multithreading

For 2D partitioning, local subgraphs become "hypersparse," containing more rows/columns than non-zero edges. The authors utilize the Doubly Compressed Sparse Column (DCSC) representation, which is more memory-efficient than the standard Compressed Sparse Row (CSR) format in these scenarios. Furthermore, in-node multithreading is used to reduce the number of MPI processes, decreasing network contention and improving memory efficiency through shared data structures.

Experimental Results

The implementation was evaluated using synthetic R-MAT graphs (up to $2^{34}$ vertices) and a real-world Twitter social network dataset (~61.5 million vertices, 1.47 billion edges).

The direction-optimizing version demonstrated significant performance gains, running 6.5x to 7.9x faster than the purely top-down 2D implementation. The algorithm showed extreme scalability, running on up to 115,600 cores on the Cray XE6 (Hopper) and demonstrating superior per-core performance on the Cray XC30 (Edison). On the Twitter dataset, the direction-optimizing approach completed a full BFS in just 0.08 seconds using 1,440 cores.

Discussion and Conclusion

The most significant insight is the efficiency of the bottom-up approach: in the middle of a BFS on a small-world graph, the frontier is so large that an unvisited node is almost guaranteed to find a parent quickly. This transforms the search complexity in practice. While the bottom-up approach requires more communication rounds, it drastically reduces the volume of data sent.

Future work includes addressing latency sensitivity on high-latency networks and further tuning the heuristic "switch point" between top-down and bottom-up strategies. Additionally, while this study focused on CPUs, exploring GPU-accelerated distributed 2D BFS remains a promising direction for future exploration.

Summary updated

BibTeX
@misc{buluc2017distributed,
  author = {Aydin Buluç and Scott Beamer and Kamesh Madduri and Krste Asanovic and David A. Patterson},
  title = {{Distributed-Memory Breadth-First Search on Massive Graphs}},
  year = {2017},
  eprint = {1705.04590},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1705.04590},
}
Figure