Practical, Linear-time, Fully Distributed Algorithms for Irregular Gather and Scatter
Abstract
We present new, simple, fully distributed, practical algorithms with linear time communication cost for irregular gather and scatter operations in which processors contribute or consume possibly different amounts of data. In a linear cost transmission model with start-up latency α and cost per unit β, the new algorithms take time 3|2 p|α+β Σi≠ rmi where p is the number of processors, mi the amount of data for processor i, 0≤ i<p, and processor r, 0≤ r<p a root processor determined by the algorithm. For a fixed, externally given root processor r, there is an additive penalty of at most β(Md'-mrd'-Σ0≤ j<d'Mj) time steps where each Mj is the total amount of data in a tree of 2j different processors with roots rj as constructed by the algorithm. The worst-case penalty is less than β Σi≠ rmi time steps. The algorithms have attractive properties for implementing the operations for MPI (the Message-Passing Interface). Standard algorithms using fixed trees take time either |2 p|(α+β Σi≠ r mi) in the worst case, or Σi≠ r(α+β mi). We have used the new algorithms to give prototype implementations for the MPIGatherv and MPIScatterv collectives of MPI, and present benchmark results from a small and a medium-large InfiniBand cluster. In order to structure the experimental evaluation we formulate new performance guidelines for irregular collectives that can be used to assess the performance in relation to the corresponding regular collectives. We show that the new algorithms can fulfill these performance expectations with a large margin, and that standard implementations do not.