Automatic Realignment of Data Structures to Improve MPI Performance
Benjamin Perry, Martin Swany · 2010
Programs that use the Message Passing Interface (MPI) standard to communicate with other processes often use MPI data structures that are modeled after native data structures. In some cases, a subset of the fields in the native data structure do not need to be transmitted. Users will sometimes explicitly omit those fields in the MPI data structure but align the MPI data structure to match the logical layout of the native data structure, leaving gaps in alignment for the missing fields. Because the data is non-contiguous, time is spent analyzing where the data needs to be placed rather than simply sending the received data into an appropriate buffer byte for byte upon data packing. We present a compile-time transformation that recognizes this scenario within Single Program Multiple Data programs; our transformation reorders the fields of the native data structure by placing the non-transmitted fields after the transmitted fields and adjusting the user's logical layout of the MPI data structure accordingly. This transformation makes the transmitted data contiguous, which eliminates both the need to copy data during packing and the need to carefully analyze where to place the data once it has been transmitted. This transformation significantly improves data packing in many performance environments.