Heterogeneous CPU/GPU co-execution of CFD simulations on the POWER9 architecture: Application to airplane aerodynamics
Paper · 2020 · R. Borrell, D. Dosimont, M. Garcia-Gasulla et al.
Summary
A fast accelerator can leave a substantial part of a supercomputer node waiting. In an airplane airflow simulation, the graphics processing units, or GPUs, may handle the most expensive calculation faster than the central processing units, or CPUs. The CPUs can still do enough useful work to shorten the calculation if both devices start together and finish at about the same time. Borrell and colleagues investigate how to divide that work in Alya, a computational mechanics code, on the GPU-accelerated MareNostrum POWER9 cluster.
The application is a large-eddy simulation of airflow around an aircraft in a landing configuration. Alya represents the space around the aircraft as a mesh and calculates the contribution of each mesh element to the equations governing the flow. This operation, called element assembly, accounts for the largest share of elapsed time in the authors’ CPU measurements. Alya groups similar elements into packs so that the CPU can process several elements in parallel with vector instructions and the GPU can process much larger groups using many threads. In the tuned node-level comparison for the mixed-element airplane mesh, assembly on the GPUs reaches a speedup of 3.48× over the CPUs.
The authors then run assembly on both kinds of device in the same simulation. Each parallel process receives a piece of the mesh and runs an executable built for its assigned device. Equal pieces would leave the CPUs working long after the GPUs finished, and even processes on the same kind of device can take different amounts of time. Alya therefore measures each process’s assembly time and uses those measurements to move the boundaries between pieces of the mesh. Repeated measurements let it find a division that reflects both device speed and differences in the work within the mesh.
On the 176M-element airplane mesh, the combined execution on 12 nodes reaches 94% load balance in 14 iterations of the balancing procedure. The final GPU assembly subdomains contain roughly 10× as many elements on average as their CPU counterparts. The pressure solver uses the GPUs throughout. Compared with an already balanced GPU-only run, using the CPUs alongside the GPUs cuts element assembly time by 23%. The figure measures the assembly phase, where the authors concentrate the extra computing capacity.
Deep dive: Heterogeneous CPU/GPU co-execution of CFD simulations on the POWER9 architecture: Application to airplane aerodynamics
Alya splits airplane airflow calculations between POWER9 CPUs and V100 GPUs, then uses measured run times to balance their workloads. · about 38 minutes to read
The problem and its context
Why this airflow calculation is expensive
An aircraft in a high-lift landing configuration poses a demanding test for computational fluid dynamics, or CFD. The flow near the aircraft surface can separate, and large movements in the separated flow can develop on relatively slow time scales. The paper explains that Reynolds-averaged Navier–Stokes approaches have had reasonable success estimating quantities such as lift and drag at low angles of attack, where the flow near the surface is mostly attached. It identifies maximum lift and fully stalled conditions as more difficult, particularly for steady calculations that represent the flow through time-averaged quantities.
Large-eddy simulation represents the larger turbulent motions as they change over time. Its equations account separately for the effects of motion at scales too small for the mesh to resolve. Following the changing flow calls for short timesteps, and resolving its spatial structure calls for a fine mesh. The combination matters to computing cost. Each timestep visits many elements, and a useful simulation has to repeat that work across the interval of interest. The paper uses a high-lift aircraft case to study how efficiently a supercomputer can carry out that repeated calculation.
The geometry is the JAXA Standard Model, a wing-body configuration used in the AIAA high-lift prediction workshop described by the authors. The case has a baseline slat and a flap set at 30 degrees, with support brackets present and the nacelle and pylon omitted. The angle of attack is 18.58 degrees. The inflow Mach number is 0.172, and the Reynolds number based on mean aerodynamic chord is 1.93 M. The authors use the low Mach number to justify treating the flow as incompressible for this calculation.
The numerical work varies across the mesh. Parts of the domain contain elements of different shapes and integration rules, so counting elements gives only a first estimate of assembly cost. Boundary work is distributed according to where the mesh touches the surfaces on which that work is needed. A later pressure solve involves repeated operations on values shared between neighboring subdomains. A division that is convenient for the element calculation can therefore have different consequences for the boundary calculation and for communication during the solve.
Why putting the calculation on GPUs leaves a further question
The MareNostrum nodes used in the study combine POWER9 processors with Volta V100 accelerators. The accelerators offer considerable computing capacity, and their performance depends on having enough work to keep many threads occupied. The CPUs have a different organization and can exploit the same numerical calculation through smaller groups of elements and a different arrangement of processes and threads. This is a practical problem in GPU and parallel computing because useful throughput depends on how the program presents the work to each device.
How much a GPU contributes depends on the calculation and the amount of work it receives. The part of Alya that assembles element equations is tied closely to the mesh. It gathers data through the element’s connectivity, performs local calculations, and writes contributions back to arrays shared by elements. The linear solver, by contrast, spends its time on operations such as sparse matrix–vector multiplication and dot products. Different access patterns and different communication requirements make the two phases respond differently to the same hardware.
The authors describe two established approaches for sharing a calculation between CPUs and GPUs. A system such as OmpSs or StarPU can express the calculation as tasks and record which tasks depend on the results of others. For a finite-element calculation, a task might represent an algorithmic stage or work on a small piece of a subdomain. A scheduler launches work whose dependencies have been satisfied. To give it a choice of device for a task, the task needs implementations for the relevant devices. The size of the tasks then affects the balance between scheduling flexibility, scheduling overhead and data transfers.
Another approach assigns each process to a device and varies the amount of mesh assigned to that process. The paper notes earlier uses of this approach on heterogeneous computers. Runtime measurements can guide changes to the partition, and the revised partition can be reused across the distributed calculation once the loads settle. The unit of adjustment is the subdomain. A scheduler working with finer tasks can respond sooner to temporary delays, and the authors describe the two approaches as compatible. A well-divided mesh gives a local scheduler a more even workload to start from.
Why the partition is the authors’ point of control
Alya already splits the mesh into subdomains and assigns each one to a process. The processes communicate through the Message Passing Interface, or MPI, a common interface for data exchange and coordination. In this arrangement, the authors can vary the amount of work given to a process by moving a partition boundary. The same mechanism can address a systematic speed difference between CPUs and GPUs or a persistent difference among processes using the same hardware.
The division has two jobs. It has to distribute computational work, and it has to keep the interfaces between subdomains manageable. Neighboring subdomains exchange values at shared nodes, so the shape of the partition affects communication as well as computation. Graph partitioners represent relationships between mesh entities directly. The paper identifies packages such as ParMetis and PT-Scotch as examples of that approach. Geometric methods instead organize elements by their position. Alya uses a space-filling curve, which orders spatial regions along a line while trying to keep nearby regions close in that ordering. The resulting partition is scalable, and its handling of interface size is indirect.
A first estimate of work can use the number of integration points in each element. The actual time also reflects effects that are hard to assign to individual elements, including how their data lie in memory and what other elements are processed alongside them. Measuring each element would add overhead at the finest scale of the calculation. Measuring a whole subdomain gives the authors information at the scale where they can move a boundary. The paper’s contribution is a way to use those measurements to select new boundaries, with the same procedure serving single-device and combined executions.
The method, step by step
From the flow equations to repeated assembly
Alya is a Fortran code for computational mechanics that the authors identify as available through the Unified European Applications Benchmark Suite. The airplane calculation uses a Galerkin finite-element discretization. The mesh divides the flow region into small pieces, and the discretization represents the unknown velocity and pressure using functions associated with the mesh. Each element contributes terms to the equations, and the assembly operation adds those contributions at the appropriate mesh nodes. The same basic calculation can thus be carried out on separate groups of elements before the processes exchange the values needed at their interfaces.
The equations describe an incompressible flow after spatial filtering. The filtering separates the motions resolved by the calculation from the smaller scales whose effect enters through an additional stress term. The paper’s momentum equation is:
ρ ∂u/∂t + ρ [2u · ε(u) + (∇ · u)u − ½∇|u|²] − ∇ · [2με(u)] + ∇p + ∇ · τ = 0
Here u is the filtered fluid velocity, t is time, p is the modified pressure, ρ is fluid density, and μ is viscosity. The symbol ∂u/∂t denotes the time derivative of velocity. The operator ∇ takes spatial derivatives, and ∇ · denotes divergence. The dot in u · ε(u) contracts velocity with the strain-rate tensor ε(u). The expression |u|² is the squared magnitude of velocity, and τ is the stress tensor representing the unresolved scales. The zero on the right expresses the balance among the terms. The bracketed expression multiplied by density is the convective part in the form used by the authors.
The condition on the divergence of velocity is:
∇ · u = 0
Here u is again the filtered velocity, ∇ · takes its divergence, and the right-hand side imposes incompressibility. The strain-rate tensor used in the momentum equation is defined by:
ε(u) = ½(∇u + (∇u)ᵀ)
In this definition, ε(u) is the symmetric part of the velocity gradient, ∇u is that gradient, and the superscript ᵀ denotes the transpose. The factor ½ averages the gradient and its transpose. These relations apply in the spatial flow domain over the simulation interval, with prescribed initial and boundary conditions.
The form of convection used here is called EMAC. The paper gives its discrete conservation of energy and of linear and angular momentum as reasons for the choice, together with stability. The unresolved stress uses Vreman’s large-eddy formulation. At the aircraft surface, an equilibrium wall law describes the effect of the near-wall flow. At the inlet and boundaries far from the aircraft, the authors prescribe a homogeneous velocity. They start with a uniform velocity in the domain, modifying it at the aircraft walls so that it has zero normal component there.
The temporal scheme is a fractional step method using third-order Runge–Kutta integration. In each timestep, the Runge–Kutta stages repeatedly assemble the element contributions and the wall contributions, update momentum, and correct velocity. The pressure calculation then solves a Poisson equation as part of the projection. Alya assembles the Laplacian matrix before entering the time-stepping loop. To solve the resulting pressure system it uses conjugate gradients with Jacobi diagonal scaling, which rescales the system using the diagonal of its matrix.
This sequence gives the performance study a natural unit. The element calculation recurs at each Runge–Kutta stage. The assembly of the boundary terms also recurs, while the pressure solve follows the stages and has an iterative structure of its own. The co-execution strategy acts on the assembly loops. It leaves the pressure solve on the accelerators and uses the assembly timings to decide where to place the subdomain boundaries.
How a mesh becomes a distributed calculation
The inputs to Alya’s partitioner include the number of elements and the desired number of subdomains. Each element has a position, obtained by averaging its node coordinates. An optional weight describes the estimated cost associated with the element. For the calculations in the paper, the estimate uses the number of Gauss integration points. These are the locations at which the element’s integrals are evaluated numerically. An element with more such points requires more evaluations for the terms that use that rule.
The partitioner first encloses the domain in a box and lays a regular grid over it. Each grid bin receives the weight of the elements assigned to it. The space-filling curve projects the bins onto a single ordering, so the program can express a subdomain as a segment of that ordering. Cutting the ordered bins at successive target weights produces the partition. In the parallel implementation, processes work on sub-boxes and the local portions of the curve are connected to give a single partition. The authors report that the partition is independent of the number of processes used to construct it apart from round-off effects.
Elements belong to disjoint subdomains. A node on the interface between neighboring subdomains is represented in each subdomain that uses it. An element assembly can use the elements owned by its process, with no need to fetch a layer of neighboring elements. Values that must agree across the interface are exchanged when the numerical method calls for them. For example, the execution traces show a residual momentum exchange between stages of the time integration. The measured assembly work and the communication that follows it can therefore be treated as separate parts of the execution.
The pressure solve has more frequent coordination. In a distributed sparse matrix–vector product, a process calculates the part of the result associated with its data and exchanges contributions for shared interface nodes. A dot product requires a collective reduction to combine contributions from the processes. The paper’s conjugate-gradient iteration uses one sparse matrix–vector product and two dot products. A process arriving late at these exchanges can hold up others, and a partition with large interfaces can increase the data exchanged even when computing times are close.
How Alya turns elements into work for each device
Within a CPU subdomain, Alya can create smaller subdomains for shared-memory tasks. Threads inside a process share the data in that process’s memory space. Alya uses loop parallelism in much of the code and task parallelism for the element and boundary assemblies. For assembly, a task processes the elements of one of the smaller subdomains. The paper describes OpenMP features for expressing this work and uses the OmpSs runtime in the hybrid experiments because the compiler and runtime combinations in the study lack the required OpenMP features.
The element calculation itself starts by gathering data from mesh arrays into arrays local to the elements. It then evaluates the terms of the discretization in those local arrays and scatters the resulting contributions back to the mesh arrays. The connectivity of the mesh determines the locations read and written in the gather and scatter stages. Elements with the same shape and integration rule, however, go through the same pattern of calculations once their inputs are available.
Alya exploits that regularity by reordering elements into categories defined by shape and integration rule. It then groups elements from a category into contiguous packs. When a category has too few elements to fill its last pack, the unused entries are padded with zeros. The calculation operates on the pack, so the data for several elements are available together. On a CPU, the pack index provides a dimension for single instruction, multiple data execution, or SIMD. A vector instruction can then apply the same operation to data from several elements.
The paper illustrates the shared implementation using an update to the finite-element mass matrix. Expressed as the contribution of one integration point, the update is:
Ae[q,a,b] ← Ae[q,a,b] + J[q,g] × w[q,g] × N[q,a,g] × N[q,b,g]
Ae is the element mass matrix for each pack entry, and ← assigns its updated value. The index q identifies an element’s position in the pack. The indices a and b select the two element nodes associated with the matrix entry, and g selects a Gauss integration point. J is the Jacobian factor for mapping the element’s integration coordinates, w is the integration weight, and N is a shape function evaluated at that point for the indexed node. The multiplication combines those factors, and the addition accumulates the result with the contributions already in Ae. The code repeats the update across integration points and node pairs.
On the CPU path the pack is the innermost array dimension, and the compiler can use a size known at compilation to generate vector instructions. The GPU path exposes an explicit loop over the pack entries to OpenACC, which directs the work to the accelerator. The data layout serves both paths, and they can choose different pack sizes and compilation settings. The GPU launches many threads for the same pack, grouping those threads into blocks. In the paper’s implementation their relationship is:
PACK_SIZE = blocks × threads
PACK_SIZE is the number of elements in a pack and the total number of threads launched for the parallelized pack loop. blocks is the number of thread blocks in the launch, threads is the number of threads in each block, and × denotes multiplication. The OpenACC vector length controls the thread count used within those groups in the reported configuration. The number of blocks that can be active together also depends on resources needed by the threads, including registers and shared memory.
A production assembly needs space for several arrays on the GPU. Alya manages these transfers explicitly and processes batches of packs within the device’s physical memory, which is 16 GB per accelerator on the study system. The work on separate packs permits a pipeline. Independent asynchronous streams allow transfers for one batch to overlap with calculation on another when resources permit. Larger packs can supply more parallel work, while the memory footprint of a pack limits how many streams can be used concurrently. The best pack size and stream count are thus choices for the complete data and execution arrangement.
How timings move the boundaries
The authors keep the integration-point weights and vary the amount of total weight assigned to each process. This distinction is central to the method. The weights give the partitioner a spatial distribution of approximate cost, while an adjustment for a whole subdomain can absorb a device speed difference or a systematic error in the local cost estimate. The program measures the elapsed assembly time for each process, changes the subdomain targets, and measures again after repartitioning.
How Alya places and balances assembly work
The steps in order.
To specify the targets, let the total weight be the sum of the estimated element weights:
W = ∑ⱼ₌₁ᴺ wⱼ
W is the total weight, N is the number of mesh elements, j indexes the elements, and wⱼ is the weight of element j. The sum runs across the entire mesh.
The target weight for a single subdomain is:
Γᵢ = λᵢ × W/P
Γᵢ is the target for subdomain i, λᵢ is its correction coefficient, W is the full mesh weight, and P is the number of subdomains. W/P is the nominal weight for an equal division. In these units the cumulative coefficients cover P at the end of the curve, so multiplying by W/P distributes the full weight W. The paper’s description of the normalization is internally inconsistent. The target-weight formula and the terminal boundary both specify the scale in units of nominal subdomain weight.
For the timing calculation, the mean in a balancing iteration is:
t̄ᵏ = (∑ⱼ₌₁ᴾ tⱼᵏ)/P
t̄ᵏ is the mean measured assembly time across processes in balancing iteration k. The superscript k denotes the iteration, j is the process index, tⱼᵏ is the elapsed assembly time for process j in that iteration, and P is the number of processes and their subdomains. A balancing iteration is an observation and adjustment of the partition, distinct from a Runge–Kutta stage or an iteration of conjugate gradients.
For a boundary after subdomain i, the algorithm adds the times on the portion of the curve up to that boundary:
Tᵢᵏ = ∑ⱼ₌₁ⁱ tⱼᵏ
Tᵢᵏ is the cumulative elapsed assembly time through subdomain i in balancing iteration k. The index j runs through the subdomains in curve order, and tⱼᵏ is their individual measured time. The sum is a statistic built from concurrent processes’ separate times. It serves as an observation for locating a split.
The cumulative time is placed on a common scale by dividing by the current mean:
Υᵢᵏ = Tᵢᵏ/t̄ᵏ
Υᵢᵏ is the normalized cumulative time for the boundary after subdomain i in iteration k, Tᵢᵏ is the cumulative assembly time through that boundary, and t̄ᵏ is the mean rank time. If the processes up to a boundary have collectively consumed their corresponding share of the summed time, the normalized value equals i. A value above the target means that the prefix accounts for too large a share of the measured time in that observation.
The corresponding position of the boundary is expressed as a cumulative correction coefficient:
Λᵢᵏ = ∑ⱼ₌₁ⁱ λⱼᵏ
Λᵢᵏ is the cumulative coefficient through subdomain i at iteration k. The index j runs up to i, and λⱼᵏ is the coefficient used for subdomain j at that iteration. Through the target-weight formula, this cumulative value determines how much mesh weight should lie on the prefix of the curve. A boundary therefore has an observed pair consisting of the requested cumulative weight in these units and the cumulative time achieved in the resulting run.
Alya fits each split independently using a linear regression:
y = α + βx
For the particular split being fitted, x is a cumulative correction coefficient, y is the predicted normalized cumulative time, α is the fitted intercept, and β is the fitted slope. The observations across balancing iterations supply the values for the fit. When the line predicts the target time share at a particular position, that position becomes the next target for the split.
Λᵢᵏ⁺¹ = (i − α)/β
Λᵢᵏ⁺¹ is the new cumulative coefficient for the boundary after subdomain i at the next balancing iteration. The target i is the number of subdomains in the prefix, and α and β come from the fit for that boundary. The equation gives the intersection of the regression line with the target normalized time. It is applied separately to the interior cuts of the curve.
The program recovers the individual coefficients by taking differences between successive boundaries:
λᵢᵏ⁺¹ = Λᵢᵏ⁺¹ − Λᵢ₋₁ᵏ⁺¹
λᵢᵏ⁺¹ is the new coefficient for subdomain i. The first cumulative quantity gives its upper boundary and the second its lower boundary, both in the next iteration. The boundary before the first subdomain is 0, and the final boundary is P, where P is the number of subdomains. This construction gives the partitioner a target for each segment of the original curve.
The fit can use observations with equal weight, as in simple linear regression, or emphasize more recent observations through weighted linear regression. In the authors’ weighted procedure, the observation weight increases by 50% at each iteration. Combining observations softens the effect of an unusual individual timing. Emphasizing the latest measurements lets the fit respond to the part of the curve the algorithm has reached after earlier adjustments.
In the homogeneous runs the authors find that the average time varies little as work is shifted. Under that condition the cumulative time for a boundary can stay relatively insensitive to how the work in its prefix is divided among the earlier subdomains. This gives a reason for fitting the splits separately. With CPUs and GPUs together, transferring work changes the time needed to process the transferred elements. The mean then moves during balancing, and the normalized observations reflect that movement as well as the local change in the split.
How the executables cooperate
For combined execution, the CPU and GPU assembly processes participate in one MPI job. Each process uses the executable compiled for its assigned device. The CPU executable in these experiments is built with GFortran, and the GPU executable uses PGIF90 with OpenACC. The reported compilation settings for the pack sizes in the combined run are 32 and 190K, respectively. The host and accelerator paths can therefore use the same partitioning and numerical approach while retaining different layouts of parallel work within the pack.
The authors use the cluster’s SLURM launcher to associate MPI ranks with executables. The executables are linked against a common MPI library so that data exchange and synchronization can take place across ranks running different code builds. The device assignment is stable at the process level for assembly. The balancing algorithm adjusts the size of the process’s subdomain, leaving the numerical meaning of that subdomain and the MPI interface intact.
During the pressure solve, processes that carried out assembly on CPUs also submit their solver work to a GPU. The solver keeps the partition used by assembly. Alya’s GPU solver uses NVIDIA libraries for common operations and also provides CUDA kernels, including a sparse matrix–vector product that can be tuned for its matrices. For the distributed product, it can compute on interior nodes while exchanging interface data. A GPU memory pool reduces repeated allocation and release costs, and NVIDIA’s Multi-Process Service handles work submitted by several MPI processes to the same accelerator.
How the paper estimates the potential gain
The authors build an idealized capacity calculation for the assembly kernel. It assumes that work can be divided so that participating devices finish together. A CPU core is the reference unit, and a GPU contributes a number of such units equal to its speedup over a core. The hardware ratio used in the calculation is:
r = n_gpu/n_core
r is the number of GPUs per CPU core, n_gpu is the number of GPUs available, and n_core is the number of available CPU cores. The paper gives 1/10 for the MareNostrum POWER9 configuration. It denotes by s the speedup of a GPU relative to a single core for the assembly being considered. The weighted resource capacity of the node includes both the cores and the GPUs at that value of s.
For assembly using the GPUs alone, the fraction of capacity used is:
eff_gpu = (s × n_gpu)/(n_core + s × n_gpu) = (s × r)/(1 + s × r)
eff_gpu is the idealized efficiency of the GPU-only calculation. s is the GPU speedup per reference core, n_gpu and n_core are the available device counts, and r is their ratio as defined above. The denominator counts the total available capacity in core units. The numerator counts the portion participating in assembly.
For assembly using CPU cores alone, the corresponding expression is:
eff_core = n_core/(n_core + s × n_gpu) = 1/(1 + s × r)
eff_core is the idealized efficiency of CPU-only assembly. The numerator is the capacity contributed by the CPU cores, with n_core again denoting their count. s, n_gpu and r have the same meanings as in the GPU expression. The simplified form divides both parts of the fraction by the number of cores.
In the first combined configuration, each GPU process leaves one host core unavailable for CPU assembly:
eff_coex,1 = (n_core − n_gpu + s × n_gpu)/(n_core + s × n_gpu)
= (1 + (s − 1) × r)/(1 + s × r)
eff_coex,1 is the fraction of capacity used for combined assembly with one host core removed per GPU. The counts n_core and n_gpu, the speedup s, and the hardware ratio r retain their earlier meanings. Subtracting n_gpu counts the cores excluded from assembly, while s × n_gpu adds the assembly capacity of the accelerators. The subscript distinguishes this core reservation from the other configuration.
In the OmpSs configuration considered by the authors, each GPU process leaves two host cores out of CPU assembly:
eff_coex,2 = (n_core − 2n_gpu + s × n_gpu)/(n_core + s × n_gpu)
= (1 + (s − 2) × r)/(1 + s × r)
eff_coex,2 denotes the idealized efficiency for that reservation. The term 2n_gpu counts the two excluded cores per GPU, and the other symbols retain their meanings from the preceding formulas. Both combined expressions quantify the costs of reserving host resources while admitting GPU capacity. The figures derived from them are resource fractions under perfect balance. Actual assembly timings also reflect which elements are assigned to a device and whether its load is large enough to keep it occupied.
Experiments and results
Workloads, hardware and measurements
The paper uses two meshes of the aircraft. The 31.5M-element mesh supports performance and tuning experiments. The 176M-element mesh is the finer one intended for production simulations and is used for the main combined execution. Both are hybrid meshes. The fine mesh is described as using tetrahedra, prisms and pyramids, with roughly three elements in the boundary layer’s inner region and around 10 in its outer region. The authors arrange the coarse-mesh computational tests with the load per node of the finer runs in mind. This matters in particular when interpreting GPU throughput, which changes with the number of elements assigned per node.
A separate sphere calculation uses a tetrahedral mesh. It provides a comparison for assembly on a mesh in which every element has the same shape. The airplane and sphere calculations have separate CPU baselines in the GPU tuning study. That study uses one POWER9 node, comparing the four V100 accelerators with the node’s 40 CPU cores. The cluster has 52 compute nodes, and each node has 512 GB of main memory in addition to the accelerators’ discrete memory. The node’s NVLINK connections couple GPUs to CPUs and neighboring GPUs. The communication environment is relevant both to moving data for assembly and to the pressure solve.
For the initial performance profile, the authors use the 31.5M-element mesh on 4 nodes with 320 MPI processes running on CPUs. They record a trace with Extrae and inspect it with Paraver. The paper reports tracing overhead under 4%. The trace shows the repeated element and boundary calculations within the timestep, followed by the pressure solve. It also separates busy periods from waiting and identifies the MPI calls. After assembling the boundary, a point-to-point exchange takes place before assembly of the next element begins. The solver uses collective reductions.
The profile reports arithmetic intensity, calculated from floating-point work and data movement:
I = W/D
Here I is arithmetic intensity, W is computational work measured as the number of double-precision floating-point operations reported by hardware counters, and D is measured data movement in bytes. These symbols refer to the profiling calculation. The table gives an arithmetic intensity of 0.05 for element assembly, 0.01 for boundary assembly, and 0.02 for the solver in this coarse-mesh CPU profile.
In the same profile, element assembly accounts for 93.43% of floating-point operations and 75.18% of elapsed time. Boundary assembly accounts for 2.06% of floating-point operations and 14.20% of elapsed time. The corresponding solver values are 4.51% and 10.63%. The element share of floating-point work identifies where the bulk of the arithmetic takes place. The elapsed-time shares identify where speeding up a phase can have the greatest direct effect on the timestep. The authors use the latter observation to motivate balancing element assembly.
For phase timing, the paper measures load balance as:
LB = average/max
LB is the load-balance score, average is the mean across processes for the measured quantity, and max is the maximum across those processes. For elapsed time, a score closer to unity means the slowest process is closer to the mean. The same calculation is applied to some of the hardware counters in the initial profile. The timing balance scores for element assembly, boundary assembly and the solver on the coarse CPU run are 0.92, 0.73 and 0.82, respectively.
The balancing experiments also display the slowest time relative to the mean:
I = maxⱼ(tⱼ)/t̄
Here I is the overall imbalance indicator for a set of measurements, tⱼ is the elapsed assembly time of process or subdomain j, maxⱼ selects the largest such time, and t̄ is the mean. The symbol I has this separate meaning in the balancing analysis. The reported percentage imbalances describe the excess of the maximum over the mean. The paper also looks at individual processes using:
Iⱼ = tⱼ/t̄
Iⱼ is the normalized assembly time for subdomain j, tⱼ is its measured time, and t̄ is the mean across processes in the same execution. A plot of these values can reveal where slow and fast ranks are located in the rank ordering.
The absolute time deviation for a subdomain is:
Dⱼ = |tⱼ − t̄|
Dⱼ is the distance in elapsed time between subdomain j and the mean. tⱼ is the subdomain’s elapsed time, t̄ is the mean, and the bars denote absolute value. Tracking the largest deviation captures a very fast outlier as well as a very slow one. The imbalance ratio is driven by the slowest process, a distinction that matters when comparing the shapes of the convergence curves.
CPU performance from a core to many nodes
The main CPU tuning experiments use the 31.5M-element mesh and OpenMPI 3.0.0. The compiler comparison uses GFortran 8.1.0, PGIF90 18.10 and XLF 16.1.1.2 with equivalent optimization flags. The reported CPU timings average 20 timesteps after excluding the initial step, which includes initialization overhead. The authors time the complete step as well as the separate phases, so they can distinguish a change that benefits assembly from one that improves the full calculation.
Packing is first tested on 10 nodes, with 40 MPI processes per node and one process on each physical core. A pack size of 1, expressed as a compile-time parameter, supplies the speedup reference. With pack size left as a variable, the best setting is 16. With a compile-time parameter, the best setting is 32. The compiler can use a fixed dimension when generating vector code, and the ordering of elements into contiguous packs also helps data locality. The two best settings show that these advantages need not favor the same pack length.
The compiler trials use 12 nodes and vary occupancy of simultaneous multithreading, or SMT, by placing 1, 2, 3 or 4 MPI processes on each core. SMT lets several hardware threads share one physical core. GFortran gives the lowest full-step times across the tested settings and performs best on element assembly. PGIF90 follows a similar trend at somewhat higher times. XLF is close to the others with one process per core and loses ground as more SMT contexts are used for element assembly. On boundary assembly XLF leads across the tested SMT settings. Its best solver configuration uses 1 SMT per core.
The shared-memory threading tests also use 12 nodes and hold machine resources fixed while changing how they are divided among MPI ranks, OpenMP threads and SMT contexts. In element assembly, the best performance occurs with one SMT context per core. In this setup, shared-memory threading scales to as many as eight OpenMP threads for each MPI process. With 2 SMT contexts per core, the authors see near-comparable performance and scaling up to 20 OpenMP threads per process. With 4 SMT contexts per core, the useful scaling ends at 4 threads per process. For the solver, more OpenMP threads per process increase elapsed time in the tested configurations.
The CPU strong-scaling runs keep the 31.5M-element mesh fixed and increase the allocation up to 40 nodes. They compare pure MPI with GFortran and two hybrid configurations using GFortran and OmpSs. One hybrid configuration uses 2 threads per process, and the other uses 8. The configurations use one SMT context per core. The reference is the elapsed time of the pure-MPI version on a single node. The numbers for this scaling comparison average twenty timesteps from two runs. The efficiency is:
Effₓ = t₁/(x × tₓ)
Effₓ is the strong-scaling efficiency at x nodes, t₁ is the elapsed time of the single-node pure-MPI reference, and tₓ is the elapsed time of the configuration being evaluated on x nodes. The factor x accounts for the increased allocation. The same reference convention lets the authors compare hybrid configurations with pure MPI even when their single-node performance could differ.
For the complete timestep, pure MPI stays above 80% efficiency through 16 nodes. The variant with 8 OmpSs threads remains below 80% for the complete step in the configurations shown. Element assembly has higher efficiency than the other phases and is above 80% in almost all the reported cases. Boundary assembly is above 80% through 8 nodes with either pure MPI or 2 OmpSs threads. Above that allocation the boundary efficiency falls, approaching 50% for pure MPI and 40% for 2 threads per process. The solver with pure MPI is above 80% efficiency through 16 nodes. These phase timings help explain why the threading arrangement that gives the best element assembly can be a weaker choice for the entire step.
What the GPU tuning delivers
The GPU study begins with a straightforward OpenACC implementation that uses the CPU configuration. On the sphere mesh it reaches a speedup of 1.67× against the CPU baseline. On the airplane mesh the initial GPU configuration is slower than the CPU one, which the authors attribute to low GPU occupancy. The mixed-element calculation uses extra data structures to handle its different categories. The paper follows both workloads through tuning to show how much the outcome depends on the mesh and the GPU execution settings.
For the airplane, the authors select a pack size of 196,608 and a vector length of 128. The launch then uses 1536 blocks of 128 threads. They use the CUDA Occupancy calculator to guide the thread setting. The reported relative gains from tuning the pack and launch parameters are 2.68 times for the tetrahedral case and 1.72 times for the mixed-element case. The final stage enables pipelining through asynchronous streams. For the airplane kernel, the authors find that four streams per GPU give the best result within its memory footprint.
V100 assembly speedup over the CPU node on the tetrahedral sphere mesh
The tuned and pipelined implementation assembles the sphere mesh faster than the direct OpenACC port.
The numbers
| System or setting | speedup × |
|---|---|
| Direct OpenACC port | 1.67 |
| Tuned and pipelined OpenACC (this paper) | 5.44 |
With the final optimizations, the GPU speedup over the CPUs is 5.44 times for sphere assembly and 3.48 times for airplane assembly in the reported node-level comparison. The right-hand part of the paper’s workload study varies the airplane workload from 2 million to 32 million elements per node. The speedup over the optimized CPU implementation ranges from 1.3 up to 3.48 times. Larger loads favor the GPU in this experiment, consistent with the need to offer enough work per device to use its parallel resources. The resulting speed advantage is specific to the size and composition of the workload; it also sets the context for how much work a CPU can usefully take in a combined run.
Balancing single-device runs
For the coarse mesh, the regression comparison uses 8 CPUs with 160 cores. The authors run the balancing procedure on the element assembly times and compare ordinary and weighted fits. Weighted regression reaches the reported 2% imbalance threshold in 7 iterations. The ordinary fit takes 11 iterations. The maximum absolute deviation changes more smoothly than the imbalance ratio. Together these measures show both how quickly the slowest process approaches the mean and how the fastest or slowest outlying time moves across the run.
The larger CPU balancing experiment uses the 176M-element mesh on 12 nodes, with 20 MPI processes per node and two OmpSs threads per process. This gives 240 subdomains. The element assembly in this pure-CPU configuration accounts for 68% of the timestep. Initially, the normalized rank timings show especially slow processes associated with two nodes. The authors interpret the clustering as evidence suggesting a performance difference across nodes. After balancing, the reported imbalance drops from 35% to 0.8%.
CPU assembly imbalance before and after balancing on the 176M-element airplane mesh
Timing-guided repartitioning brings the slowest ranks much closer to the mean.
The numbers
| System or setting | imbalance % |
|---|---|
| Initial partition | 35 |
| Timing-guided partition (this paper) | 0.8 |
The maximum and minimum assembly times approach the mean while the mean stays nearly fixed in this CPU run. The convergence stalls from iteration 10. The phase timings show that the changes to the partition reduce the dominant assembly time while the boundary and solver times avoid a corresponding increase. The authors repeat the assembly balancing experiment using the GPUs on the same 12 nodes, engaging 48 V100 accelerators. The qualitative convergence is similar. In this balancing comparison the paper reports final times of 1.9s for the GPU run and 4.7s for the CPU run, describing the GPU time as 2.5× lower.
The combined airplane run
The main combined execution uses the 176M-element mesh and 12 nodes. On each node, 16 MPI subdomains run assembly on the CPU cores with 2 OmpSs threads per subdomain. Another 4 MPI subdomains use the GPUs for assembly. In this setup, 8 host cores are left out of CPU assembly. The initial partition gives the same nominal load to each MPI process, regardless of device. This produces a clear separation between the CPU and GPU rank timings and also exposes variation within each set of ranks.
The iterative procedure shifts work towards the accelerator subdomains and adjusts for differences among ranks of the same type. The final accelerator subdomains contain roughly 10× more elements on average than the CPU subdomains. In the paper’s core-based speedup convention, the reported value for this configuration is s = 20. The load balance reaches 94% in 14 iterations. The mean assembly time falls during the adjustment, unlike the almost constant mean in the homogeneous runs. Moving elements to a faster device changes how much time is spent computing them, even before the maximum and minimum rank times come together.
The authors use s = 20 and the hardware ratio 1/10 in the idealized calculation. With two cores reserved per GPU, they report 93% theoretical co-execution efficiency and a predicted 28% reduction in assembly time relative to using only the GPUs. Against the balanced pure-GPU run, the measured assembly-time reduction is 23%. The authors describe that result as comparable to the performance gain from adding a GPU per node. The benchmark comparison itself is between the balanced GPU-only and combined runs on the existing allocation.
The rest of the timestep is measured as well. The boundary assembly time decreases during the balancing process, and the pressure solve stays almost constant. Five MPI processes share each accelerator for the solve: four that carried out assembly on the CPUs and one that carried it out on that GPU. Moving work between those subdomains changes the size of individual processes’ contributions to the solve. The paper observes that their combined workload per accelerator changes little and uses this to explain the stable solver time. The 23% reduction quantifies element assembly in this configuration.
What the ablations show
Data layout, launch size and pipelining address different costs
The CPU pack-size comparison changes whether the pack length is available at compile time. Both versions arrange element data into packs. Varying a size stored as a variable shows the benefit of reorganizing the data, with 16 the best value in that test. A fixed size gives the compiler additional information for vectorization, and its best setting is 32. The authors report an advantage for the compile-time version when the sizes are matched. The change in optimum is consistent with data locality and vector code generation imposing different preferences on the same data layout.
The GPU experiment successively changes implementation choices. The first comparison shows what the direct OpenACC port can do with the CPU configuration. The tetrahedral sphere case already benefits, while the mixed-element airplane case needs different launch settings before it becomes competitive. The next comparison shows what becomes possible when the pack supplies an appropriate number of GPU threads and blocks. Pipelining then adds a way to overlap transfers and computation. Because these changes are introduced in sequence, the result of each stage is conditional on the preceding configuration. The paper demonstrates how the optimizations build toward the final result.
The workload sweep is a separate check on whether a tuned version supplies a fixed acceleration. With the same airplane application and node-level comparison, the observed advantage changes as the number of elements per node changes. This is directly relevant to repartitioning. A cut that leaves a GPU with too little work can change its effective throughput, so a partition based entirely on a speed measured at one workload size can assign the wrong share of work at another. The iterative timings let the partitioner observe performance at the share actually assigned.
The sphere comparison gives the authors a way to examine the implications of handling mixed element categories. It compares complete workloads with different geometries as well as different element mixes. The result therefore shows how the same optimization sequence behaves for these specific calculations. A comparison of the two final speedups alone cannot isolate the cost of one extra element shape or a particular auxiliary array.
Threading choices change which phase sets the pace
The compiler study separates step time from assembly, boundary and solver time. That separation is important because the strongest compiler for boundary assembly, XLF, is weaker for element assembly as SMT use increases. The full step follows the element-assembly trend in this case because that phase dominates the elapsed time. Hardware counters from the XLF runs show fewer instructions per cycle and a marked reduction in cycles per microsecond for each process with higher SMT use. The authors suggest a possible frequency effect and leave its cause for further investigation.
The OpenMP and SMT comparisons likewise show that a phase can benefit from a change in process layout that another phase handles poorly. The element assembly can exploit a substantial number of shared-memory threads per process. The boundary assembly favors relatively few in the measured configurations, and the solver gets slower as more OpenMP threads are assigned per process. Keeping the hardware allocation fixed makes these differences attributable to how the resources are organized for this workload. It also explains the choice to compare more than one CPU configuration in the scaling study. A configuration favored by the largest kernel can lose some of that advantage elsewhere in the timestep.
The scaling results give another way to locate the losses. Element assembly has no MPI exchange inside its measured loop, so the authors attribute the loss at the MPI level for that phase to imbalance. The surrounding algorithm still has to coordinate before continuing. Pressure operations perform their own interface exchanges and reductions, and the effect of threading on those operations has to be judged from their separate timings. A plot of the full step alone would combine the costs of local computation, workload inequality and communication into a single curve.
Recent measurements accelerate the partition adjustment
The weighted-versus-ordinary regression experiment keeps the coarse airplane case and CPU allocation fixed and changes how the timing history enters the fit. The weighted fit reaches the same imbalance threshold with fewer repartitioning iterations. Both procedures use observed cumulative times to estimate each boundary. Emphasizing later measurements helps the estimate follow the changes that occur as the partition moves. This is evidence for the weighting choice on that workload. The paper does not vary the observation-weight schedule in this experiment.
Regression iterations to reach the 2% assembly imbalance threshold on the 31.5M-element airplane mesh
Emphasizing recent timings reaches the same threshold sooner.
The numbers
| System or setting | balancing iterations |
|---|---|
| Simple linear regression | 11 |
| Weighted linear regression (this paper) | 7 |
The additional convergence plots show what the threshold can conceal. The time maximum reflects the slow end of the rank distribution. The largest absolute deviation can also come from a rank that finishes well ahead of the others. In the homogeneous CPU run, the nearly stationary mean and the approach of both extremes towards it show redistribution around a similar total amount of computing time. In the combined run, the mean itself falls while the extremes converge. The timing measurements thus reveal both the smoothing of rank-level loads and the effect of placing more work on the faster devices.
The before-and-after comparisons on the fine mesh also check for side effects on untargeted phases. Stronger balance in assembly could in principle come with a more expensive boundary calculation or pressure solve, since the subdomain interfaces and the local distribution of work can change. The authors track the other phases and find no such penalty in the reported runs. For the combined configuration, the grouped workload of the processes sharing a GPU provides a specific explanation for why pressure time is stable as work shifts among individual subdomains.
Finally, the balanced GPU-only baseline matters to the interpretation of the combined run. The GPU-only allocation already benefits from partition adjustment, so it supplies a comparison against accelerators whose assembly load has been balanced. The measured improvement after admitting CPU assembly is therefore a comparison between two optimized placements of the same airplane work. The remaining gap between the idealized prediction and the measured reduction also illustrates the difference between weighted hardware capacity under perfect balance and an observed elapsed time from a real partition.
Limitations
Limits identified by the authors
The authors describe the balancing procedure as a way to adjust for average performance and structural imbalance. It changes the mesh partition between observations. A fine-grained scheduler has a different response time and can address transient delays within an execution. An unusually slow process timing can be smoothed by fitting several observations, but the method acts by selecting a partition that can be reused, which is suited to persistent differences in work or device performance.
The paper also limits its CPU tuning conclusions to the cases measured. The relative cost of element assembly, boundary assembly and the algebraic solver depends on the physics being solved and the parameters selected for the simulation. The timings for the high-lift airplane explain why its dominant phase carries so much weight in the choice of compiler and thread arrangement. A change in those phase shares can change the choice even on the same machine. The cause of the XLF slowdown with greater SMT use is left open by the authors.
For the GPU path, explicit memory management constrains the implementation to the physical memory on the accelerator. Batching packs allows the calculation to proceed within that limit. Pack size and the number of streams compete for space, so tuning those values depends on the storage needed by the kernel. The paper also states that GPU speed relative to a core depends on the type and amount of work in the subdomain. The theoretical efficiencies treat that speed as an input and assume perfect balance, which makes them estimates of potential assembly gains.
The geometric partitioner uses the locality of a space-filling curve to control interfaces indirectly. Graph techniques can represent the connections explicitly. This matters when time spent on communication is substantial. The partitioner’s time corrections are driven by assembly, and the authors acknowledge prior work in which deliberately uneven computational loads benefited overall performance. For their examples, improved balance is associated with a shorter time to solution. The evidence for that relationship comes from the measured phases and workloads in this paper.
Limits apparent from the experimental design
The headline co-execution measurement concerns element assembly for one production geometry and allocation. The solver uses GPUs throughout the combined run, and its stable time does not establish how a pressure solver shared concurrently between CPU and GPU devices would behave. The single-node GPU optimization study and the larger CPU scaling study address different parts of the performance argument. The CPU scaling results up to 40 nodes leave open how the combined execution would scale over that same range.
The timing analysis also distinguishes the cost of assembly after balancing from the cost of reaching that partition. The paper reports how many balancing iterations were required and describes the repartitioning procedure as low latency. The final assembly speedup is a measure of steady execution at the resulting partition. Evaluating the total benefit for a different run would also require knowing how long the partition remains useful and how much time its construction and adjustment consume over that run.
The grouping of solver ranks gives an explanation specific to this assignment of processes to GPUs. The combined workloads per accelerator change little even though the assembly workloads per rank change considerably. Another rank placement or a different relationship between assembly and solver costs could change the aggregate GPU workload during the solve. The separate phase timings support the authors’ conclusion for the observed layout. The balancing objective by itself minimizes neither solver communication nor the total time of every phase.
The airplane demonstration is primarily a computational performance study. The authors describe the physical setup, the discretization and the resolution of the fine mesh, and show a snapshot that visualizes flow structure. The evidence presented for co-execution consists of elapsed time, scaling and balance measurements. Questions about aerodynamic accuracy, including agreement in lift, drag or separation with experimental measurements, would require corresponding validation results. The speedup establishes how Alya executes the stated calculation.
The theoretical capacity analysis and the practical load-balance score measure different properties. The capacity fractions are computed using device counts, a speed estimate and reserved cores. The load-balance score describes how closely measured rank times approach the slowest rank time. A high value of the latter can still coexist with limited device occupancy or an expensive communication phase. The workload sweep and phase timings give independent evidence about those effects. They are part of what makes the final, balanced GPU comparison more informative than a balance score by itself.
The notation for correction coefficients also calls for care when reconstructing the method. The boundary equations place the cuts in units of nominal subdomain weight, so the terminal cumulative coefficient is the number of subdomains. Reading the normalization sentence literally alongside that convention would give an inconsistent allocation. The workable interpretation follows the target-weight and boundary formulas together and preserves the total mesh weight. The paper’s convergence experiments give empirical evidence for the procedure on the chosen CPU, GPU and combined configurations.
What came after
No later citing study is identified for a follow-up comparison. The paper itself establishes that a single mesh partition can be adjusted from measured assembly times while different device-specific executables work within the same MPI calculation. Whether subsequent implementations reused the cumulative regression, selected another way of moving the cuts, or extended concurrent execution to the pressure solve remains undocumented here.
Cite
Cite as R. Borrell, D. Dosimont, M. Garcia-Gasulla, G. Houzeaux, O. Lehmkuhl, V. Mehta, H. Owen, M. Vazquez and G. Oyarzun. 2020. Heterogeneous CPU/GPU co-execution of CFD simulations on the POWER9 architecture: Application to airplane aerodynamics. arXiv:2005.05899 · Future Generation Computer Systems, Volume 107, 2020,Pages 31-48.
@misc{borrell2020heterogeneous,
title = {{Heterogeneous CPU/GPU co-execution of CFD simulations on the POWER9 architecture: Application to airplane aerodynamics}},
author = {R. Borrell, D. Dosimont, M. Garcia-Gasulla, G. Houzeaux, O. Lehmkuhl, V. Mehta, H. Owen, M. Vazquez and G. Oyarzun},
year = {2020},
doi = {10.1016/j.future.2020.01.045},
eprint = {2005.05899},
archivePrefix = {arXiv},
url = {https://doi.org/10.1016/j.future.2020.01.045}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/borrell-2020-heterogeneous-cpu-gpu-co-execution/