[ HOME | What | Lists | Download | Docs | Support | Benchmarks | Contribute | Platforms | Examples | Legal | Tools | Papers/talks | Thanks ]


Goals of the Blitz++ library

The C++ programming language offers many features useful for tackling complex scientific computing problems: inheritance, polymorphism, generic programming, and operator overloading are some of the most important. Unfortunately, these advanced features came with a hefty performance pricetag: until recently, C++ lagged behind Fortran's performance by anywhere from 20% to a factor of ten. As a result, the adoption of C++ for scientific computing has been slow.

Is there a way to soup up C++ so that we can keep the advanced language features but ditch the poor performance? This is the goal of the Blitz++ project: to develop techniques which will enable C++ to rival -- and in some cases even exceed -- the speed of Fortran for numerical computing, while preserving an object-oriented interface. The Blitz++ Numerical Library is being constructed as a testbed for these techniques.

Recent benchmarks show C++ encroaching steadily on Fortran's high-performance monopoly, and for some benchmarks, C++ is even faster than Fortran! These results are being obtained not through better optimizing compilers, preprocessors, or language extensions, but through the use of template techniques. By using templates cleverly, optimizations such as loop fusion, unrolling, tiling, and algorithm specialization can be performed automatically at compile time.

Another goal of Blitz++ is to extend the conventional dense array model to incorporate new and useful features. Some examples of such extensions are flexible storage formats, tensor notation and index placeholders.



Philosophy: The library that thinks it is a compiler

Scientific computing requires domain-specific abstractions, such as arrays, matrices, and tensors. Building such abstractions into a language (such as arrays in Fortran 90) can result in fast code, but may also be limiting: such abstractions are hard to extend or modify, and economics restrict the number of features which may be included in a commercial compiler.

An alternative is to use languages which allow library developers to create their own abstractions. Many problem domains which have been addressed in the past by custom languages (interval arithmetic, sparse arrays, adaptive mesh refinement) have now been successfully tackled by C++ libraries. Unfortunately, compilers have difficulty optimizing such libraries, because they lack semantic knowledge of the abstractions: instead of seeing sparse array operations, they see pointers and loops.

The solution may be to move high-level optimizations out of compilers and into libraries. The Blitz++ library demonstrates how this may be done in C++. The mechanisms are somewhat crude, but the results are appealing: Blitz++ arrays offer functionality and efficiency competitive with Fortran 90, but without any language extensions. The Blitz++ library is able to parse and analyze array expressions at compile time, and performs loop transformations which have until now been the responsibility of optimizing compilers.



Current status

Blitz++ currently provides dense vectors and multidimensional arrays. Some other features (matrices, random number generators) are partially implemented.

The development effort is transitioning from a one-person effort (Todd) to a Bazaar-style multiperson development model. To make this possible, Blitz++ was made free software, and placed under the terms of the GNU General Public License.


tveldhui@acm.org
Mon Nov 27 13:37:57 EST 2000
[ HOME | What | Lists | Download | Docs | Support | Benchmarks | Contribute | Platforms | Examples | Legal | Tools | Papers/talks | Thanks ]