← Research

EuroHPC Inno4scale · 2024–2025

AMCG

Asynchronous modified conjugate gradient method: linear solvers without global sums or synchronised communication. On the pressure equation of a 24-million-cell combustor, the asynchronous solver in OpenFOAM® was 3.1 times faster at 1.6 times lower cost. Innovation study with INRIA.

Three square domains split into four partitions: one global Krylov space, one local Krylov space per rank, and N coupled Krylov spaces

AMCG, Asynchronous Modified Conjugate Gradient Method, was an innovation study within the EuroHPC project Inno4scale, carried out by Wikki GmbH and the Alpines team of INRIA Paris and Sorbonne University. It developed conjugate gradient solvers that need neither global sums nor synchronised communication between processors.

Highlights

The challenge

Most simulation codes spend a large part of their run time in linear solvers, and at scale they are limited by the cost of communication: global sums and the exchange of data across partition boundaries. In the exaFOAM project, profiling of the 489-million-cell DLR combustor case prepared by Wikki showed a parallel efficiency of only 25–30 % of the solvers at more than 32,000 cores. A large part of the loss came from global reductions, where every process waits for all the others.

The effect is largest for “light-weight” problems such as the pressure equation in transient CFD: each solution needs only a few iterations, so the synchronisation in every iteration dominates.

The solution

The classic CG method advances one Krylov space for the global problem, which needs global sums in every iteration. AMCG instead treats each partition as its own problem and advances one Krylov space per MPI rank. The coupling to the neighbouring partitions enters as an additional source term that is updated whenever new boundary data arrive.

Three square domains split into four partitions: one global Krylov space with one alpha and beta; one local Krylov space with its own alpha and beta per partition; N coupled Krylov spaces
Decoupling the partitions. Left: standard PCG with one global Krylov space. Centre: aPCG with one local Krylov space and its own step length α and search direction β per MPI rank. Right: enlarged CG with N coupled Krylov spaces.

The asynchronous PCG uses the Polak–Ribière–Polyak search direction and runs without synchronisation from start to finish. Boundary data are exchanged with MPI one-sided communication (MPI_Put, MPI_Get), so each rank keeps computing while the data move in the background. The global residual is only checked when it changes significantly, and the solver terminates through an asynchronous hierarchical count-down instead of a global sum.

Execution timeline of two processes in standard PCG with red idle periods at every MPI wait and reduction
Execution timeline of a simplified standard PCG with two-sided MPI communication. Idle periods (red) appear at every MPI_Waitall and global reduction.
Execution timeline of two processes in asynchronous PCG without idle periods, with small markers for filling the MPI window
The same for aPCG with one-sided communication: data are placed in an MPI window (black markers) while the computation continues, so the idle periods disappear.
Colourful trace of 256 MPI ranks over time, mostly computation with very little waiting
Score-P/Vampir trace of aPCG in OpenFOAM: 256 ranks with about 11,000 cells each.

Performance

The aPCG solver was tested on the pressure equation of the DLR combustor case from the exaFOAM project (large-eddy simulation of a jet flame) with 3 and 24 million cells, on LUMI-C (AMD EPYC, 128 cores per node) and MareNostrum 5 (Intel Sapphire Rapids, 112 cores per node).

LUMI

Two plots against the number of cores on LUMI: speed-up and parallel efficiency of aPCG and standard PCG relative to PCG on one node; aPCG is higher at all core counts
Strong scaling of the pressure solution for the 24-million-cell DLR combustor on LUMI, 128 to 16,384 cores (1 to 128 nodes). Left: speed-up relative to PCG on one node. Right: parallel efficiency relative to PCG on one node; values above 1 mean superlinear speed-up. Dark blue: aPCG; light green: standard PCG; dashed green: ideal scaling. Top axis: cells per core.

The standard PCG is most cost-effective at 1,024 cores (12.8 ms per pressure solution), aPCG at 2,048 cores (4.1 ms). Comparing these two points, aPCG solves the equation 3.1 times faster at 1.6 times lower cost.

MareNostrum 5

Two plots against the number of cores on MareNostrum 5: speed-up and parallel efficiency of aPCG and standard PCG relative to PCG on one node; aPCG is higher at all core counts
Strong scaling of the pressure solution for the 24-million-cell DLR combustor on MareNostrum 5, 112 to 7,168 cores (1 to 64 nodes). Left: speed-up relative to PCG on one node. Right: parallel efficiency relative to PCG on one node. Dark blue: aPCG; light green: standard PCG; dashed green: ideal scaling. Top axis: cells per core.

The standard PCG is most cost-effective at 896 cores (14.4 ms per pressure solution), aPCG at 1,792 cores (4.7 ms): again 3.1 times faster at 1.5 times lower cost. The standard PCG stops scaling at 3,584 cores (6.9 ms), where aPCG needs 3.1 ms, 2.2 times less.

Applications

The algorithm is designed for problems where the classic PCG needs only a few iterations. Such matrices arise in every transient CFD code that solves a pressure equation, and in many other simulations that solve similar systems at scale. Because the ranks no longer wait for each other, ranks that have converged locally could help slower partitions (fine-grained load balancing) or go idle to save energy.

Partners

Dissemination

Funding

AMCG was carried out as an innovation study within the Inno4scale project, which has received funding from the European High-Performance Computing Joint Undertaking (JU) under grant agreement No 101118139. The JU receives support from the European Union’s Horizon Europe Programme.

← Back to research · Contact us about this project