Introducing Tetra: An Educational Parallel Programming System



Similar documents
Introducing Tetra: An Educational Parallel Programming System

Massachusetts Institute of Technology 6.005: Elements of Software Construction Fall 2011 Quiz 2 November 21, 2011 SOLUTIONS.

Semester Review. CSC 301, Fall 2015

Chapter 3.2 C++, Java, and Scripting Languages. The major programming languages used in game development.

MYPY: A PYTHON VARIANT WITH SEAMLESS DYNAMIC AND STATIC TYPING. Jukka Lehtosalo University of Cambridge Computer Laboratory

sc13.wlu.edu Steven Bogaerts Assistant Professor of Computer Science DePauw University Greencastle, IN

Debugging Java Applications

Application Development,.NET

Domains are first-class index sets Specify the size and shape of arrays Support iteration, array operations, etc.

Course Development of Programming for General-Purpose Multicore Processors

Spring 2011 Prof. Hyesoon Kim

Using Eclipse CDT/PTP for Static Analysis

Chapter 6 Load Balancing

Overview. CMSC 330: Organization of Programming Languages. Synchronization Example (Java 1.5) Lock Interface (Java 1.5) ReentrantLock Class (Java 1.

HPC Wales Skills Academy Course Catalogue 2015

MPI and Hybrid Programming Models. William Gropp

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters

HIGH PERFORMANCE BIG DATA ANALYTICS

Java SE 8 Programming

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University

Compute Cluster Server Lab 3: Debugging the parallel MPI programs in Microsoft Visual Studio 2005

Debugging with TotalView

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Parallel Computing in Python: multiprocessing. Konrad HINSEN Centre de Biophysique Moléculaire (Orléans) and Synchrotron Soleil (St Aubin)

Technical paper review. Program visualization and explanation for novice C programmers by Matthew Heinsen Egan and Chris McDonald.

#820 Computer Programming 1A

Applications to Computational Financial and GPU Computing. May 16th. Dr. Daniel Egloff

The P3 Compiler: compiling Python to C++ to remove overhead

ACTOR-BASED MODEL FOR CONCURRENT PROGRAMMING. Sander Sõnajalg

PARALLEL JAVASCRIPT. Norm Rubin (NVIDIA) Jin Wang (Georgia School of Technology)

Java SE 7 Programming

GUI and Web Programming

SMock A Test Platform for the Evaluation of Monitoring Tools

Computer Programming I

GTask Developing asynchronous applications for multi-core efficiency

<Insert Picture Here> What's New in NetBeans IDE 7.2

Bug hunting. Vulnerability finding methods in Windows 32 environments compared. FX of Phenoelit

CSE 6040 Computing for Data Analytics: Methods and Tools

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

PROFESSIONAL. Node.js BUILDING JAVASCRIPT-BASED SCALABLE SOFTWARE. Pedro Teixeira WILEY. John Wiley & Sons, Inc.

Using the Intel Inspector XE

Parallel Programming for Multi-Core, Distributed Systems, and GPUs Exercises

Computing Concepts with Java Essentials

Computer Programming I & II*

Software Testing. Definition: Testing is a process of executing a program with data, with the sole intention of finding errors in the program.

Computer Science 1 CSci 1100 Lecture 3 Python Functions

Getting Started with the Internet Communications Engine

The Asterope compute cluster

For Introduction to Java Programming, 5E By Y. Daniel Liang

USE OF PYTHON AS A SATELLITE OPERATIONS AND TESTING AUTOMATION LANGUAGE

Java SE 7 Programming

A Thread Monitoring System for Multithreaded Java Programs

Debugging Multi-threaded Applications in Windows

Performance Testing for GDB

An Internet Course in Software Development with C++ for Engineering Students

Java Interview Questions and Answers

Extending XSLT with Java and C#

Scala Actors Library. Robert Hilbrich

MARTe Framework. Middleware for RT Control Development

Integrating TAU With Eclipse: A Performance Analysis System in an Integrated Development Environment

POOSL IDE User Manual

Frysk The Systems Monitoring and Debugging Tool. Andrew Cagney

Using EDA Databases: Milkyway & OpenAccess

An Easier Way for Cross-Platform Data Acquisition Application Development

Stack Allocation. Run-Time Data Structures. Static Structures

Programming Languages

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

GPU Tools Sandra Wienke

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Parallel Programming Map-Reduce. Needless to Say, We Need Machine Learning for Big Data

Multi-threaded Debugging Using the GNU Project Debugger

All ju The State of Software Development Today: A Parallel View. June 2012

Chapter 6: Programming Languages

aicas Technology Multi Core und Echtzeit Böse Überraschungen vermeiden Dr. Fridtjof Siebert CTO, aicas OOP 2011, 25 th January 2011

Real-time Debugging using GDB Tracepoints and other Eclipse features

Hadoop Parallel Data Processing

Adobe ColdFusion Builder

BIG CPU, BIG DATA. Solving the World s Toughest Computational Problems with Parallel Computing. Alan Kaminsky

Moving from CS 61A Scheme to CS 61B Java

#pragma omp critical x = x + 1; !$OMP CRITICAL X = X + 1!$OMP END CRITICAL. (Very inefficiant) example using critical instead of reduction:

Parallel Debugging with DDT

Java (12 Weeks) Introduction to Java Programming Language

Multicore Parallel Computing with OpenMP

Unit 8: Immutability & Actors

! Past few lectures: Ø Locks: provide mutual exclusion Ø Condition variables: provide conditional synchronization

JVM Tool Interface. Michal Pokorný

OpenACC 2.0 and the PGI Accelerator Compilers

BIG CPU, BIG DATA. Solving the World s Toughest Computational Problems with Parallel Computing. Alan Kaminsky

Developing a MapReduce Application

Four Keys to Successful Multicore Optimization for Machine Vision. White Paper

Mrs: MapReduce for Scientific Computing in Python

A Comparison Of Shared Memory Parallel Programming Models. Jace A Mogill David Haglin

Parallel Algorithm Engineering

Microsoft Windows PowerShell v2 For Administrators

Chapter 1. Introduction to ios Development. Objectives: Touch on the history of ios and the devices that support this operating system.

Easing embedded Linux software development for SBCs

Curriculum Map. Discipline: Computer Science Course: C++

Mining a Change-Based Software Repository

Parallel Ray Tracing using MPI: A Dynamic Load-balancing Approach

Monitors, Java, Threads and Processes

Transcription:

Introducing Tetra: An Educational Parallel Programming System, Jerome Mueller, Shehan Rajapakse, Daniel Easterling May 25, 2015

Motivation We are in a multicore world. Several calls for more parallel programming, earlier in the curriculum 1. Yet to happen in a wide-spread way. 1 Parallel from the beginning: The Case for Multicore Programming in the Computer Science Undergraduate Curriculum

Introductory Languages Shift to higher-level languages for introductory courses 1. Python s global interpreter lock makes parallelism impossible 2. Java requires knowledge of libraries, inheritance and polymorphism. C and C++ not widely used for introductory courses. 1 Python is Now the Most Popular Introductory Teaching Language at Top U.S. Universities 2 Understanding the Python GIL

Parallel Debugging Parallel programs harder to debug. There is a lack of good tool support. Hard to stop the world when running parallel code.

Tetra Programming Language High-level and similar to Python. Built-in support for parallelism. IDE Standard IDE features for editing and running programs. Debugger geared especially for parallel programs.

Base Language Simple procedural programming language. Syntax based on Python. Statically typed with local inference. Requires a main function. # a simple factorial function def fact(x int) int: if x == 0: return 1 else: return x * fact(x - 1) # the main function def main( ): print("enter n: ") n = read_int( ) print(n, "! = ", fact(n))

Parallel Statements Each statement under a parallel block is executed in parallel. The program waits for all to finish before continuing. def main( ): # call two functions in parallel parallel: f1( ) f2( ) # now they are both done print("all done!")

Background Statements The statements under a background block are executed asynchronously from the rest. The background task is allowed to finish if the outer code returns. def main( ): # launch a task in the background background: f1( ) f2( ) # continue on f3( )

Parallel For Loops A parallel for loop signifies the iterations are independent of each other. The iterations are divided amongst a pool of threads. def main( ): # process values 1-100 in parallel parallel for i in [1... 100]: process(i)

Locks Locks provide mutual exclusion. No two threads enter an area with the same lock name at the same time. # globals need mutual exclusion global value = 0 def inc( ): lock value_lock: value = value + 1 def dec( ): lock value_lock: value = value - 1

Sequential Sum Program in Python total = 0 def sum_range(numbers, a, b): i = a while i <= b: global total total = total + numbers[i] i = i + 1 numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] sum_range(numbers, 0, 9) print(total)

Parallel Sum Program in Python from threading import Thread, Lock total = 0 lock = Lock( ) def sum_range(numbers, a, b): i = a while i <= b: global total lock.acquire( ) total = total + numbers[i] lock.release( ) i = i + 1 numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] t1 = Thread(target = sum_range, args = (numbers, 0, 4)) t1.start( ) t2 = Thread(target = sum_range, args = (numbers, 5, 9)) t2.start( ) t1.join( ) t2.join( ) print(total)

Sequential Sum Program in Tetra global total = 0 def sum_range(numbers [int], a int, b int): i = a while i <= b: total = total + numbers[i] i = i + 1 def main( ): numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] sum_range(numbers, 0, 9) print(total)

Parallel Sum Program in Tetra global total = 0 def sum_range(numbers [int], a int, b int): i = a while i <= b: lock total_lock: total = total + numbers[i] i = i + 1 def main( ): numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] parallel: sum_range(numbers, 0, 4) sum_range(numbers, 5, 9) print(total)

First Class Parallelism Minimizes boilerplate code. Reduces chance of making simple mistakes. Requires less knowledge of the language.

Interpreter Tetra code is parsed into an AST which is interpreted. Threads are launched when parallel nodes are reached. Goal is to achieve speedup on parallel code. parallel for i in [1... 100]: process(i)

Speedup Finding Primes from 1 to 1,000,000

Speedup 10 City Traveling Salesman Problem

Debugging Interpreter also supports dynamic debugging A command line debugger supports breakpoints, listing variables, inspecting values, stepping through execution, listing thread states, switching threads and stopping threads. Supports stop the world debugging.

IDE Integrated Development Environment being developed. Supports editing, saving, and running programs. Supports some debugging commands.

IDE Screenshot

Related Work Parallel Languages Several languages provide first-class parallelism such as X10, Chapel, Cilk, and UPC. Parallel features also inspired from OpenMP. Parallel Debuggers Most debuggers provide some support for debugging parallel code, but lack the ability to step through threads totally independently.

Future Work Improvement of the IDE. Additional language features. More robust standard library. A study of Tetra in a classroom setting to see if it does help students develop parallel programs. A native code compiler.

Conclusion Most languages focused on ease of use or efficiency. Tetra is geared towards providing parallelism in a simple way. While there is much future work, Tetra can be used to write and debug parallel code.

Questions Questions?