Download presentation
Presentation is loading. Please wait.
Published byErlin Oesman Modified over 6 years ago
1
Total Code Makeover Changing the Face of High Performance Code
Brian Foote Wed., 18 May 2005 University of Illinois at Urbana-Champaign 11/10/2018 Total Code Makeover
2
A Roadmap My Background, and Ralph Johnson’s UIUC Software Architecture Group Objects, Frameworks, and HPC Refactoring HPC Applications with Photran and Eclipse 11/10/2018 Total Code Makeover
3
An HPC Carpetbagger? An Old Fortran Hand Realtime Programming
Object-Oriented Frameworks Reuse Reflection Software Evolution Patterns Software Architecture High Performance Computing 11/10/2018 Total Code Makeover
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 The essential field guide… 11/10/2018 Total Code Makeover
5
Patterns are Dispatches from the Trenches about What Works
Academics Feed the Novelty Vampires Secrets are Important to Industry 11/10/2018 Total Code Makeover
6
A Scene from a Nightmare
11/10/2018 Total Code Makeover
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? 11/10/2018 Total Code Makeover
8
Sisyphus Revisited Writing variations of the same code becomes tedious
Libraries work well, but have their limitations Object–Oriented Frameworks fill a void between libraries and applications 11/10/2018 Total Code Makeover
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; don’t call me, I’ll 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 11/10/2018 Total Code Makeover
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/10/2018 Total Code Makeover
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 11/10/2018 Total Code Makeover
12
Design of Scientific Applications (From Michael Frumkin http://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 11/10/2018 Total Code Makeover
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 11/10/2018 Total Code Makeover
14
HPC: Programming Languages and 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? 11/10/2018 Total Code Makeover
15
The Imperial Vision You’ve seen one Grid; Mesh, you’ve seen ‘em all
Too hard for Physicists Hotspots are in the Inner Loops, defy conventional SW abstraction approaches 11/10/2018 Total Code Makeover
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) 11/10/2018 Total Code Makeover
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 11/10/2018 Total Code Makeover
18
Macro Processing Use the C Preprocessor (cpp)
Even Fortran indulges this Crude, but effective Not easy to scale 11/10/2018 Total Code Makeover
19
Generative Approaches
Use a scripting language or preprocessor to generate code “glue”, or data Use in lieu of of Macros CCA, IBEAM 11/10/2018 Total Code Makeover
20
Languages and Patterns
X10 Chappel Reflection and Metalevel Architectures (aka Aspects?) What ever else I’ve forgotten Patterns… 11/10/2018 Total Code Makeover
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 11/10/2018 Total Code Makeover
22
Refactoring Tools First developed at UIUC for Smalltalk
Made popular by Fowler, Kerievsky Coming soon to a HPC near you 11/10/2018 Total Code Makeover
23
Refactoring “Behavior Preserving” code transformation Rename
Extract “method” Verifies preconditions Reconciles all occurrences More reliable than cut ‘n’ paste, or search and replace 11/10/2018 Total Code Makeover
24
Photran: A Fortran Plugin For Eclipse
25
Photran History Opdyke’s C++ Tool
Refactory and the Refactoring Browser IBM Eclipse Innovation Grant IBM PERCS High Performance Computing Initiative NASA IBEAM Project CRefactory 11/10/2018 Total Code Makeover
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 11/10/2018 Total Code Makeover
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) 11/10/2018 Total Code Makeover
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 11/10/2018 Total Code Makeover
29
What would you pay for a tools like this?
11/10/2018 Total Code Makeover
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 11/10/2018 Total Code Makeover
31
Grid-Cogeneration Cycles too cheap to meter?
You are insatiable. I’ll sell you my Idle Process, at the going rate… A Billion is an interesting # 11/10/2018 Total Code Makeover
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.