Abstract
Processors with multiple (or many) cores and shared memory are becoming ubiquitous across the computing spectrum. MPI, the current de facto programming model for scalable parallel applications, enforces copies between source and target processes and thus cannot fully utilize shared memory and cache architectures of modern machines. To enable MPI-based programs to more fully exploit features of multi- and many-core architectures, we present a compiler-based transformation that transforms MPI processes into threads and fuses message serialization and deserialization loops such that send and receive calls can be replaced by direct memory accesses. Our compiler replaces most of the MPI communication functions with direct load/store accesses and our runtime provides a threaded MPI implementation to handle the remaining functions.
Introduction
The Message Passing Interface (MPI) has long been the backbone of high-performance computing (HPC). However, its design is rooted in a "distributed memory" legacy where processes reside in isolated address spaces. On modern many-core systems, where multiple cores share the same physical memory, this model introduces significant overhead. Even when two cores on the same chip communicate, they must follow a rigid "copy-match-copy" protocol: the sender serializes data into a buffer, the runtime matches the message, and the receiver deserializes it. This cycle wastes CPU cycles, pollutes caches, and unnecessarily consumes memory bandwidth.
Proposed Methodology
To address these inefficiencies, this research proposes a two-pronged approach combining a specialized runtime library and a sophisticated compiler transformation framework.
Hybrid MPI (HMPI) Runtime
The first step involves mapping each MPI rank to a thread within a single process rather than running them as separate processes. This creates a shared global address space, allowing threads to directly observe each other's data structures, laying the groundwork for bypassing explicit message passing.
Rank Motion and Loop Fusion
The core innovation lies in treating communication as a loop optimization problem. The compiler identifies the code responsible for data serialization on the sender and deserialization on the receiver. It then performs "rank motion," conceptually migrating the logic so that both operations are handled by the same execution context.
As shown in the figure above, the compiler fuses these formerly separate loops into a single operation. Instead of writing to an intermediate send buffer (sbuf) and reading from a receive buffer (rbuf), the fused loop performs a direct load from the sender's source data and a store to the receiver's destination. To ensure safety, the framework employs symbolic dataflow analysis to prove that data is consumed only after it is produced and that buffers are accessed in a monotonic order.
Evaluation and Results
The framework was evaluated using two representative HPC benchmarks: MiniMD (molecular dynamics) and 2D Fast Fourier Transform (FFT). Testing was conducted on the Hera (16-core AMD Opteron) and Sierra (12-core Intel Xeon) clusters.
Performance Gains
- Latency: HMPI reduced 1-byte message latency from 0.50 microseconds (using MVAPICH2) to just 0.18 microseconds.
- Bandwidth: The system achieved a peak bandwidth of 63,168 MB/s, a significant jump from the 41,996 MB/s observed with traditional MPI implementations, primarily due to the elimination of redundant memory copies.
- Application Speedups: Communication time in MiniMD was reduced by approximately 42-43% across both clusters. The communication-heavy 2D FFT saw even more dramatic improvements, with communication overhead dropping by up to 59% on the Sierra system.
Conclusion
By shifting the perspective of MPI communication from a black-box library call to an optimizable loop structure, this approach significantly mitigates the "serialization tax" inherent in many-core systems. While the current implementation relies on specific code patterns and "quiescence lines" for safety, it demonstrates a clear path toward more efficient intra-node communication. Future work will focus on scaling this hybrid model to exascale clusters, where intra-node communication is fused while inter-node traffic continues to use traditional MPI protocols.
Summary updated