1 Hierarchical Pointer AnalysisAmir Kamil Hierarchical Pointer Analysis for Distributed Programs Amir Kamil U.C. Berkeley December 7, 2005.

Slides:



Advertisements
Similar presentations
IBM Research: Software Technology © 2006 IBM Corporation 1 Programming Language X10 Christoph von Praun IBM Research HPC WPL Sandia National Labs December.
Advertisements

A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Pallavi Joshi  Chang-Seo Park  Koushik Sen  Mayur Naik ‡  Par Lab, EECS, UC Berkeley‡
Programming Languages and Paradigms
Chapter 9 Pointers and Dynamic Arrays. Overview 9.1 Pointers 9.2 Dynamic Arrays.
A pointer is the memory address of a variable. A memory address is a physical location within a system’s memory space. A pointer variable is variable used.
Introduction to the Partitioned Global Address Space (PGAS) Programming Model David E. Hudak, Ph.D. Program Director for HPC Engineering
Computer Architecture CSCE 350
COP4020 Programming Languages Expression and assignment Prof. Xin Yuan.
Types and Arithmetic Operators
Parameter Passing. Variables: lvalues and rvalues In the assignment statement “X=Y”, variables X and Y are being used in different ways. Y is being used.
CSE-321 Programming Languages Subtyping POSTECH May 14, 2007 박성우.
Engineering Problem Solving With C++ An Object Based Approach Chapter 9 Pointers and Creating Data Structures.
Comp 205: Comparative Programming Languages Semantics of Imperative Programming Languages denotational semantics operational semantics logical semantics.
1 Synthesis of Distributed ArraysAmir Kamil Synthesis of Distributed Arrays in Titanium Amir Kamil U.C. Berkeley May 9, 2006.
Pobj “objects that last” Course Project, CS262a, Fall ‘04 Amir Kamil and Gilad Arnold.
CSE 2501 Review Declaring a variable allocates space for the type of datum it is to store int x; // allocates space for an int int *px; // allocates space.
Evaluation and Optimization of a Titanium Adaptive Mesh Refinement Amir Kamil Ben Schwarz Jimmy Su.
Denotational Semantics Syntax-directed approach, generalization of attribute grammars: –Define context-free abstract syntax –Specify syntactic categories.
Type Systems For Distributed Data Sharing Ben Liblit Alex AikenKathy Yelick.
ECE122 L22: Polymorphism Using Inheritance April 26, 2007 ECE 122 Engineering Problem Solving with Java Lecture 22 Polymorphism using Inheritance.
Chapter 9: Subprogram Control
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Chapter 6: Type Systems Fall 2009.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 6 Type Systems I was eventually persuaded.
Parameter Passing. Expressions with lvalues and rvalues An expression has an lvalue/rvalue if it can be placed on the left/right side of an assignment.
Pointers Applications
Making Sequential Consistency Practical in Titanium Amir Kamil and Jimmy Su.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 13: Pointers, Classes, Virtual Functions, and Abstract Classes.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 14: Pointers, Classes, Virtual Functions, and Abstract Classes.
Feudal C Automatic memory management with zero runtime overhead CS263 - Spring 1999 Scott McPeak Dan Bonachea Carol Hurwitz C.
Imperative Programming
CIS Computer Programming Logic
ICOM 5995: Performance Instrumentation and Visualization for High Performance Computer Systems Lecture 7 October 16, 2002 Nayda G. Santiago.
Static and Dynamic Behavior CMPS Power of OOP Derives from the ability of objects to change their behavior dynamically at run time. Static – refers.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
LANGUAGE TRANSLATORS: WEEK 24 TRANSLATION TO ‘INTERMEDIATE’ CODE (overview) Labs this week: Tutorial Exercises on Code Generation.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Threads and Processes.
1 Concurrent Languages – Part 1 COMP 640 Programming Languages.
Computer Science Department Data Structure & Algorithms Lecture 8 Recursion.
Storage Allocation for Embedded Processors By Jan Sjodin & Carl von Platen Present by Xie Lei ( PLS Lab)
Basic Semantics Associating meaning with language entities.
Semantics of Arrays and Pointers By: M. Reza Heydarian Introduction Pointers Arrays Semantics of Arrays Semantics of Pointers.
Introduction to Programming Languages S1.3.1Bina © 1998 Liran & Ofir Introduction to Programming Languages Programming in C.
RUN-Time Organization Compiler phase— Before writing a code generator, we must decide how to marshal the resources of the target machine (instructions,
Lecture 5 Page 1 CS 111 Online Processes CS 111 On-Line MS Program Operating Systems Peter Reiher.
Using Types to Analyze and Optimize Object-Oriented Programs By: Amer Diwan Presented By: Jess Martin, Noah Wallace, and Will von Rosenberg.
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
Programming Languages and Paradigms Activation Records in Java.
Principle of Programming Lanugages 3: Compilation of statements Statements in C Assertion Hoare logic Department of Information Science and Engineering.
C H A P T E R T H R E E Type Systems and Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
C-- The lowest "high level" language... even lower than C.
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
Subtying Kangwon National University 임현승 Programming Languages These slides were originally created by Prof. Sungwoo Park at POSTECH.
1 Titanium Review: GASNet Trace Wei Tu GASNet Trace Wei Tu U.C. Berkeley September 9, 2004.
Memory Management in Java Mr. Gerb Computer Science 4.
FASTFAST All rights reserved © MEP Make programming fun again.
Lecture 3: More Java Basics Michael Hsu CSULA. Recall From Lecture Two  Write a basic program in Java  The process of writing, compiling, and running.
Recap Resizing the Vector Push_back function Parameters passing Mechanism Primitive Arrays of Constants Multidimensional Arrays The Standard Library string.
Design issues for Object-Oriented Languages
Types Type Errors Static and Dynamic Typing Basic Types NonBasic Types
Data Types In Text: Chapter 6.
Expressions and Assignment
Records Design Issues: 1. What is the form of references?
Optimization Code Optimization ©SoftMoore Consulting.
Amir Kamil and Katherine Yelick
Variables ICS2O.
Variables Numbers can be stored and retrieved while a program is running if they are given a home. The way that integers and decimal numbers are stored.
Amir Kamil and Katherine Yelick
Course Overview PART I: overview material PART II: inside a compiler
Type Systems For Distributed Data Sharing
Product Training Program
Presentation transcript:

1 Hierarchical Pointer AnalysisAmir Kamil Hierarchical Pointer Analysis for Distributed Programs Amir Kamil U.C. Berkeley December 7, 2005

2 Amir KamilHierarchical Pointer Analysis Background Titanium is a single program, multiple data (SPMD) dialect of Java All threads execute the same program text Designed for distributed machines Global address space – all threads can access all memory At runtime, threads are grouped into processes A thread shares a physical address space with some other, but not all threads

3 Amir KamilHierarchical Pointer Analysis Memory Hierarchy Global memory is composed of a hierarchy Locations can be thread-local (tlocal), process- local (plocal), or in another process (global) 0123 tlocalplocal global Threads Program Processes

4 Amir KamilHierarchical Pointer Analysis Goal Our goal is to produce a (flow-insensitive) pointer analysis that takes the memory hierarchy into account We define a small SPMD language based on Titanium We produce a type system that accounts for the memory hierarchy We give an overview of the abstract pointer analysis

5 Amir KamilHierarchical Pointer Analysis Language Syntax Types  ::= int | ref q  Qualifiers q ::= tlocal | plocal | global global) Expressions e ::= new l  (allocation) | transmit e 1 from e 2 (communication) | e 1 Ã e 2 (dereferencing assignment)

6 Amir KamilHierarchical Pointer Analysis Type Rules – Allocation  ` new l  : ref tlocal  Thread 0 new l int tlocal The expression new l  allocates space of type  in local memory and returns a reference to the location The label l is unique for each allocation site and will be used by the pointer analysis The resulting reference is qualified with tlocal, since it references thread-local memory

7 Amir KamilHierarchical Pointer Analysis Type Rules – Communication  ` e 1 :  ` e 2 : int  ` transmit e 1 from e 2 : expand( , global) Thread 0Thread 1 y global tlocal transmit y from 1 The expression transmit e 1 from e 2 evaluates e 1 on the thread given by e 2 and retrieves the result If e 1 has reference type, the result type must be widened to global Statically do not know source thread, so must assume it can be any thread expand(ref q , q’) ´ ref t (q, q’)  expand( , q’) ´  otherwise

8 Amir KamilHierarchical Pointer Analysis Type Rules – Dereferencing Assignment The expression e 1 Ã e 2 puts the value of e 2 into the location referenced by e 1 (like *e 1 = e 2 in C) If e 1 has type ref plocal ref tlocal , and e 2 has type ref tlocal , the assignment could be unsound Thread 0Thread 1 y z plocal tlocal plocal  ` e 1 : ref q  ` e 2 :  robust( , q)  ` e 1 Ã e 2 : ref q  robust(ref q , q’) ´ false if q’ robust( , q’) ´ true otherwise

9 Amir KamilHierarchical Pointer Analysis Pointer Analysis Since language is SPMD, analysis is only done for a single thread (assume thread 0) Each expression has a points-to set of abstract locations that it can reference Abstract locations also have points-to sets Abstract locations consist of label and qualifier A-loc (l, q) can refer to any concrete location allocated at label l and with type qualifier v q from thread 0 Thread 0 new l int tlocal Thread 1 new l int tlocal (l, tlocal) (l, plocal)

10 Amir KamilHierarchical Pointer Analysis Pointer Analysis – Allocation and Communication The abstract semantics for allocation and communication are similar to the type rules An allocation new l  produces a new abstract location (l, tlocal) The result of the expression transmit e 1 from e 2 is the global versions of the a-locs resulting from e 1 e 1 ! {(l 1, tlocal), (l 2, plocal), (l 3, global)} transmit e 1 from e 2 ! {(l 1, global), (l 2, global), (l 3, global)}

11 Amir KamilHierarchical Pointer Analysis Pointer Analysis – Dereferencing Assignment For assignment, must take into account actions of other threads Thread 0 x (l 1, tlocal) y (l 2, tlocal) Thread 1 x (l 1, plocal) y (l 2, plocal) Thread 2 x (l 1, plocal) y (l 2, plocal) x ! {(l 1, tlocal)}, y ! {(l 2, plocal)} x à y : (l 1, tlocal) ! (l 2, plocal), (l 1, plocal) ! (l 2, plocal), (l 1, global) ! (l 2, global)

12 Amir KamilHierarchical Pointer Analysis Race Detection Results Static race detection in Titanium using pointer analysis + concurrency analysis Most are false positives, so lower is better BenchmarkNo Pointer Analysis One-Level Analysis Two-Level Analysis gas gsrb lu-fact pps spmv