Parallel Gaudi A reminder and prospects

Slides:



Advertisements
Similar presentations
David Adams ATLAS DIAL Distributed Interactive Analysis of Large datasets David Adams BNL March 25, 2003 CHEP 2003 Data Analysis Environment and Visualization.
Advertisements

14.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
K.Harrison CERN, 23rd October 2002 HOW TO COMMISSION A NEW CENTRE FOR LHCb PRODUCTION - Overview of LHCb distributed production system - Configuration.
Chapter 6: An Introduction to System Software and Virtual Machines
DIRAC API DIRAC Project. Overview  DIRAC API  Why APIs are important?  Why advanced users prefer APIs?  How it is done?  What is local mode what.
Large scale data flow in local and GRID environment V.Kolosov, I.Korolko, S.Makarychev ITEP Moscow.
DIANE Overview Germán Carrera, Alfredo Solano (CNB/CSIC) EMBRACE COURSE Monday 19th of February to Friday 23th. CNB-CSIC Madrid.
MC, REPROCESSING, TRAINS EXPERIENCE FROM DATA PROCESSING.
REVIEW OF NA61 SOFTWRE UPGRADE PROPOSAL. Mandate The NA61 experiment is contemplating to rewrite its fortran software in modern technology and are requesting.
LC Software Workshop, May 2009, CERN P. Mato /CERN.
Job handling in Ganga Jakub T. Moscicki ARDA/LHCb GANGA-DIRAC Meeting, June, 2005.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
Introduction Advantages/ disadvantages Code examples Speed Summary Running on the AOD Analysis Platforms 1/11/2007 Andrew Mehta.
The Alternative Larry Moore. 5 Nodes and Variant Input File Sizes Hadoop Alternative.
ROOT and Federated Data Stores What Features We Would Like Fons Rademakers CERN CC-IN2P3, Nov, 2011, Lyon, France.
Reconstruction Configuration with Python Chris Jones University of Cambridge.
Tutorial: Big Data Algorithms and Applications Under Hadoop KUNPENG ZHANG SIDDHARTHA BHATTACHARYYA
INFSO-RI Enabling Grids for E-sciencE Ganga 4 – The Ganga Evolution Andrew Maier.
1 SICBDST and Brunel Migration status and plans. 2 Migration Step 1: SICBMC/SICBDST split  Last LHCb week: Split done but not tested  Software week.
1 DIRAC Job submission A.Tsaregorodtsev, CPPM, Marseille LHCb-ATLAS GANGA Workshop, 21 April 2004.
Pere Mato (CERN) 10 October  Triggered by the needs from physicists  Main goal ◦ Get quicker responses when having 4-8 core machines at your disposal.
Andrea Valassi (CERN IT-DB)CHEP 2004 Poster Session (Thursday, 30 September 2004) 1 HARP DATA AND SOFTWARE MIGRATION FROM TO ORACLE Authors: A.Valassi,
HPC pilot code. Danila Oleynik 18 December 2013 from.
INFSO-RI Enabling Grids for E-sciencE Using of GANGA interface for Athena applications A. Zalite / PNPI.
Random Logic l Forum.NET l State Machine Mechanism Forum.NET 1 st Meeting ● December 27, 2005.
MULTIPROCESSING MODULE OF PYTHON. CPYTHON  CPython is the default, most-widely used implementation of the Python programming language.  CPython - single-threaded.
LHCb Core Software Programme of Work January, 2012 Pere Mato (CERN)
Barthélémy von Haller CERN PH/AID For the ALICE Collaboration The ALICE data quality monitoring system.
ANALYSIS TRAIN ON THE GRID Mihaela Gheata. AOD production train ◦ AOD production will be organized in a ‘train’ of tasks ◦ To maximize efficiency of full.
1 Remote Installation Service Windows 2003 Server Prof. Abdul Hameed.
Apache Ignite Compute Grid Research Corey Pentasuglia.
L’analisi in LHCb Angelo Carbone INFN Bologna
WP18, High-speed data recording Krzysztof Wrona, European XFEL
Introduction to Distributed Platforms
Chapter 3: Process Concept
Progress on NA61/NA49 software virtualisation Dag Toppe Larsen Wrocław
Software for Spectrometer T0 jumps correction
CS 6560: Operating Systems Design
GWE Core Grid Wizard Enterprise (
Multicore Computing in ATLAS
INFN-GRID Workshop Bari, October, 26, 2004
Sharing Memory: A Kernel Approach AA meeting, March ‘09 High Performance Computing for High Energy Physics Vincenzo Innocente July 20, 2018 V.I. --
Chapter 3: Process Concept
LHCb Software Tutorial
Software Engineering Introduction to Apache Hadoop Map Reduce
Grid Canada Testbed using HEP applications
湖南大学-信息科学与工程学院-计算机与科学系
Chapter 5 Designing the Architecture Shari L. Pfleeger Joanne M. Atlee
SW Architecture SG meeting 22 July 1999 P. Mato, CERN
Support for ”interactive batch”
CS703 - Advanced Operating Systems
Module 01 ETICS Overview ETICS Online Tutorials
Course: Module: Lesson # & Name Instructional Material 1 of 32 Lesson Delivery Mode: Lesson Duration: Document Name: 1. Professional Diploma in ERP Systems.
What’s new in version 5 of GAUDI
Multithreaded Programming
Threaded Programming in Python
Prof. Leonardo Mostarda University of Camerino
Why Background Processing?
Chapter 4: Threads & Concurrency
Overview of Workflows: Why Use Them?
5/7/2019 Map Reduce Map reduce.
Preventing Privilege Escalation
Planning next release of GAUDI
ADA analysis transformations
Message Passing Systems Version 2
MapReduce: Simplified Data Processing on Large Clusters
Production Manager Tools (New Architecture)
Production client status
Chapter 3: Process Management
Presentation transcript:

Parallel Gaudi A reminder and prospects 37th LHCb Software Week Pere Mato (CERN), Eoin Smith (CERN)

Motivation Work done in the context of the R&D project to exploit multi-core architectures Main goal Get quicker responses when having 4-8 core machines at your disposal Minimal changes (and understandable) to the Python scripts driving the program Leverage from existing third-party Python modules processing module, parallel python (pp) module Optimization of memory usage GaudiParallel 10/4/2019

A typical GaudiPython script #--- Common configuration ------------------------- from Gaudi.Configuration import * importOptions('$STDOPTS/LHCbApplication.opts') importOptions(‘DoDC06selBs2Jpsi2MuMu_Phi2KK.opts') #--- modules to be reused in all processes---------- from GaudiPython import AppMgr from ROOT import TH1F,TFile,gROOT files = [... ] hbmass = TH1F(’hbmass','Mass of B cand',100,5200.,5500.) appMgr = AppMgr() appMgr.evtsel().open(files) evt = appMgr.evtsvc() while True : appMgr.run(1) if not evt['Rec/Header'] : break cont = evt['Phys/DC06selBs2Jpsi2MuMu_Phi2KK/Particles'] if cont : for b in cont : hbmass.Fill(b.momentum().mass()) hbmass.Draw() Predefined configuration + customizations Preparations (booking histos, selecting files, etc.) Looping over events Presenting results GaudiParallel 10/4/2019

Parallelization Model Introduced a very simple Model for parallel processing of tasks Common model that can be implemented using either processing or pp modules (or others) The result of processing can be any ‘pickle-able’ Python or C++ object (with a dictionary) Placeholder for additional functionality Setting up the environment (including servers) Monitoring Merging results (summing what can be summed or appending to lists) GaudiParallel 10/4/2019

The Model User parallelizable task derives from Task WorkManager __init__(ncpus, ppservers) process(task, items) User parallelizable task derives from Task initializeLocal() is executed in parent process initializeRemote() is executed once in each remote process process() is executed for each work item in remote process finalize() is executed at the end in the parent process Task initializeLocal() initializeRemote() process(item) finalize() MyTask __init__(parameters) initializeLocal() initializeRemote() process(item) finalize() GaudiParallel 10/4/2019

Very simple example from ROOT import TH1F, TRandom, TCanvas, gROOT from GaudiPython.Parallel import Task, WorkManager class HistTask(Task): def __init__(self, nHist=4) : self.nHist = nHist self.canvas = None def initializeLocal(self): self.output = [TH1F('h%d'%i,'h%d'%i,100,-3.,3.) for i in range(self.nHist)] self.random = TRandom() def initializeRemote(self): pass def process(self, n): for h in self.output : for i in range(n): x = self.random.Gaus(0.,1.) h.Fill(x) def finalize(self): self.canvas = TCanvas('c1', 'Gaudi.Parallel canvas', 200, 10, 700, 700) nside = int(sqrt(self.nHist)) nside = nside*nside < self.nHist and nside + 1 or nside self.canvas.Divide(nside, nside, 0, 0) for i in range(self.nHist): self.canvas.cd(i+1) self.output[i].Draw() >>> from GaudiPython.Parallel import WorkManager >>> from HistTask import HistTask >>> task = HistTask(nHist=9) >>> wmgr = WorkManager() >>> wmgr.process( task, [100000 for i in range(100)]) Job execution statistics: job count | % of all jobs | job time sum | time per job | job server 100 | 100.00 | 378.296 | 3.783 | lxbuild114.cern.ch Time elapsed since server creation 60.805200 GaudiParallel 10/4/2019

More Realistic Example from ROOT import TFile,TCanvas,TH1F,TH2F from Gaudi.Configuration import * from GaudiPython.Parallel import Task, WorkManager from GaudiPython import AppMgr class MyTask(Task): def initializeLocal(self): self.output = {'h_bmass': TH1F('h_bmass','Mass of B candidate',100,5200.,5500.)} def initializeRemote(self): #--- Common configuration -------------------------------------------------- importOptions('$STDOPTS/LHCbApplication.opts') importOptions('$STDOPTS/DstDicts.opts') importOptions('$DDDBROOT/options/DC06.opts') importOptions('$PANORAMIXROOT/options/Panoramix_DaVinci.opts') importOptions('$BS2JPSIPHIROOT/options/DoDC06selBs2Jpsi2MuMu_Phi2KK.opts') appConf = ApplicationMgr( OutputLevel = 999, AppName = 'Ex2_multicore') appConf.ExtSvc += ['DataOnDemandSvc','ParticlePropertySvc'] def process(self, file): appMgr = AppMgr() appMgr.evtsel().open([file]) evt = appMgr.evtsvc() while 0 < 1: appMgr.run(1) # check if there are still valid events if evt['Rec/Header'] == None : break cont = evt['Phys/DC06selBs2Jpsi2MuMu_Phi2KK/Particles'] if cont != None : for b in cont : success = self.output['h_bmass'].Fill(b.momentum().mass()) def finalize(self): self.output['h_bmass'].Draw() print 'Bs found: ', self.output['h_bmass'].GetEntries() from GaudiPython.Parallel import WorkManager from MyTask import MyTask from inputdata import bs2jpsiphimm_files as files ppservers = ('lxbuild113.cern.ch','lxbuild114.cern.ch') if __name__ == '__main__' : task = MyTask() wmgr = WorkManager(ppservers=ppservers) wmgr.process( task, files[:50]) GaudiParallel 10/4/2019

Parallelization on a Cluster Node Allocation and Reservation LocalNode RemoteNode myscript.py ssh ppserver.py socket + pickle fork pipe + pickle fork pipe + pickle Worker Worker Worker Worker Worker Worker Worker Worker Network FS (AFS) GaudiParallel 10/4/2019

Cluster Parallelization Details The [pp]server is created/destroyed by the user script Requires ssh properly setup (no password required) Ultra-lightweight setup Single user, proper authentication, etc. The ‘parent’ user environment is cloned to the server Requires a shared file system Automatic cleanup on crashes/aborts GaudiParallel 10/4/2019

Model fails for “Event” output In case of a program producing large output data the current model is not adequate Event processing programs: simulation, reconstruction, etc. Parallelization at event level Two options: Each sub-process writing a different file, parent process merges the files Merging files non-trivial when “references” exists Event data is collected by one single process and written into a single output stream Some additional communication overhead GaudiParallel 10/4/2019

Handling Event Input/Output Worker Algorithm Writer Algorithm Reader Algorithm Transient Event Store Transient Event Store Transient Event Store Event Queue Event Queue OutputStream output GaudiParallel 10/4/2019

User Interface in development gaudirun –-parallel=N optionfile.py No modification needed in user options file Modified version of gaudirun.py script that will be hiding all the details Sub-processes are spawned with slightly modified set of options GaudiParallel 10/4/2019

Handling Input/Output Developed event serialization/deserialization (TESSerializer) The entire transient event store (or parts) can be moved from/to sub-processes Implemented by pickling a TBufferFile object Links and references must be maintained Current status Completed for “event data” Working on “statistical data” (histograms) Problematic for Ntuple More work and definition needed for counters/run records GaudiParallel 10/4/2019

Preliminary Results --parallel=N tried with Brunel v35r1 (1000 events) in a 24 core machine Initialization rather large compared to total time Subtracted to get more realistic with large # events GaudiParallel 10/4/2019

Status Current version of Gaudi includes GaudiPython.Parallel Ready and useful for the file-level parallelization The event-level parallelization is going to be made available as soon is more complete At least Histograms should be available Validation of ‘serial’ vs ‘parallel’ results Further work Measure realistic ‘speedup’ with longer jobs Optimizing Inter-process-communication Forking ‘workers’ after initialization to save memory GaudiParallel 10/4/2019

Summary Very simple adaptation of Python scripts may led to huge gains in latency (multi-core) Already usable today Several schemas and scheduling strategies can be tested without changes in the C++ code We plan to produce an ‘easy’ parallel version of established application such as Brunel, Gauss,… GaudiParallel 10/4/2019