1 Dan Quinlan, Markus Schordan, Qing Yi Center for Applied Scientific Computing Lawrence Livermore National Laboratory Semantic-Driven Parallelization.

Slides:



Advertisements
Similar presentations
CPSC 388 – Compiler Design and Construction
Advertisements

ANTLR in SSP Xingzhong Xu Hong Man Aug Outline ANTLR Abstract Syntax Tree Code Equivalence (Code Re-hosting) Future Work.
AUTOMATIC GENERATION OF CODE OPTIMIZERS FROM FORMAL SPECIFICATIONS Vineeth Kumar Paleri Regional Engineering College, calicut Kerala, India. (Currently,
CPSC Compiler Tutorial 9 Review of Compiler.
DataFoundry: An Approach to Scientific Data Integration Terence Critchlow Ron Musick Ida Lozares Center for Applied Scientific Computing Tom SlezakKrzystof.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Bronis R. de Supinski Center for Applied Scientific Computing Lawrence Livermore National Laboratory June 2, 2005 The Most Needed Feature(s) for OpenMP.
Memory Systems Performance Workshop 2004© David Ryan Koes MSP 2004 Programmer Specified Pointer Independence David Koes Mihai Budiu Girish Venkataramani.
1 Semantic Processing. 2 Contents Introduction Introduction A Simple Compiler A Simple Compiler Scanning – Theory and Practice Scanning – Theory and Practice.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
Programming Languages Structure
The Structure of the GNAT Compiler. A target-independent Ada95 front-end for GCC Ada components C components SyntaxSemExpandgigiGCC AST Annotated AST.
SMIILE Finaly COBOL! and what else is new Gordana Rakić, Zoran Budimac.
BİL744 Derleyici Gerçekleştirimi (Compiler Design)1.
Guide To UNIX Using Linux Third Edition
Introduction to Classes and Objects CS-2303, C-Term Introduction to Classes and Objects CS-2303 System Programming Concepts (Slides include materials.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
ANTLR.
CSE 332: C++ templates and generic programming I Motivation for Generic Programming in C++ We’ve looked at procedural programming –Reuse of code by packaging.
Extensible Type-Driven Parsing for Embedded DSLs in Wyvern Cyrus Omar Benjamin Chung Darya Kurilova Ligia Nistor Alex Potanin (Victoria University of Wellington)
September 7, September 7, 2015September 7, 2015September 7, 2015 Azusa, CA Sheldon X. Liang Ph. D. Computer Science at Azusa Pacific University.
2.2 A Simple Syntax-Directed Translator Syntax-Directed Translation 2.4 Parsing 2.5 A Translator for Simple Expressions 2.6 Lexical Analysis.
1 CASC ROSE Compiler Infrastructure Source-to-Source Analysis and Optimization Dan Quinlan Rich Vuduc, Qing Yi, Markus Schordan Center for Applied Scientific.
Semantic Analysis Legality checks –Check that program obey all rules of the language that are not described by a context-free grammar Disambiguation –Name.
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
C++ Code Analysis: an Open Architecture for the Verification of Coding Rules Paolo Tonella ITC-irst, Centro per la Ricerca Scientifica e Tecnologica
Context Tailoring the DBMS –To support particular applications Beyond alphanumerical data Beyond retrieve + process –To support particular hardware New.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 6: Assembler slide 1www.idc.ac.il/tecs Assembler Elements of Computing.
CS 363 Comparative Programming Languages
Tammy Dahlgren with Tom Epperly, Scott Kohn, and Gary Kumfert Center for Applied Scientific Computing Common Component Architecture Working Group October.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Generative Programming. Automated Assembly Lines.
A language to describe software texture in abstract design models and implementation.
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
ADTs and C++ Classes Classes and Members Constructors The header file and the implementation file Classes and Parameters Operator Overloading.
McLab Tutorial Part 3 – McLab Frontend Frontend organization Introduction to Beaver Introduction to JastAdd 6/4/2011 Frontend-1McLab.
Sheet 1 DocEng’03, Grenoble, November 2003 Model Driven Architecture based XML Processing Ivan Kurtev, Klaas van den Berg University of Twente, the Netherlands.
Towards the better software metrics tool motivation and the first experiences Gordana Rakić Zoran Budimac.
COP 4620 / 5625 Programming Language Translation / Compiler Writing Fall 2003 Lecture 1, 08/28/03 Prof. Roy Levow.
CPS 506 Comparative Programming Languages Syntax Specification.
Improving I/O with Compiler-Supported Parallelism Why Should We Care About I/O? Disk access speeds are much slower than processor and memory access speeds.
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
MDD approach for the Design of Context-Aware Applications.
Bronis R. de Supinski and Jeffrey S. Vetter Center for Applied Scientific Computing August 15, 2000 Umpire: Making MPI Programs Safe.
Code Motion for MPI Performance Optimization The most common optimization in MPI applications is to post MPI communication earlier so that the communication.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
C H A P T E R T W O Linking Syntax And Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
1 Programming Languages (CS 550) Lecture 2 Summary Mini Language Interpreter Jeremy R. Johnson.
Connecting Architecture Reconstruction Frameworks Ivan Bowman, Michael Godfrey, Ric Holt Software Architecture Group University of Waterloo CoSET ‘99 May.
CSC 4181 Compiler Construction
1 HPJAVA I.K.UJJWAL 07M11A1217 Dept. of Information Technology B.S.I.T.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
CS416 Compiler Design1. 2 Course Information Instructor : Dr. Ilyas Cicekli –Office: EA504, –Phone: , – Course Web.
Chapter 1 Introduction.
A Simple Syntax-Directed Translator
Constructing Precedence Table
Chapter 1 Introduction.
Compiler Lecture 1 CS510.
Lec00-outline May 18, 2019 Compiler Design CS416 Compiler Design.
Database SQL.
Classes and Objects Systems Programming.
SPL – PS1 Introduction to C++.
Introduction to Classes and Objects
Presentation transcript:

1 Dan Quinlan, Markus Schordan, Qing Yi Center for Applied Scientific Computing Lawrence Livermore National Laboratory Semantic-Driven Parallelization of Loops Operating on User-Defined Containers This work was performed under the auspices of the U.S. Department of Energy by the University of California, Lawrence Livermore National Laboratory, under contract No. W-7405-Eng-48

2 Outline of Talk  ROSE Architecture  AST Restructure Operations  Building Domain Specific Languages from Libraries  User-Defined Container Optimizations  Annotations  Analysis  Example  Related Work  Conclusions Diatribe Alert

3 ROSE: Tool to Build Translators ROSE AST Features: AST Query mechanisms AST Rewrite mechanisms Semantic actions associated with grammar rules Abstract C++ grammar is predefined Higher level grammars automatically generated from library source Database for Global Analysis Source code generation

4 String-Based Rewrite of AST Insert(targetNode, stringA, scope, location) replace(targetNode, stringA) Source-fragmentPrefixPostfix FC: Fragment Concatenator FE: Fragment Extractor Front-end … AST fragment Delete

5 Domain Specific Languages l Programming Languages exist to make programming productive —General purpose languages are only generally productive —Domain Specific Languages are much more productive –if used in their domain –if well designed l Compilers have a role in automating the generation of Domain Specific Languages l Observations: —Many Languages Support Abstractions —Libraries Define Abstractions —No Mechanism to Communicate Semantics of Abstractions

6 Constructive Definitions l Definition: Base Language is the language used to implement all libraries and the target applications that use them. l Definition: Abstract Grammar is the set of product rules minus those specific to any syntax. I will use Abstract Grammar and Grammar interchangeably l Definition: Domain Specific Grammar is the abstract grammar of the base language plus product rules specific to abstractions. l Trick Question: What is a Domain Specific Language without a corresponding domain specific grammar?

7 Domain Specific Languages l Observations about this Domain Specific Grammar: —1) We have defined a domain specific language —2) Can’t add syntax (no new keywords) —3) Domain Specific Language build inside of base language —4) Not a language Extension –Application and libraries are still written in the base language —5) Parser front-end need not be modified (still use EDG) —6) Process can be fully automated by processing the library’s definition (found in it’s header files) l Language --> Grammar —Domain Specific Languages have a Domain Specific Grammar —Telescoping Languages have a Telescoping Grammar Base Language Telescoping Language

8 What Good is a Telescoping Grammar? l Can be automatically generated l Don’t extend the syntax of the base language l Use same tools as base language l Helps recognize abstractions at compile-time l Simplifies transformations —High degree of resolution of language/library abstractions —Attach semantic actions to corresponding attribute grammars. A++ Library: ~80 operators, performance penalty: 3.6 u new = u -  t ( (u   )u –  u) Equation: uNew = u - dt*( u.convectiveDerivative() - nu*u.laplacian()); Code: User-Defined Container

9 Simple Motivating Example  Example Code:  Can be parallel if:  f.foobar is safe (see safety analysis)  elements of list are not aliased  After Transformation

10 Attached Semantic Action (Coco)  Transformation (SgScopeStatement rule) Evaluation of Inherited Attribute Evaluation of Synthesized Attribute Call AST Rewrite Mechanism

11 Transformation of Motivating Example

12 Annotation & Safety Analysis  Summary of annotation Mechanism  Specification of qualified container classes (by type name)  Specification of functions side-effects  Function name  Names of modified global variables  Names of modified input parameters  Summary of algorithm for safety analysis of parallelization  Check form of loop header:  for (container::iterator p = l.begin(); p != l.end(); p++)  Find modified variables in loop body  Check if locally declared or (*p)  Find function calls  Check if modifies global variables  Find modified arguments  Check if locally declared or (*p)

13 Related Work l Large body of autoparallelizing Fortran compilers: —Dsystem, Fx, Vienna Fortran Compiler, Paradigm, Polaris, SUIF (F77, C, C++) l Parallel STL like containers —STAPL (parallel STL library) —Parallel Standard Library l Broadway Compiler (C compiler) —More sophisticated annotation language l Telescoping Language work at RICE

14 Conclusions and Future Work l Compile-Time optimization of a library abstraction l Semantic-Driven parallelization of iterations over user-defined container similar to STL l One possible approach to parallel STL? l Demonstrates transformation specific annotation mechanism (not as powerful as that within the Broadway Compiler) l Future Work: —More sophisticated annotation mechanism for function side-effects –automated support –combined with support in ROSE for global analysis —Specification of semantics —Less conservative, more precise analysis —Optimize performance of object-oriented scientific libraries