Couillard: Parallel Programming via Coarse-Grained Data-Flow Compilation

Leandro A. J. Marzulo, Tiago A. O. Alves, Felipe M. G. França, Vítor Santos Costa

Introduction

Parallel programming remains a significant challenge in software engineering. While established tools like OpenMP are effective for simple "Single Program Multiple Data" (SPMD) patterns, they often falter when faced with irregular dependencies, non-linear pipelines, or speculative execution. Data-flow programming offers a compelling alternative by allowing instructions to execute as soon as their inputs are ready, thereby maximizing concurrency. However, traditional fine-grained data-flow models introduce substantial management overhead and complex control logic.

To address these issues, researchers developed Couillard, a compiler designed to bridge the gap between high-level imperative programming and high-performance coarse-grained data-flow execution. Couillard automates the generation of complex data-flow graphs from annotated C code, targeting the Trebuchet virtual machine.

The Couillard Toolchain

The system architecture centers on the Couillard compiler and the Trebuchet virtual machine (VM). The compiler processes a subset of ANSI C extended with specific annotations that define "super-instructions"—coarse-grained blocks of code that serve as nodes in a data-flow graph.

The Couillard compilation and execution flow, showing the transformation from C source to binary load and execution on processing elements.

As shown in the compilation flow, Couillard extracts super-instructions into a library source (.lib.c) for standard compilation while simultaneously generating a data-flow assembly file (.fl). The Trebuchet VM then executes these instructions across multiple Processing Elements (PEs), utilizing a FIFO work-stealing algorithm to maintain dynamic load balancing.

Programming Model and Insights

Developers use directives like treb_super <single|parallel> and keywords such as treb_parout to identify tasks and their dependencies. This coarse-grained approach avoids the overhead of fine-grained systems while maintaining scheduling flexibility.

A key advantage of this model is its ability to handle non-linear pipelines and hide I/O latency. By treating I/O operations as graph nodes, the system can overlap data processing with subsequent reads. Furthermore, the "contract" model allows programmers to use shared memory within a super-instruction without requiring the VM to manage internal state details, simplifying the transition from standard C.

Performance Evaluation

The researchers evaluated Couillard using the PARSEC benchmark suite, specifically the Blackscholes (regular workload) and Ferret (irregular pipeline) benchmarks. Performance was compared against Pthreads, OpenMP, and Intel Threading Building Blocks (TBB) on a 24-core machine.

Speedup comparison on the Ferret benchmark across varying core counts, highlighting the performance of Couillard with work-stealing (WS) against industry standards.

Results indicate that Couillard achieves speedups comparable to Pthreads and OpenMP for regular workloads. In the more complex Ferret benchmark, the Couillard implementation with work-stealing (Treb Couillard (WS)) outperformed Intel TBB and demonstrated near-linear scalability up to 24 cores, approaching the performance of hand-tuned Pthreads.

Limitations and Future Directions

While Couillard significantly simplifies data-flow programming, it currently requires manual annotation of super-instructions and dependencies. Future work aims to automate task placement based on profiling and to expose the Trebuchet VM's speculative execution capabilities through high-level language constructs. Expanding support to the full C++ standard would also enhance its utility for general-purpose engineering.

Summary updated

BibTeX
@article{marzulo2014couillard,
  author = {Leandro A. J. Marzulo and Tiago A. O. Alves and Felipe M. G. França and Vítor Santos Costa},
  title = {{Couillard: Parallel Programming via Coarse-Grained Data-Flow Compilation}},
  journal = {Parallel Comput.},
  year = {2014},
  doi = {10.1016/j.parco.2014.10.002},
}
Figure