Skip to main content
QUICK REVIEW

[Paper Review] Decomposition of stencil update formula into atomic stages

Qiqi Wang|arXiv (Cornell University)|Jun 2, 2016
Diamond and Carbon-based Materials Research36 references3 citations
TL;DR

This paper presents an efficient algorithm to decompose complex stencil update formulas—used in solving partial differential equations—into a sequence of atomic stages, each accessing only immediate neighbors. By formulating the decomposition as the dual of a minimum-cost network flow problem, the method enables fast, optimal decomposition, as demonstrated by decomposing a complex 3D Euler equation stencil into 8 stages in under 0.25 seconds on a standard CPU.

ABSTRACT

In parallel solution of partial differential equations, a complex stencil update formula that accesses multiple layers of neighboring grid points sometimes must be decomposed into atomic stages, ones that access only immediately neighboring grid points. This paper shows that this requirement can be formulated as constraints of an optimization problem, which is equivalent to the dual of a minimum-cost network flow problem. An optimized decomposition of a single stencil on one set of grid points can thereby be computed efficiently.

Motivation & Objective

  • To address the challenge of efficiently decomposing complex stencil update formulas into atomic stages for use in massively parallel computing.
  • To enable the application of advanced parallel algorithms—like swept decomposition—that require atomic update formulas with only immediate neighbor access.
  • To provide a pre-processing step for stencil compilers and loop optimizers such as OP2, Patus, and Simit.
  • To reduce computational complexity in stencil-based PDE simulations by transforming large-stencil formulas into sequences of compact, manageable stages.
  • To automate and optimize the decomposition process, avoiding brute-force combinatorial search for complex stencils.

Proposed method

  • Formulate the stencil decomposition problem as a constrained optimization task, where each stage must be atomic (only immediate neighbors) and preserve input-output semantics.
  • Reformulate the problem as the dual of a minimum-cost network flow problem, enabling efficient solution via linear programming.
  • Model the stencil update formula as a computational graph with vertices (operations) and edges (data dependencies), where node values represent intermediate results.
  • Use network flow duality to derive a linear program that minimizes the number of stages while respecting data dependencies and atomicity constraints.
  • Apply efficient linear programming solvers to compute the optimal decomposition, leveraging the problem's special structure for speed.
  • Implement the algorithm in Python and integrate it as a pre-processor for stencil compilers and numerical simulation frameworks.

Experimental results

Research questions

  • RQ1Can complex stencil update formulas with large stencils be systematically and efficiently decomposed into atomic stages that access only immediate neighbors?
  • RQ2Is there a mathematical formulation that transforms the combinatorially complex decomposition problem into a tractable optimization problem?
  • RQ3Can the decomposition be computed quickly enough for practical use in high-performance computing workloads?
  • RQ4Does the dual of a minimum-cost network flow problem provide an exact and optimal solution for stencil decomposition?
  • RQ5Can this method be applied to real-world, high-order PDE solvers such as the 4th-order Runge-Kutta scheme for the 3D Euler equations?

Key findings

  • The decomposition of a complex 3D Euler equation update formula with a stencil spanning 8 levels of neighbors was successfully computed in approximately 0.25 seconds on a standard laptop CPU.
  • The resulting decomposition consisted of 8 atomic stages, with an average of 186.625 nodes per stage and 6.785 shared nodes between consecutive stages.
  • The computational graph for the Euler equation formula contained 1424 vertices and 2106 edges, of which 432 were swept edges, indicating significant data reuse across stages.
  • The method achieved optimal decomposition by solving the dual of a minimum-cost network flow problem, avoiding the intractable combinatorial complexity of brute-force search.
  • The algorithm enables automatic and efficient pre-processing for stencil compilers and parallel execution frameworks, significantly simplifying the deployment of complex numerical schemes.
  • The approach is general and applicable to any stencil update formula, including high-order time integrators and conservative finite difference schemes with complex stencils.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.