Changing the Face of High Performance Code - PowerPoint PPT Presentation

About This Presentation
Title:

Changing the Face of High Performance Code

Description:

Total Code Makeover Changing the Face of High Performance Code Brian Foote Wed., 18 May 2005 University of Illinois at Urbana-Champaign http://www.laputan.org – PowerPoint PPT presentation

Number of Views:68
Avg rating:3.0/5.0
Slides: 32
Provided by: BrianF159
Learn more at: http://laputan.org
Category:

less

Transcript and Presenter's Notes

Title: Changing the Face of High Performance Code


1
Total Code Makeover
  • Changing the Face of High Performance Code
  • Brian Foote
  • Wed., 18 May 2005
  • University of Illinois at Urbana-Champaign
  • http//www.laputan.org
  • foote_at_cs.uiuc.edu

2
A Roadmap
  • My Background, and Ralph Johnsons UIUC Software
    Architecture Group
  • Objects, Frameworks, and HPC
  • Refactoring HPC Applications with Photran and
    Eclipse

3
An HPC Carpetbagger?
  • An Old Fortran Hand
  • Realtime Programming
  • Object-Oriented Frameworks
  • Reuse
  • Reflection
  • Software Evolution
  • Patterns
  • Software Architecture
  • High Performance Computing http//ibeam.cs.uiuc.ed
    u

4
The Gang of Four
  • Design Patterns Elements of Reusable
    Object-Oriented Software
  • Erich Gamma, Richard Helm, Ralph Johnson, and
    John Vlissides
  • A landmark book that changed the way programmers
    think about building object-oriented programs

5
Patterns are Dispatches from the Trenches about
What Works
  • Academics Feed the Novelty Vampires
  • Secrets are Important to Industry

6
A Scene from a Nightmare
7
Big Ball of Mud
  • The de-facto standard software architecture
  • Why is the gap between what we preach and what we
    practice so large?

8
Sisyphus Revisited
  • Writing variations of the same code becomes
    tedious
  • Libraries work well, but have their limitations
  • ObjectOriented Frameworks fill a void between
    libraries and applications

9
Frameworks
  • Abstract Classes and Components that together
    constitute a generic or template solution to
    problems in a particular domain
  • Do nothing well
  • Often exhibit an inversion of control dont call
    me, Ill call you
  • Extend via inheritance add fresh components
  • Well know in GUI World others
  • Can take a long time to learn should take a long
    time to build

10
Object-Oriented Frameworks
  • White-Box Frameworks use Inheritance
  • Black-Box Frameworks emphasize pluggable
    Components
  • A skeleton, or driver, or main loop calls your
    application-specific code
  • Polymorphism becomes the focus, not inheritance

11
Designing to Facilitate Change
  • Code evolves in an iterative, incremental fashion
  • Refactoring is the engine of the evolution
  • Mature code exhibits more black box reuse
  • Maturing code sports more patterns than immature
    code

12
Design of Scientific Applications(From Michael
Frumkinhttp//wiki.cs.uiuc.edu/PatternsOfHPC)
  • Time represented as an outer loop
  • Iterations over time step
  • Space is represented by structured/unstructured
    grids
  • Important for understanding data locality
  • Data access patterns
  • Spatial parallelism
  • Physics is represented by an operator at each
    grid point
  • Data flow
  • Operator level of parallelism/dependence

13
The Last to be Shod
  • Frameworks have been slow in coming to HPC
  • High Performance remains a craft a cottage
    industry
  • Reuse and Performance often at odds
  • The Chasm HPC People have been O-O Late Adopters

14
HPC Programming Languagesand Objects
  • FORTRAN (77, Carter era, James VI)
  • Fortran 90 (Bush the Elder, George II)
  • Fortran 2003 (Bush the Younger, George III)
  • ANSI C
  • C
  • Matlab and Friends
  • Assembler?

15
The Imperial Vision
  • Youve seen one Grid Mesh, youve seen em all
  • Too hard for Physicists
  • Hotspots are in the Inner Loops, defy
    conventional SW abstraction approaches

16
Interoperatbility and Monoculture
  • Make them write it all in your favorite language
  • Interoperability is easy to achieve
  • Fortran / C / C
  • You can build frameworks in C
  • You can fake em in C, with some effort
  • Fortran awaits F2K3 (.foo, .f00)

17
Hand Crafting
  • Skilled Craftsmen
  • Hand Tools
  • Tedious and often Dangerous
  • Best way to achieve superior quality
  • We Live and Die in the Inner Loop

18
Macro Processing
  • Use the C Preprocessor (cpp)
  • Even Fortran indulges this
  • Crude, but effective
  • Not easy to scale

19
Generative Approaches
  • Use a scripting language or preprocessor to
    generate code glue, or data
  • Use in lieu of of Macros
  • CCA, IBEAM

20
Languages and Patterns
  • X10
  • Chappel
  • Reflection and Metalevel Architectures (aka
    Aspects?)
  • What ever else Ive forgotten
  • Patterns

21
HPC Frameworks Works in Progress
  • Frameworks have succeeded on a modest scale in
    HPC
  • Tension between performance and flexibility
    remains high
  • Message passing and sharing concerns still
    clutter the code

22
Refactoring Tools
  • First developed at UIUC for Smalltalk
  • Made popular by Fowler, Kerievsky
  • Coming soon to a HPC near you

23
Refactoring
  • Behavior Preserving code transformation
  • Rename
  • Extract method
  • Verifies preconditions
  • Reconciles all occurrences
  • More reliable than cut n paste, or search and
    replace

24
Photran A Fortran Plugin For Eclipse
25
Photran History
  • Opdykes C Tool
  • Refactory and the Refactoring Browser
  • IBM Eclipse Innovation Grant
  • IBM PERCS High Performance Computing Initiative
  • NASA IBEAM Project
  • CRefactory

26
Status November 2004
  • Produced two MS Theses
  • Brought aboard two PhD Candidates
  • Repaired numerous parser bugs
  • Greatly Enhanced Stability
  • Implemented Outline Views
  • Make / Run / Debug under Linux
  • Polished the GUI

27
Status May 2004
  • Hyperion Release (14 January 2005)
  • Parsed Full IBEAM Codebase
  • Support for g77, g95, debugging under Windows /
    Linux
  • Support for Lahey Fortran Windows
  • Eos (Eclipse 3.0.1) (4 February 2005)

28
Why Refactor Fortran
  • Make code easier to understand
  • Make code easier to reuse
  • Improve structure
  • Banish duplication
  • Make code your own
  • Incrementally Cultivate the Code (XP)
  • Refactor to Components
  • Refactor to Patterns

29
What would you pay for a tools like this?
  • http//www.photran.org

30
Something Wonderful
  • Tension between performance and flexibility is
    high
  • Moore and Amdahl are conspiring to help
  • Computational Science ? Science
  • HP Computing ? Computing
  • HPC Pioneers will lead the way
  • Pattern mining needs to begin now

31
Grid-Cogeneration
  • Cycles too cheap to meter?
  • You are insatiable. Ill sell you my Idle
    Process, at the going rate
  • A Billion is an interesting
Write a Comment
User Comments (0)
About PowerShow.com