Docstoc

Imran-Domains

Document Sample
Imran-Domains Powered By Docstoc
					                                  Domain Library

                                 Imran Haque
                      http://titanium.cs.berkeley.edu

                                    U.C. Berkeley
                                  September 9, 2004




Titanium Review: Domain Library           1             Imran Haque
              Outline

              • Motivation for Domains
              • Overview of the Domain library
              • Upgrades to the Domain library
                    • Language-level changes
                    • Compiler changes
                    • Implementation improvements




Titanium Review, Sep. 9, 2004       2               Imran Haque
              Titanium 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



Titanium Review, Sep. 9, 2004         3                     Imran Haque
              Domains overview
              • {Rect}Domains live in N-dimensional
                discrete space

              • Prior Experience: Generality can be
                powerful, but also slow – so don’t pay
                for unnecessary features

              • RectDomain<N>: N-dimensional hyper-
                rectangle
              • Domain<N>: arbitrary collection of
                points in N-space
Titanium Review, Sep. 9, 2004   4                Imran Haque
              Domain library features

              • Strides

                                       Unit-stride                   2-stride


              • Set operations
              • Manipulation operations
                    • Size modification, translation




  translate                     restrict             slice (n dim to n-1)       intersect

Titanium Review, Sep. 9, 2004                        5                               Imran Haque
              Domains example

             double [2d] grid=new double[[-5,-5]:[5,5]];
             grid.set(0.0);
             double [2d] transp=grid.permute([2,1]);
             Domain<2> dom=[[1,1]:[2,2]]+[[3,3]:[7,7]];
             foreach (p in (grid.domain()*dom)) …




Titanium Review, Sep. 9, 2004   6               Imran Haque
Motivation for Domain upgrades
• Domain library recognized as performance
  barrier in applications work
   • AMR project


• Applications primarily using unit stride




 Titanium Review, Sep. 9, 2004   7           Imran Haque
              Language and compiler changes

              • Language
                    • Domains as Objects
                    • Naming changes
                    • Increased arity (formerly limited to 3d)
              • Code generation
                    • Optimized construction




Titanium Review, Sep. 9, 2004          8                         Imran Haque
              Implementation - 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



Titanium Review, Sep. 9, 2004               9                        Imran Haque
                                                           RectDomain performance
                                                         (smaller numbers are better)
            50.00
            45.00
            40.00
            35.00
            30.00
us




            25.00
            20.00
            15.00
            10.00
             5.00
             0.00
                        US const.   GS const.   Query ops   US set ops   US set ops   US set ops   GS set ops   Set compar.   Manip   RD-Point ops

     Ti 2.205, narrow     3.67        3.66        3.64        30.23        30.23        30.23        30.07         4.62       30.40       8.79
     Ti 2.615, narrow     1.05        3.66        3.67        22.71        22.71        22.71        29.35         3.68       26.50       6.00
     Ti 2.205, wide       9.35        9.23        3.71        47.31        47.31        47.31        47.30         4.69       31.16       9.05
     Ti 2.615, wide       2.25        2.25        3.68        35.98        35.98        35.98        45.53         3.74       26.91       6.00




      Titanium Review, Sep. 9, 2004                                        10                                                   Imran Haque
              Implementation - Domain

              • Domain
                    • isRectangular
                          • 4-50x faster
                    • boundingBox
                          • 2x faster
                    • Internal representation (planned)
                          • Transition from linked list to simple array
                          • Caching of query values




Titanium Review, Sep. 9, 2004               11                            Imran Haque
                                 General Domain performance
                                 (smaller numbers are better)

                  7.00
                  6.00
                  5.00
                  4.00
us




                  3.00
                  2.00
                  1.00
                  0.00
                                                   Domain creation
     Ti 2.205, narrow                                   3.33
     Ti 2.615, narrow                                   2.52
     Ti 2.205, wide                                     6.08
     Ti 2.615, wide                                     4.77


 Titanium Review, Sep. 9, 2004                12                     Imran Haque
                                 General Domain performance
                                  (smaller numbers are better)

             1000.00

               800.00

               600.00
us




               400.00

               200.00

                  0.00
                                                   Query operations
     Ti 2.205, narrow                                  132.67
     Ti 2.615, narrow                                  31.27
     Ti 2.205, wide                                    897.64
     Ti 2.615, wide                                    393.61


 Titanium Review, Sep. 9, 2004                13                      Imran Haque
                                General Domain performance
                                (smaller numbers are better)

              400.00
              350.00
              300.00
              250.00
us




              200.00
              150.00
              100.00
                50.00
                 0.00
                             US set       GS set        US set       GS set     Domain-Point
                           operations    operations   comparison   comparison    operations
     Ti 2.205, narrow           146.54    146.78        205.68       205.56         29.24
     Ti 2.615, narrow            83.79    139.15        120.95       194.60         23.42
     Ti 2.205, wide             263.79    264.16        367.70       367.76         66.15
     Ti 2.615, wide             168.14    229.56        237.60       321.57         46.78

Titanium Review, Sep. 9, 2004                   14                              Imran Haque
Benchmarking 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_SPAWNFN=‘L’, spawning 1 process

 Titanium Review, Sep. 9, 2004   15               Imran Haque

				
DOCUMENT INFO
Categories:
Tags:
Stats:
views:2
posted:3/31/2012
language:
pages:15