ACAT 2008 Axel Naumann (CERN), Philippe Canal (Fermilab) The Role of Interpreters in High Performance Computing.

Slides:



Advertisements
Similar presentations
Configuration management
Advertisements

COM vs. CORBA.
MIS 2000 Class 20 System Development Process Updated 2014.
Status and Future of CINT Reflex as Reflection Database Object-Oriented CINT Multi-Threading Masaharu Goto, Agilent Philippe Canal, Fermilab Stefan Roiser,
LLVM-based C++ Interpreter For ROOT Axel Naumann, CERN Lukasz Janyst, CERN Philippe Canal, Fermilab.
MotoHawk Training Model-Based Design of Embedded Systems.
Software Language Levels Machine Language (Binary) Assembly Language –Assembler converts Assembly into machine High Level Languages (C, Perl, Shell)
COMP205 Comparative Programming Languages Part 1: Introduction to programming languages Lecture 3: Managing and reducing complexity, program processing.
Usage of the Python Programming Language in the CMS Experiment Rick Wilkinson (Caltech), Benedikt Hegner (CERN) On behalf of CMS Offline & Computing 1.
SCRIPTING LANGUAGE. The first interactive shells were developed in the 1960s to enable remote operation of the first time-sharing systems, and these,
Guide To UNIX Using Linux Third Edition
Axel Naumann, DØ University of Nijmegen, The Netherlands 28 June 2002 ACAT02 1 Session IV: Innovative Algorithms The Sum Statistics Clusters by Content.
Automated Tests in NICOS Nightly Control System Alexander Undrus Brookhaven National Laboratory, Upton, NY Software testing is a difficult, time-consuming.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Your Interactive Guide to the Digital World Discovering Computers 2012.
Xenios Papademetris Departments of Diagnostic Radiology and Biomedical Engineering Yale University School of Medicine.
Introduction to High-Level Language Programming
Chapter 6 – Architectural Design Lecture 2 1Chapter 6 Architectural design.
Introduction to Java Tonga Institute of Higher Education.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Compilers, Interpreters and Debuggers Ruibin Bai (Room AB326) Division of Computer Science.
CINT Retrospect ROOT Workshop Mar 2013 Agilent Technologies Masaharu Goto.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
K. Harrison CERN, 20th April 2004 AJDL interface and LCG submission - Overview of AJDL - Using AJDL from Python - LCG submission.
CINT & Reflex: New Reflection Data Structures Masa(haru) Goto Agilent Philippe Canal Fermilab/CD Stefan Roiser, Axel Naumann PH/SFT.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Axel Naumann University of Nijmegen / NIKHEF, NL ROOT 2004 Users Workshop The Future of THtml Plans and Status of ROOT’s documentation facility.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Introduction Advantages/ disadvantages Code examples Speed Summary Running on the AOD Analysis Platforms 1/11/2007 Andrew Mehta.
9-13/9/03 Atlas Overview WeekPeter Sherwood 1 Atlfast, Artemis and Atlantis What, Where and How.
THtml  THtml will generate >=1 doc.root file .html pages generated from doc.root files by April (Feb doesn't exist)  Bertrand: extract doc for online.
Cling – The New C++ Interpreter for ROOT 6
Marco Cattaneo - DTF - 28th February 2001 File sharing requirements of the physics community  Background  General requirements  Visitors  Laptops 
Compiler Construction (CS-636)
Introduction to programming Carl Smith National Certificate Year 2 – Unit 4.
 Programming - the process of creating computer programs.
Integration of the ATLAS Tag Database with Data Management and Analysis Components Caitriana Nicholson University of Glasgow 3 rd September 2007 CHEP,
Computing R&D and Milestones LHCb Plenary June 18th, 1998 These slides are on WWW at:
Pattern Bridge. Definition Bridge is the structural pattern that separates abstraction from the implementation so that both of them can be changed independently.
K. Harrison CERN, 3rd March 2004 GANGA CONTRIBUTIONS TO ADA RELEASE IN MAY - Outline of Ganga project - Python support for AJDL - LCG analysis service.
THtml rev 2.0 Status and Plans of ROOT’s documentation facility Axel Naumann / Fermilab.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
ROOT Team Meeting Axel Naumann CERN PH/SFT Crienftlex Extended Version. And also Director’s Cut. Crienftlex.
CINT & Reflex – The Future CINT’s Future Layout Reflex API Work In Progress: Use Reflex to store dictionary data Smaller memory footprint First step to.
Observing the Current System Benefits Can see how the system actually works in practice Can ask people to explain what they are doing – to gain a clear.
INFSO-RI Enabling Grids for E-sciencE Using of GANGA interface for Athena applications A. Zalite / PNPI.
Axel Naumann, DØ University of Nijmegen, The Netherlands 04/20/2002 APS April Meeting 2002 Prospects of the Multivariate B Quark Tagger for the Level 2.
ITP 109 Week 2 Trina Gregory Introduction to Java.
David Adams ATLAS ATLAS Distributed Analysis and proposal for ATLAS-LHCb system David Adams BNL March 22, 2004 ATLAS-LHCb-GANGA Meeting.
Axel Naumann, DØ University of Nijmegen, The Netherlands 6/20/2001 Dutch Morning Meeting 1 From n-Tuples to b-Tags ?
OCR A Level F453: The function and purpose of translators Translators a. describe the need for, and use of, translators to convert source code.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Introduction To Software Development Environment.
POOL Based CMS Framework Bill Tanenbaum US-CMS/Fermilab 04/June/2003.
Your Interactive Guide to the Digital World Discovering Computers 2012 Chapter 13 Computer Programs and Programming Languages.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Overview of Compilers and Language Translation
CMS High Level Trigger Configuration Management
Key Ideas from day 1 slides
Topics Introduction to Repetition Structures
Lecture 1 Runtime environments.
CMP 131 Introduction to Computer Programming
Chapter 7 –Implementation Issues
Lecture 1 Runtime environments.
Programming language translators
Presentation transcript:

ACAT 2008 Axel Naumann (CERN), Philippe Canal (Fermilab) The Role of Interpreters in High Performance Computing

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab2 Applications Wide range: Job management: submission, error control Gluing programs and configurations “Volatile” algorithms subject to change / part of the configuration

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab3 Traditional Area of Use Performance Interactivity Compiled Code Interpreted Code

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab4 From Text… Analyses subject to change Different cuts, parameters Different input / output (More or less) easy to configure using text files: or databases JetETMin: 12 NJetsMin: 2

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab5 … To Code: Volatile Algorithms Changes to algorithms themselves Especially during development » two jets and one muon each » three jets and two muons anywhere » no isolated muon Configuration not trivial! TriggerFlags.doMuon=False EFMissingET_Met.Tools = \ [EFMissingETFromFEBHeader()]

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab6 Algorithms As Configuration Acknowledge physicists’ reality: Refining analyses is asymptotic process Programs and algorithms change Often tens or hundreds of optimization steps before target algorithm is found Almost the same: » background analysis vs. signal analysis » trigger A vs. trigger B

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab7 Why Use Interpreters? Slower than compiled code Difficult to quantify: nested loops calls into libraries virtual functions, etc. Usually O(1)-O(10) slower than compiled code Interpreters can not replace compiled code! hist.Draw() foreach event { foreach muon {...

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab8 Why Use Interpreters? Slower than compiled code Not integrated well with reconstruction software Can be unreliable Not part of the build system Difficult to debug Not convincing! And yet…

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab9 Compiled vs. Interpreter Compiled: usually many packages need changes by regular physicists as opposed to release managers Interpreter: helps localize changes, modular algorithmic test bed

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab10 Interpreter Advantage: Localized Compiled: distributed changes Interpreter: localized changes Easier to track (CVS / SVN) Less side effects Feeling of control over software Eases communication / validation of algorithms

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab11 Interpreter Advantage: Data Access Easier access to data: Interpreters can analyze data format, interpret code Hide data details irrelevant for analysis: vector – hash_map – list ? Who cares! Framework provides job setup transparently foreach electron {... MyAnalysis(const Event& event)

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab12 Interpreter Advantage: Agility Interpreter boosts users' agility compared to configuration file more expressiveness thus higher threshold for recompilation of the framework +postZeroJets.Run: NJetsCut(postzerojets) \ VJetsPlots(postZeroJetPlots) virtual int Run() { if (NJetsCut(postzerojets)) VJetsPlots(postZeroJetPlots); }

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab13 Ideal Interpreter 1.Fast, e.g. compile just-in-time 2.No errors introduced: quality of all ingredients Code Output Interpreter Parser Execution Bytecode

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab14 Ideal Interpreter 3.Smooth transition to compiled code: With compiler or conversion to compiled language 4.Straight-forward use: known / easy language Possible extensions with conversion to e.g. C++ foreach electron in tree.Electrons vector * ve = 0; tree->SetBranchAddress("Electrons", ve); tree->GetBranch("Electrons")->GetEntry(ev); for (int i=0; i<ve.size(); ++i) { Electron* electron = ve[i];

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab15 Common Languages Job management: shell (bash) Glue: shell, python Algorithms: python, C++, custom Focus on volatile algorithms.

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab16 Common Interpreter Options: Custom Even though not interpreted as interpreter: postzerojets.nJetsMin: 0 postzerojets.nJetsMax: 0 +postZeroJets.Run: NJetsCut(postzerojets) \ VJetsPlots(postZeroJetPlots) postzerojets.JetBranch: %{VJets.GoodJet_Branch} Parameters Algorithm

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab17 Common Interpreter Options: Python Distinct interpreter language Interface to ROOT Rigid style: easy to learn, easy to read, easy to communicate h1f = TH1F('h1f', 'Test', 200, 0, 10) h1f.SetFillColor(45) h1f.FillRandom('sqroot', 10000) h1f.Draw()

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab18 Python: Abstraction Real power is abstraction: can do without types: can loop without knowing collection: Major weakness: compile time errors become runtime errors for event in events: muons = event.Muons for muon in muons: print muon.pt() h1f = TH1F(...)

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab19 PyROOT: The Maze ROOT's python interface for e.g. Atlas: CINT Cintex Atlas code PyROOT ROOT Dictionary (Reflex)

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab20 Common Interpreter Options: CINT C++ should be prerequisite to data analysis anyway – interpreter often used for first steps Seamless integration with C++ software, e.g. ROOT itself Can migrate code to framework! Rapid edit/run cycles compared to framework void draw() { TH1F* h1 = new TH1F(...); h1->Draw(); }

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab21 Common Interpreter Options: CINT Forgiving: automatic #includes, library loading Major issue: correctness // load libHist.so #include "TH1.h" void draw() { TH1F* h1 = new TH1F(...); h1->Draw(); }

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab22 Common Interpreter Options: CINT Covers large parts of ISO C++: templates, virtual functions, etc. >15 years of development! Can be invoked from compiled code: Or from prompt, e.g. on a whole C++ file: gROOT->ProcessLine("new Klass(12)"); root [0].L MyCode.cxx

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab23 CINT And Libraries Call into library: Even custom library: Knows what "Klass" is! Translates "Klass::Gimme()" into a call! root [0] gSystem->Load("Klass.so") root [1] Klass* k = Klass::Gimme() root [2] k->Say() TH1F* h1 = new TH1F(...); h1->Draw();

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab24 CINT And Dictionaries CINT must know available types, functions Extracted by special CINT run from library's headers (alternatives exist) Often provided by experiments' build system Also prerequisite for data storage, see "Data and C++" tomorrow at 3pm

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab25 CINT And ACLiC The plus in Invokes: dictionary generator compiler linker with dependency tracking! Any platform, any compiler, with any libraries! Trivial transition from interpreted to compiled! root [0].L MyCode.cxx+

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab26 Less Walls With ACLiC Performance Interactivity Compiled Code Interpreted Code

ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab27 LLVM Alternative to CINT based on LLVM? See plenary talk by Chris Lattner tomorrow morning LLVM is much more than a compiler Modular design, allows us to hook e.g. into output of parser, language-independent code representation (IR) Offers JIT, bytecode interpreter…

Summary: Interpreters Wide spectrum of applications and solutions Python and CINT are widespread and reasonable options with different use cases 1.Must not replace compiled analysis! 2.No good reason to invent custom configuration language: don't forget the algorithms! ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab28

Summary: C++ Interpreter CINT has known issues Transparent transition between interpreted and compiled world: huge benefit We have many years of experience, several options for improving it Keep interpreted C++ on stage! ACAT 2008 Axel Naumann, PH/SFT, CERN; Philippe Canal, Fermilab29