Parallelization of Generic Libraries Based on Type Properties

  • Authors:
  • Prabhanjan Kambadur;Douglas Gregor;Andrew Lumsdaine

  • Affiliations:
  • Open Systems Laboratory, Indiana University, Bloomington, IN 47405,;Open Systems Laboratory, Indiana University, Bloomington, IN 47405,;Open Systems Laboratory, Indiana University, Bloomington, IN 47405,

  • Venue:
  • ICCS '07 Proceedings of the 7th international conference on Computational Science, Part I: ICCS 2007
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper describes a new approach for parallelizing generic software libraries. Generic algorithms are expressed in terms of type properties, which allows them to work with entire families of types rather than specific types. Despite this generality, generic algorithms can be made as efficient as their hand-coded variants through the use of specialization, which provides algorithm variants tuned for types with certain properties. Our approach leverages the specialization mechanism of generic programming to effect parallelism. We illustrate the process of specializing generic algorithms for parallelism using common algorithms in the C++ Standard Template Library. When the resulting algorithms are invoked with types that have the required properties for parallelization, the parallel variants of these algorithms are executed. We illustrate that our parallelization strategy is simple, practical, and efficient, using tools and techniques available in most commercial compilers.