Title: Domain Library
1Domain Library
Imran Haque http//titanium.cs.berkeley.edu U.C.
Berkeley September 9, 2004
2Outline
- Motivation for Domains
- Overview of the Domain library
- Upgrades to the Domain library
- Language-level changes
- Compiler changes
- Implementation improvements
3Titanium Arrays (Grids)
- Designed for grid computation
- Computing arbitrary-width ghost regions for
high-order solvers - Support relaxation operators that work on every
other element or on array interior - Expressive
- Rectangular subarrays are also arrays
- Index sets are first-class concepts
- Modify index sets to produce aliased arrays
4Domains overview
- RectDomains live in N-dimensional discrete
space - Prior Experience Generality can be powerful, but
also slow so dont pay for unnecessary features - RectDomainltNgt N-dimensional hyper-rectangle
- DomainltNgt arbitrary collection of points in
N-space
5Domain library features
- Strides
- Set operations
- Manipulation operations
- Size modification, translation
Unit-stride
2-stride
6Domains example
double 2d gridnew double-5,-55,5 grid.s
et(0.0) double 2d transpgrid.permute(2,1) D
omainlt2gt dom1,12,23,37,7 foreach
(p in (grid.domain()dom))
7Motivation for Domain upgrades
- Domain library recognized as performance barrier
in applications work - AMR project
- Applications primarily using unit stride
8Language and compiler changes
- Language
- Domains as Objects
- Naming changes
- Increased arity (formerly limited to 3d)
- Code generation
- Optimized construction
9Implementation - RectDomain
- RectDomain
- Internal representation
- 25 less data, 2.5-6.5 speed boost
- Faster representation of the empty set
- Unit-stride optimizations
- Intersections are 2-3x faster
- other algorithms
- size() 20-40 faster
- Subset testing 20-40 faster
10(No Transcript)
11Implementation - Domain
- Domain
- isRectangular
- 4-50x faster
- boundingBox
- 2x faster
- Internal representation (planned)
- Transition from linked list to simple array
- Caching of query values
12(No Transcript)
13(No Transcript)
14(No Transcript)
15Benchmarking Notes
- All benchmarks performed on a single-CPU Pentium
4 system running Linux 2.4.22 (Fedora Core 1) - tc command-line options
- Narrow backend -O nobcheck verbose tc-flags
-Onoinline - Wide backend -O nobcheck verbose tc-flags
-Onoinline backend udp-cluster-uniprocess - Runtime options
- Narrow backend defaults
- Wide backend TI_SPAWNFNL, spawning 1 process