Compiler-Based Precalculation of MPI Message Envelopes
摘要
In this paper, we propose a novel approach to optimize MPI communication overhead by precomputing the used message envelopes at the initialization of MPI. This allows for selective disabling of MPI message matching when no conflicts are present, which leads to an enhanced communication performance, while still ensuring correctness. We developed an LLVM compiler pass that automatically inserts the precomputations of message envelopes into an application and is capable of handling advanced C++ language features like polymorphism and exceptions. We demonstrate the effectiveness of our approach using a complex C++ N-body simulation code, achieving performance gains despite the runtime-overhead of precomputation. In our experiments, the runtime overhead of envelope precomputation is negligible compared to the potential performance gain ( \(\le 0.25\%\) of performance gain are lost to precompute overhead). Our code is available at https://github.com/tudasc/MPI-precompute .