Abstract
A fundamental functionality of model coupling in an Earth system model is to efficiently handle data transfer between component models. An approach of M×N communication following a routing network has been widely used for data transfer, and routing network generation becomes a major step required to initialize data transfer functionality. Some existing coupling software such as the Model Coupling Toolkit (MCT) and the existing versions of the Community Coupler (C-Coupler) employ a global implementation of routing network generation that relies on gather–broadcast communications, which can be very inefficient under a case of a large number of processes. This is an important reason why the initialization cost of a coupler increases with the number of processor cores. In this paper, we propose a “distributed implementation for routing network generation, version 1.0” (DiRong1.0), which does not introduce any gather–broadcast communication. Empirical evaluations show that DiRong1.0 is much more efficient than the global implementation. DiRong1.0 has already been implemented in C-Coupler2, and we believe that some other couplers can also benefit from it.
Introduction
Modern Earth system models (ESMs) are "multiphysics" ensembles where separate component models—representing the atmosphere, ocean, and land—must exchange data. This exchange is managed by a coupler. Before a simulation starts, the coupler must build a routing network: a map that tells every processor in the source model which processor in the destination model needs its data.
As we move toward high-resolution simulations on massive supercomputers, the "initialization cost" of building this network has become a major bottleneck. Traditional couplers (like MCT or older versions of C-Coupler) use a global approach: one "root" process gathers information from every other process, computes the map, and broadcasts it back. At scales of thousands of cores, this centralized communication becomes incredibly slow and memory-intensive, sometimes taking longer to initialize than the actual simulation takes to run.
Methods
The authors introduce DiRong1.0, a distributed implementation that avoids any gather-broadcast steps. The core of the method relies on a Cell Local-Global Mapping Table (CLGMT), which tracks which global grid cells belong to which local MPI process.
The algorithm follows five major steps:
- Distributed Sorting: Each component model rearranges its local CLGMT entries using a distributed sort (a "butterfly" communication pattern). This ensures that entries are ordered by their global cell indices across all processes.
- Inter-Model Exchange: The source and destination models exchange these sorted entries. Because they are sorted, a process only needs to talk to a few "overlapping" processes in the other model.
- Detecting Common Cells: Processes identify shared grid cells locally to create a Sharing Relationship Table (SRT).
- SRT Rearrangement: The SRT entries are shuffled back to the original process distribution.
- Local Generation: Each process generates its specific routing instructions based on the local SRT.
The mathematical complexity is reduced from a centralized $O(N \log K)$ to a distributed average of $O(\frac{N}{K} \log N)$, where $N$ is the number of grid cells and $K$ is the number of processes.
Experimental Evaluation
The researchers evaluated DiRong1.0 using "toy" coupled models designed to stress-test the coupler under various configurations:
- Grids: They used a combination of longitude-latitude grids (4 million points) and cubed-sphere grids (0.3° resolution).
- Scaling Tests: Performance was measured on grid sizes ranging from 500,000 to 32,000,000 cells.
- Hardware: Testing was conducted on a supercomputer using up to 6,400 processor cores connected via InfiniBand.
Key Results and Insights
- Massive Speedups: For a grid of 500,000 cells on 3,200 cores, DiRong1.0 was 70.9 times faster than the traditional global implementation.
- Superior Scalability: In "weak scaling" tests, the execution time for DiRong1.0 increased only slightly, while the global implementation's time exploded as more cores were added.
- Memory Efficiency: Because no single process stores the entire grid map, the memory footprint per core remains manageable even as the total grid resolution increases.
- The "Initialization Wall": The paper highlights that parallel efficiency isn't just about how fast the model runs, but how fast it starts. In the era of exascale computing, O(N) memory or communication patterns are no longer "efficient enough."
Limitations and Future Work
While the generation of the network is now distributed, the authors note that reading "remapping weight files" from disk is still often a sequential process, which remains a secondary bottleneck. Additionally, C-Coupler2 still maintains a global representation of horizontal grids in memory (e.g., 1.3 GB for 16 million points). The authors plan to develop a fully distributed grid representation and distributed I/O for remapping weights to further push the scaling limits of Earth system modeling.
Summary updated