1 Part III: PROOF Jan Fiete Grosse-Oetringhaus – CERN Andrei Gheata - CERN V3.2 – 04.03.10.

Slides:



Advertisements
Similar presentations
ALICE Offline Tutorial Markus Oldenburg – CERN May 15, 2007 – University of Sao Paulo.
Advertisements

1 CRAB Tutorial 19/02/2009 CERN F.Fanzago CRAB tutorial 19/02/2009 Marco Calloni CERN – Milano Bicocca Federica Fanzago INFN Padova.
Proof/Proof-on-Demand at Atlas T3 Shuwei Ye (BNL) Aug 20, 2014.
The LEGO Train Framework
GSIAF "CAF" experience at GSI Kilian Schwarz. GSIAF Present status Present status installation and configuration installation and configuration usage.
David Adams ATLAS DIAL Distributed Interactive Analysis of Large datasets David Adams BNL March 25, 2003 CHEP 2003 Data Analysis Environment and Visualization.
Statistics of CAF usage, Interaction with the GRID Marco MEONI CERN - Offline Week –
New CERN CAF facility: parameters, usage statistics, user support Marco MEONI Jan Fiete GROSSE-OETRINGHAUS CERN - Offline Week –
1 Status of the ALICE CERN Analysis Facility Marco MEONI – CERN/ALICE Jan Fiete GROSSE-OETRINGHAUS - CERN /ALICE CHEP Prague.
Staging to CAF + User groups + fairshare Jan Fiete Grosse-Oetringhaus, CERN PH/ALICE Offline week,
PROOF: the Parallel ROOT Facility Scheduling and Load-balancing ACAT 2007 Jan Iwaszkiewicz ¹ ² Gerardo Ganis ¹ Fons Rademakers ¹ ¹ CERN PH/SFT ² University.
PROOF - Parallel ROOT Facility Kilian Schwarz Robert Manteufel Carsten Preuß GSI Bring the KB to the PB not the PB to the KB.
The ALICE Analysis Framework A.Gheata for ALICE Offline Collaboration 11/3/2008 ACAT'081A.Gheata – ALICE Analysis Framework.
AliEn uses bbFTP for the file transfers. Every FTD runs a server, and all the others FTD can connect and authenticate to it using certificates. bbFTP implements.
Test Of Distributed Data Quality Monitoring Of CMS Tracker Dataset H->ZZ->2e2mu with PileUp - 10,000 events ( ~ 50,000 hits for events) The monitoring.
Alexandre A. P. Suaide VI DOSAR workshop, São Paulo, 2005 STAR grid activities and São Paulo experience.
03/27/2003CHEP20031 Remote Operation of a Monte Carlo Production Farm Using Globus Dirk Hufnagel, Teela Pulliam, Thomas Allmendinger, Klaus Honscheid (Ohio.
3rd June 2004 CDF Grid SAM:Metadata and Middleware Components Mòrag Burgon-Lyon University of Glasgow.
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Bookkeeping Tutorial. Bookkeeping & Monitoring Tutorial2 Bookkeeping content  Contains records of all “jobs” and all “files” that are created by production.
1 Marek BiskupACAT2005PROO F Parallel Interactive and Batch HEP-Data Analysis with PROOF Maarten Ballintijn*, Marek Biskup**, Rene Brun**, Philippe Canal***,
PROOF Cluster Management in ALICE Jan Fiete Grosse-Oetringhaus, CERN PH/ALICE CAF / PROOF Workshop,
ROOT for Data Analysis1 Intel discussion meeting CERN 5 Oct 2003 Ren é Brun CERN Distributed Data Analysis.
ROOT and Federated Data Stores What Features We Would Like Fons Rademakers CERN CC-IN2P3, Nov, 2011, Lyon, France.
October 8, 2002P. Nilsson, SPD General Meeting1 Paul Nilsson, SPD General Meeting, Oct. 8, 2002 New tools and software updates Test beam analysis Software.
Introduction to the PROOF system Ren é Brun CERN Do-Son school on Advanced Computing and GRID Technologies for Research Institute of.
Andrei Gheata, Mihaela Gheata, Andreas Morsch ALICE offline week, 5-9 July 2010.
ALICE analysis framework References for Analysis Tools used to the ALICE simulated data.
David Adams ATLAS DIAL: Distributed Interactive Analysis of Large datasets David Adams BNL August 5, 2002 BNL OMEGA talk.
PROOF and ALICE Analysis Facilities Arsen Hayrapetyan Yerevan Physics Institute, CERN.
Statistical feature extraction, calibration and numerical debugging Marian Ivanov.
March, PROOF - Parallel ROOT Facility Maarten Ballintijn Bring the KB to the PB not the PB to the KB.
Super Scaling PROOF to very large clusters Maarten Ballintijn, Kris Gulbrandsen, Gunther Roland / MIT Rene Brun, Fons Rademakers / CERN Philippe Canal.
1 Status of PROOF G. Ganis / CERN Application Area meeting, 24 May 2006.
ATLAS-specific functionality in Ganga - Requirements for distributed analysis - ATLAS considerations - DIAL submission from Ganga - Graphical interfaces.
A. Gheata, ALICE offline week March 09 Status of the analysis framework.
AliRoot survey: Analysis P.Hristov 11/06/2013. Are you involved in analysis activities?(85.1% Yes, 14.9% No) 2 Involved since 4.5±2.4 years Dedicated.
Gustavo Conesa ALICE offline week Gamma and Jet correlations analysis framework Short description, Status, HOW TO use and TO DO list 1/9.
1 Offline Week, October 28 th 2009 PWG3-Muon: Analysis Status From ESD to AOD:  inclusion of MC branch in the AOD  standard AOD creation for PDC09 files.
October Test Beam DAQ. Framework sketch Only DAQs subprograms works during spills Each subprogram produces an output each spill Each dependant subprogram.
Latest Improvements in the PROOF system Bleeding Edge Physics with Bleeding Edge Computing Fons Rademakers, Gerri Ganis, Jan Iwaszkiewicz CERN.
Latest Improvements in the PROOF system Bleeding Edge Physics with Bleeding Edge Computing Fons Rademakers, Gerri Ganis, Jan Iwaszkiewicz CERN.
Analysis experience at GSIAF Marian Ivanov. HEP data analysis ● Typical HEP data analysis (physic analysis, calibration, alignment) and any statistical.
Dynamic staging to a CAF cluster Jan Fiete Grosse-Oetringhaus, CERN PH/ALICE CAF / PROOF Workshop,
Analysis train M.Gheata ALICE offline week, 17 March '09.
M. Gheata ALICE offline week, 24 June  A new analysis train macro was designed for production  /ANALYSIS/macros/AnalysisTrainNew.C /ANALYSIS/macros/AnalysisTrainNew.C.
Go4 Workshop J.Adamczewski-Musch, S.Linev Go4 advanced features.
A GANGA tutorial Professor Roger W.L. Jones Lancaster University.
Good user practices + Dynamic staging to a CAF cluster Jan Fiete Grosse-Oetringhaus, CERN PH/ALICE CUF,
ROOT and PROOF Tutorial Arsen HayrapetyanMartin Vala Yerevan Physics Institute, Yerevan, Armenia; European Organization for Nuclear Research (CERN)
ALICE Offline Tutorial PART 3: PROOF Alice Core Offline 5 th June, 2008.
ATLAS Physics Analysis Framework James R. Catmore Lancaster University.
AAF tips and tricks Arsen Hayrapetyan Yerevan Physics Institute, Armenia.
David Adams ATLAS DIAL Distributed Interactive Analysis of Large datasets David Adams BNL May 19, 2003 BNL Technology Meeting.
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.
HYDRA Framework. Setup of software environment Setup of software environment Using the documentation Using the documentation How to compile a program.
The ALICE Analysis -- News from the battlefield Federico Carminati for the ALICE Computing Project CHEP 2010 – Taiwan.
Advanced Computing Facility Introduction
Experience of PROOF cluster Installation and operation
Basic aliensh S. Bagnasco, INFN Torino CNAF Nov 27-28, 2007.
Status of the Analysis Task Force
Status of the CERN Analysis Facility
PROOF – Parallel ROOT Facility
Experience in ALICE – Analysis Framework and Train
Off-line weekly meeting
Analysis Trains - Reloaded
Analysis framework - status
Support for ”interactive batch”
PROOF - Parallel ROOT Facility
Presentation transcript:

1 Part III: PROOF Jan Fiete Grosse-Oetringhaus – CERN Andrei Gheata - CERN V3.2 –

2 PROOF Parallel ROOT Facility Interactive parallel analysis on a local cluster Parallel processing of (local) data (trivial parallelism) Fast Feedback Output handling with direct visualization Not a batch system PROOF itself is not related to Grid Can access Grid files The usage of PROOF is transparent The same code can be run locally and in a PROOF system (certain rules have to be followed) PROOF is part of ROOT

3 root Remote PROOF Cluster Data root Client – Local PC ana.C stdout/result node1 node2 node3 node4 ana.C root PROOF Schema Data Proof master Proof slave Result Data Result Data Result

4 Event based (trivial) Parallelism

5 Terminology Client Your machine running a ROOT session that is connected to a PROOF master Master PROOF machine coordinating work between slaves Slave/Worker PROOF machine that processes data Query A job submitted from the client to the PROOF system. A query consists of a selector and a chain Selector A class containing the analysis code In ALICE we use the Analysis Framework, therefore a AliAnalysisTaskSE is sufficient Chain A list of files (trees) to process (more details later)

6 How to use PROOF The analysis framework is used Files to be analyzed are put into a chain  TChain Analysis written as a task (already introduced in previous tutorial)  AliAnalysisTaskSE The same analysis like written previously can be used If additional libraries are needed, these have to be distributed as a "package" Analysis (AliAnalysisTaskSE) Input Files (TChain) Output

7 once on your client once on each slave for each tree for each event Classes derived from AliAnalysisTaskSE can run locally, in PROOF and in AliEn "Constructor" UserCreateOutputObjects() ConnectInputData() UserExec() Terminate() AliAnalysisTaskSE

8 Class TTree A tree is a container for data storage It consists of several branches These can be in one or several files Branches are stored contiguously (split mode) When reading a tree, certain branches can be switched off  speed up of analysis when not all data is needed Set of helper functions to visualize content (e.g. Draw, Scan) Compressed Tree Branch point xyzxyz xxxxxxxxxxyyyyyyyyyyzzzzzzzzzz Branches File

9 TChain A chain is a list of trees (in several files) Normal TTree functions can be used Draw(...), Scan(...)  these iterate over all elements of the chain Chain Tree1 (File1) Tree2 (File2) Tree3 (File3) Tree4 (File3) Tree5 (File4)

10 Merging The analysis runs on several slaves, therefore partial results have to be merged Objects are identified by name Standard merging implementation for histograms available Other classes need to implement Merge(TCollection*) When no merging function is available all the individual objects are returned Result from Slave 1 Result from Slave 2 Final result Merge()

11 Chain Tree1 (File1) Tree2 (File2) Tree3 (File3) Tree4 (File3) Tree5 (File4) Workflow Summary Analysis (AliAnalysisTask) Input proof

12 Workflow Summary Analysis (AliAnalysisTask) proof Output Merged Output

13 Packages PAR files: PROOF ARchive. Like Java jar Gzipped tar file PROOF-INF directory BUILD.sh, building the package, executed per slave SETUP.C, set environment, load libraries, executed per slave API to manage and activate packages UploadPackage("package") EnablePackage("package")

14 CERN Analysis Facility The CERN Analysis Facility (CAF) will run PROOF for ALICE Prompt analysis of pp data Pilot analysis of PbPb data Calibration & Alignment Available to the whole collaboration but the number of users will be limited for efficiency reasons Design goals 500 CPUs 100 TB of selected data locally available

15 Evaluation of PROOF CAF1 since May machines, 2 CPUs each, 200 GB disk each CAF2 since Oct machines, 8 cores each, 2.33 TB disk each CAF3 soon 45 machines, 8 cores, 3 TB disk each

16 Hands-On Getting ready... Run a task that accesses ESD Locally PROOF Modify it... Run a task that accesses MC PROOF Reading log files, resetting session, etc. What about “interactive” grid ? AliEn plug-in hands on

17 Warm up Log into LXPLUS with your account Preconditions Use bash shell (type “bash”) Grid certificate (usercert.pem/userkey.pem) in ~/.globus Howto: convert from.p12 to.pem openssl pkcs12 -clcerts -nokeys -out usercert.pem -in cert.p12 openssl pkcs12 -nocerts -out userkey.pem -in cert.p12 On the tutorial page Save “Files for the PROOF tutorial (tgz)” to your home dir and extract it Set up environment Execute the command source /afs/cern.ch/alice/caf/caf-lxplus.sh -alien v AN You will be prompted for your certificate password Check ROOT Start it. Does it show ROOT version 5.26/00?

18 Files to be used AF-v AN.par Par archive for PDC10 data and analysis framework AliAnalysisTaskPt.{cxx,h} Task that creates an uncorrected pT spectrum from ESD tracks AliAnalysisTaskPtMC.{cxx,h} Task that creates an pT spectrum from the MC particles files.txt Short list of MC files to test the analysis task locally

19 Run a task locally Start ROOT Try the following lines and once they work add them to a macro run.C (enclose in {}) Load needed libraries gSystem->Load("libTree.so"); gSystem->Load("libGeom.so"); gSystem->Load("libVMC.so"); gSystem->Load("libSTEERBase.so"); gSystem->Load("libESD.so"); gSystem->Load("libAOD.so"); gSystem->Load("libANALYSIS.so"); gSystem->Load("libANALYSISalice.so"); Add the AliRoot include path (only needed for local case) gROOT->ProcessLine(".include $ALICE_ROOT/include");

20 Run a task locally (2) Create the analysis manager mgr = new AliAnalysisManager(“testAnalysis"); Create the analysis task and add it to the manager gROOT->LoadMacro("AliAnalysisTaskPt.cxx++g"); "+" means compile; "g" means debug task = new AliAnalysisTaskPt(“TaskPt”); mgr->AddTask(task); Add the ESD handler (to access the ESD) esdH = new AliESDInputHandler; mgr->SetInputEventHandler(esdH); Add the lines to the macro run.C

21 Run a task locally (3) Create a chain gROOT->LoadMacro(“$ALICE_ROOT/PWG0/CreateESDChain.C"); chain = CreateESDChain(“files.txt"); Attach the input (the chain) cInput = mgr->GetCommonInputContainer(); mgr->ConnectInput(task, 0, cInput); Create a place for the output (a histogram: TH1) cOutput = mgr->CreateContainer("cOutput", TList::Class(), AliAnalysisManager::kOutputContainer, "Pt1.root"); mgr->ConnectOutput(task, 1, cOutput); Enable debug (optional) mgr->SetDebugLevel(2); Add the lines to the macro run.C

22 Run a task locally (4) Initialize the manager mgr->InitAnalysis(); Print the status (optional) mgr->PrintStatus(); Run the analysis mgr->StartAnalysis("local", chain); Add the lines to the macro run.C After running look at the output and check the content of the file Pt1.root

23 PROOF - Connecting and Packages Connecting to the PROOF cluster gEnv->SetValue("XSec.GSI.DelegProxy", "2"); TProof::Open(”alicecaf"); Managing packages Upload (= copy to the cluster) gProof->UploadPackage(“AF-v AN"); Enable (= compile) gProof->EnablePackage("AF-v AN"); Clean (= remove) gProof->ClearPackage("AF-v AN"); Known issue on AFS: Removal may fail. Try again after few seconds… Clean all (in case some libraries are messed up) gProof->ClearPackages();

24 PROOF datasets A dataset represents a list of files (e.g. physics run X) Correspondence between AliEn collection and PROOF dataset Users register datasets The files contained in a dataset are automatically staged from AliEn (and kept available) Datasets are used for processing with PROOF Contain all relevant information to start processing (location of files, abstract description of content of files) Datasets are public for reading, common datasets are available (for data of common interest) Learn about dataset at

25 Datasets in Practice Upload to PROOF cluster gProof->RegisterDataSet("myDataSet", proofColl); Check status gProof->ShowDataSets(); Use it gProof->Process("myDataSet”, “TMySelector.cxx+”);

26 Running a task in PROOF Copy run.C to runProof.C Add connecting to the cluster gEnv->SetValue("XSec.GSI.DelegProxy", "2"); TProof::Open(”alicecaf"); Replace the loading of the libraries with uploading the packages gProof->UploadPackage("AF-v AN"); gProof->EnablePackage("AF-v AN"); Replace the loading of the task with gProof->Load("AliAnalysisTaskPt.cxx++g");

27 Running a task in PROOF (2) Replace in StartAnalysis "local" with "proof” The chain with dataset “/COMMON/COMMON/LHC09d10_run 10482X” Change output file name to Pt2.root Add only entries to be processed As last parameter of StartAnalysis() Run it! 20 files 1850 files

28 Progress dialog Query statistics Abort query and view results up to now Abort query and discard results Show log files Show processing rate New ROOT has a fancy speedometer

29 Looking at the task Constructor Called once when the task is created Input/Output is connected UserCreateOutputObjects Called once per slave Create histograms UserExec Called once per event Track loop, tracks are counted, histogram filled, output "posted" Terminate Called once on the client (your laptop/PC) Histogram read back from the output stream, visualized, saved to disk

30 Changing the task Add a |  | < 0.5 cut Float_t eta = track->Eta(); if (TMath::Abs(eta) > 0.5) continue;

31 Changing the task (2) Add a second plot:  distribution Header file (.h file) Add new member: TH1F* fEta; // eta distribution Constructor Initialize member: fEta(0) UserCreateOutputObjects Create histogram fEta = new TH1F("fEta", "#eta distribution", 20, -2, 2); Add the histogram to the output list fOutputList->Add(fEta); UserExec Get  like in previous example Fill histogram: fEta->Fill(eta);

32 Changing the task (3) Terminate Read histogram from the output slot fEta = dynamic_cast (fOutputList->FindObject("fEta")) Introduce an if statement to check if the object was retrieved if (!fEta) { Printf("ERROR: fEta was not found"); return; } Draw the histogram new TCanvas; fEta->DrawCopy();

33 Read Monte Carlo tracks Use task AliAnalysisTaskPtMC.{h,cxx} Copy runProof.C to runProofMC.C Change AliAnalysisTaskPt to AliAnalysisTaskPtMC Add access to the MC event handler handler = new AliMCEventHandler; mgr->SetMCtruthEventHandler (handler); Change output filename to PtMC.root Run it!

34 Looking at the MC task Very similar to ESD track case Instead of looping over content of fESD, MC event is retrieved by AliMCEvent* mcEvent = MCEvent(); if (!mcEvent) { Printf("ERROR: Could not retrieve MC event"); return; }

35 Reading log files When your task crashes You can access the output of the last query by clicking on the “Show Log” button in the PROOF progress window You can retrieve the output from any previous query Open ROOT Get a PROOF manager object mgr = TProof::Mgr(”alicecaf") Get the log files from the last session logs = mgr->GetSessionLogs(0) // 0=last query Display them logs->Display() Search for a special word (e.g. segmentation violation) logs->Grep("segmentation violation") Save them to a file logs->Save("*", "logs.txt")

36 Some Goodies... Resetting environment TProof::Reset(”alicecaf") TProof::Reset(”alicecaf", kTRUE) Compile with debug Load(" +g") Create a package from AliROOT make ESD.par

37 References More information on Read the FAQ on the webpage above Please join the mailing list by going to