Generating Local Address and Communication Sets for Data-Parallel Programs

Siddhartha Chatterjee, John R. Gilbert, Fred J. E. Long, Robert Schreiber, Shang-Hua Teng

Abstract

In distributed-memory parallel computing, translating high-level data-parallel code into efficient "node code" is a critical compiler task. This report introduces a table-driven method using Finite State Machines (FSMs) to compute local memory addresses and inter-processor communication patterns for arrays under cyclic(k) distributions. By leveraging the Extended Euclidean Algorithm, the method provides a unified framework that avoids restrictive power-of-two constraints on processor counts and block sizes, ensuring high performance with minimal runtime overhead.

1. Introduction

During the early 1990s, the emergence of languages like High Performance Fortran (HPF) allowed programmers to express parallelism using a global address space. However, executing these programs on distributed-memory machines required compilers to partition global arrays across multiple processors. A significant bottleneck in this process was "address generation": determining which elements of a global array slice a specific processor owns and where those elements reside in local memory.

Title page of the RIACS Technical Report 93.03.

2. The Address Generation Problem

Data distribution typically follows patterns like block, cyclic, or the general cyclic(k), where blocks of size $k$ are distributed round-robin across $p$ processors. For a regular array section defined by A(lower:upper:stride), a processor must efficiently identify:

  1. The subset of elements it owns.
  2. The local memory mapping for these elements.
  3. The communication sets required to exchange data with other processors.

Traditional methods often relied on expensive runtime calculations or "bit-manipulation hacks" that restricted array and processor dimensions to powers of two.

3. Methodology: The FSM Approach

The authors propose that for any array aligned to a template with a cyclic(k) distribution, the sequence of local memory accesses forms a repeating pattern. This pattern can be modeled as a Finite State Machine (FSM) with at most $k$ states.

3.1. State Definition and Transitions

The "state" in this FSM represents the offset of an array element within its block. The compiler generates a small transition table during a preprocessing phase. At runtime, the node code simply traverses this table to determine the next local address, significantly reducing the per-iteration computational cost.

3.2. Solving for the Initial Element

To avoid linear searches for the starting index, the authors employ the Extended Euclidean Algorithm to solve linear Diophantine equations of the form $sj - pkq = \lambda$. This mathematical approach allows the system to jump directly to the first element owned by a processor, regardless of the stride or block size.

3.3. Communication and Multidimensional Arrays

The FSM framework naturally extends to multidimensional arrays through nested loops. Furthermore, by tracking destination processor IDs alongside local offsets, the system can efficiently manage communication sets for operations like shifts and stride changes.

4. Performance Evaluation

The algorithm was evaluated using the DAXPY computational kernel ($y = y + ax$) on a Sparcstation 2.

  • Preprocessing Efficiency: Generating FSM tables is extremely fast, typically requiring only a few milliseconds for block sizes up to $k=64$. The complexity is approximately $O(k \log k)$.
  • Runtime Overhead: The address computation overhead was found to be negligible. While the FSM-based loop contains more instructions than a simple unit-stride loop, the execution time is dominated by the floating-point operations of the kernel itself.
  • Scalability: The table generation is fully parallel, as each processor can compute its own tables independently based on the global distribution parameters.

5. Conclusion

The RIACS technical report provides a robust and unified solution for address generation in data-parallel compilers. By moving away from power-of-two restrictions and utilizing a table-driven FSM approach, the authors demonstrated that complex data distributions can be handled with high efficiency. While future work remains to optimize instruction cache performance for very large block sizes, this method represents a significant step forward in making distributed-memory programming more flexible and performant.

This summary is based on RIACS Technical Report 93.03, April 1993.

Summary updated

BibTeX
@inproceedings{chatterjee1993generating,
  author = {Siddhartha Chatterjee and John R. Gilbert and Fred J. E. Long and Robert Schreiber and Shang-Hua Teng},
  title = {{Generating Local Address and Communication Sets for Data-Parallel Programs}},
  booktitle = {PPoPP},
  year = {1993},
  doi = {10.1145/155332.155348},
}
Figure