Parallelization¶
exaDEM combines three levels of parallelism, inherited from exaNBody and onika:
- MPI: the domain is split into subdomains (RCB decomposition) with ghost layers; particles and their persistent
interactions migrate between processes, and the load is rebalanced every
simulation_load_balance_frequencysteps; - OpenMP: the cells and the interactions are processed by threads;
- GPU: the same operators run as CUDA kernels; the interactions are sorted by type in the classifier so that each kernel launch handles a single type.
Cost model¶
The weight of each cell used by the RCB load balancing is:
\[
W_i = 1 + 3\,P_i + \sum_{j \in \{0, \dots, N_i\}} F(I_i[j].type)
\]
with \(W_i\) the weight of cell \(i\), \(P_i\) its number of particles, \(I_i\) its interactions, \(N_i\) its number of interactions, and \(F\) the cost of each interaction type:
| Value | Type | F |
|---|---|---|
| 0 | Vertex - Vertex | 1 |
| 1 | Vertex - Edge | 3 |
| 2 | Vertex - Face | 5 |
| 3 | Edge - Edge | 4 |
| 4 | Vertex - Cylinder | 1 |
| 5 | Vertex - Surface | 1 |
| 6 | Vertex - Ball | 1 |
| 7 | Vertex - Vertex (RShape driver) | 1 |
| 8 | Vertex - Edge (RShape driver) | 3 |
| 9 | Vertex - Face (RShape driver) | 5 |
| 10 | Edge - Edge (RShape driver) | 4 |
| 11 | Vertex (RShape driver) - Edge | 3 |
| 12 | Vertex (RShape driver) - Face | 5 |
The cost model is the dem_cost_model operator, plugged in cost_model by config_spheres.msp and
config_polyhedra.msp.
Benchmarks are given in Performance.