NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

The Reverse Cuthill-McKee Algorithm in Distributed-Memory

Ariful Azad, Mathias Jacquelin, Aydin Buluç, Esmond G. Ng

TL;DR

This paper presents the first distributed-memory implementation of the Reverse Cuthill-McKee (RCM) algorithm, a crucial graph ordering technique for improving the performance of sparse matrix computations. By reformulating RCM using matrix-algebraic primitives and a 2D data decomposition, the authors achieve significant speedups and demonstrate scalability up to 4096 cores, overcoming previous limitations of applying RCM to large-scale, distributed datasets.

What Problem Does This Paper Address?

In scientific computing, many problems are modeled using sparse matrices, which represent systems with mostly zero entries. Ordering the vertices (or rows/columns) of the graph associated with these matrices is vital for optimizing various numerical algorithms. Specifically, techniques like the Reverse Cuthill-McKee (RCM) algorithm aim to reduce the "bandwidth" or "profile" of a matrix, clustering non-zero elements closer to the diagonal. This leads to more efficient memory access patterns, reduced communication in parallel solvers, and ultimately, faster computations.

However, traditional RCM implementations are sequential and require gathering the entire sparse matrix onto a single node. This becomes a major bottleneck on modern extreme-scale computing systems where matrices are often already distributed across many nodes. Efficiently parallelizing RCM for distributed-memory architectures has been a long-standing challenge due to the dynamic nature of its core operations (like Breadth-First Search) and the inherent difficulties in load balancing and communication management.

Methods

The authors tackle this challenge by leveraging the duality between graph algorithms and sparse matrix operations. They reformulate the RCM algorithm and its prerequisite, finding a pseudo-peripheral vertex, using a set of matrix-algebraic primitives. These primitives, such as sparse matrix-sparse vector multiplication (SpMSpV) and sorting operations, are then implemented in a distributed-memory setting using a 2D decomposition of the sparse matrix and vectors.

Key aspects of their approach include:

  • Matrix-Algebraic Formulation: RCM and pseudo-peripheral vertex finding are expressed as sequences of operations on sparse matrices and vectors, abstracting away direct graph traversal.
  • 2D Data Decomposition: The sparse matrix and vectors are distributed across a 2D grid of processors, enabling parallel computation.
  • Optimized Primitives: They rely on optimized implementations of matrix-algebraic primitives, particularly a specialized SpMSpV operation that uses a (select2nd, min) semiring. This semiring ensures that a vertex is attached to the parent with the minimum label, a crucial aspect of RCM's deterministic behavior.
  • Distributed Sorting: A distributed bucket sort algorithm is developed for the SORTPERM primitive, which is critical for ordering vertices within a level based on parent labels and degrees. This approach uses AllToAll communication patterns for efficient tuple exchange and sorting.
  • Hybrid OpenMP-MPI Implementation: The implementation utilizes both MPI for inter-node communication and OpenMP for intra-node multithreading, allowing it to exploit parallelism at multiple levels.

Datasets

The authors evaluated their implementation on a suite of sparse matrices from real-world applications, including:

  • nd24k (3D mesh problem)
  • Idoor (gas reservoir simulation)
  • Serena (structural problem)
  • audikw_1 (structural problem)
  • dielFilterV3real (higher-order finite element)
  • Flan_1565 (3D model of a steel flange)
  • Li7Nmax6 (nuclear configuration interaction)
  • Nm7 (nuclear configuration interaction)
  • nlpkkt240 (symmetric indefinite KKT matrix)

These matrices are sourced from the University of Florida Sparse Matrix Collection [21] and nuclear configuration interaction calculations [22]. The paper does not introduce new benchmark datasets but uses a representative set of existing ones.

Key Insights and Ideas

  • Matrix-Algebraic Abstraction is Key: Reformulating graph algorithms like RCM into matrix-algebraic operations is a powerful strategy for leveraging highly optimized parallel linear algebra libraries and achieving scalability.
  • Deterministic BFS is Challenging but Achievable: The specific semiring used in SpMSpV (select2nd, min) makes the BFS deterministic, which is essential for RCM. While this adds complexity, the matrix-algebraic formulation hides it effectively.
  • Sorting is a Bottleneck, but Distributed Solutions Work: The SORTPERM operation, involving distributed sorting, becomes a significant cost at high concurrency. However, their specialized distributed bucket sort proves effective and competitive with general sorting libraries.
  • Diameter Matters for Scalability: The performance and scalability of the RCM algorithm are significantly influenced by the graph's diameter. Higher diameter graphs lead to more communication overhead and can limit scaling, as seen with matrices like Idoor.
  • Distributed RCM Avoids Costly Data Gathering: A major advantage of their approach is eliminating the need to gather distributed matrices onto a single node, which is a substantial cost for large-scale problems.

Key Results

  • Scalable Performance: The distributed-memory RCM implementation demonstrates strong scaling up to 1024 cores for smaller matrices and up to 4096 cores for larger matrices on the Cray XC30 supercomputer.
  • Significant Speedups: The algorithm achieves impressive speedups, with a maximum of 38x for Li7Nmax6 and 27x for nd24k on 1024 cores.
  • Competitive with Sequential: When considering the overhead of gathering data for sequential RCM, their distributed approach is often faster, even for moderate core counts.
  • Bandwidth Reduction: The RCM ordering produced by their distributed implementation is comparable in quality (bandwidth reduction) to state-of-the-art sequential methods.
  • SpMSpV Dominates: The SpMSpV primitive is identified as the most computationally expensive part of the algorithm, and its communication cost becomes dominant at higher concurrencies.

Limitations and Future Work

  • Diameter Sensitivity: The current level-synchronous BFS formulation struggles with high-diameter graphs, limiting scalability in such cases.
  • Sorting Alternatives: The authors suggest exploring alternatives to global sorting, potentially sacrificing some quality for better performance.
  • Non-Level-Synchronous BFS: Investigating BFS formulations that are not strictly level-synchronous is a promising direction to improve performance on high-diameter graphs.
  • Memory Constraints: For very large matrices, even the distributed approach can encounter memory limitations on individual nodes, as observed with Nm7 and nlpkkt240 on a single node.

Summary updated

BibTeX
@inproceedings{azad2017reverse,
  author = {Ariful Azad and Mathias Jacquelin and Aydin Buluç and Esmond G. Ng},
  title = {{The Reverse Cuthill-McKee Algorithm in Distributed-Memory}},
  booktitle = {IPDPS},
  year = {2017},
  doi = {10.1109/ipdps.2017.85},
}
Figure