Parallelizing TTree::Draw functionality with PROOF Stefano Marinaci - - PowerPoint PPT Presentation

parallelizing ttree draw functionality with proof
SMART_READER_LITE
LIVE PREVIEW

Parallelizing TTree::Draw functionality with PROOF Stefano Marinaci - - PowerPoint PPT Presentation

Parallelizing TTree::Draw functionality with PROOF Stefano Marinaci (Supervisor: Gerardo Ganis) CERN PH-SFT Introduction Today's desktop/laptop have many cores, lots of memory and performant drives (e.g. SSD): can we exploit all that to


slide-1
SLIDE 1

Stefano Marinaci (Supervisor: Gerardo Ganis)

Parallelizing TTree::Draw functionality with PROOF

CERN PH-SFT

slide-2
SLIDE 2

Parallelizing TTree::Draw functionality with PROOF 2

Introduction

Today's desktop/laptop have many cores, lots of memory and performant drives (e.g. SSD): can we exploit all that to improve daily ROOT-based analysis tasks? Two approaches to exploit multi-cores: Threads: The future, but current ROOT non thread-safe Multi-process: PROOF, or PROOF-Lite for desktop/laptop Better integration of PROOF-Lite for local TTree processing is one of the items on the PROOF plan of work

slide-3
SLIDE 3

Parallelizing TTree::Draw functionality with PROOF 3

The Draw functionality

'TTree::Draw' used for many actions during daily analysis work: Variable plotting Histogram or ad-hoc output object creation Selection criteria design and optimization … Implemented using the TSelector framework with specialized selector TSelectorDraw TTree::Draw TTreePlayer::DrawSelect TSelectorDraw

calls process histogram canvas

slide-4
SLIDE 4

Parallelizing TTree::Draw functionality with PROOF 4

TSelector framework

Framework provided by ROOT to process trees Three main function blocks Begin(), called once before processing to initialize the job Process(), called for each tree entry, applying the analysis algorithm Terminate(), called once at the end to finalize the job PROOF works only with a TSelector framework, parallelizing the calls to Process()

slide-5
SLIDE 5

Parallelizing TTree::Draw functionality with PROOF 5

Draw in PROOF

PROOF already provides a sub-sample of 'Draw' functionality via the TProof::DrawSelect and a set of specialized selectors, TProofDraw... TProofDraw selectors developed by a technical student (M. Biskup): Meant to replace TSelectorDraw but the work was never finished Missing macro processing, special keyword $ interpretation, … TSelectorDraw continued to evolve For functionality completeness and maintenance reasons keep only one selector TSelectorDraw has all the functionality implemented Make sense to use it in PROOF

slide-6
SLIDE 6

Parallelizing TTree::Draw functionality with PROOF 6

TSelectorDraw and PROOF

However, TSelectorDraw is not usable in PROOF as it is because makes assumptions valid only locally In particular Availability of the TTree at constructor level (before start processing); Possibility to avoid using the output list for the output transfer. We cannot change the way PROOF works: But we can make the local flow similar to the PROOF one.

slide-7
SLIDE 7

Parallelizing TTree::Draw functionality with PROOF 7

Draw pseudo-code: current local vs PROOF

CURRENT LOCAL PROOF

USER LEVEL f = TFile::Open(“filename”) tree = f->Get(“treename”) tree->Draw(“var”, “cut”) dataset = new TChain(“treename”) dataset->Add(“filename”) TProof::Open(“lite://”) // start PROOF-Lite proof->DrawSelect(dataset, “var”, “cut”) BEHIND THE SCENE treeplayer->DrawSelect(“var”, “cut”) input ->Add(“var”) input ->Add(“cut”) sel = new TSelectorDraw() sel->Begin(tree) Process(sel)

  • ut=sel->fObject
  • ut->Draw()

proofplayer->DrawSelect(dataset, “var”, “cut”) input ->Add(“var”) input ->Add(“cut”) Process(“TProofDraw...”) sel->Init(tree) //on first file opening <output from TSelector::fOutput> (canvas draw by the feedback mechanism)

Formula compilation

slide-8
SLIDE 8

Parallelizing TTree::Draw functionality with PROOF 8

Changes to TSelectorDraw

Main changes: Move variable formula initialization from Begin to Init Make the output object(s) available in the output list Details to pay attention to: Object ownership in list Conflicts between gDirectory and selector output list Make sure that proper inizialization is always run TSelectorDraw ctor not re-run in case of multiple Draw calls

slide-9
SLIDE 9

Parallelizing TTree::Draw functionality with PROOF 9

Status

Branch in github repository with the changes in TSelectorDraw: Roottest runs through successfully PROOF interface: standalone macro implementing Draw in PROOF using TSelectorDraw exists Works fine for basic functionality: Plotting variables, applying standard math functions

slide-10
SLIDE 10

Parallelizing TTree::Draw functionality with PROOF 10

What next?

Not working functionality requires dedicated transfer in/out PROOF (e.g. the user function or macro to be executed on the leaves): Not a technical showstopper, but needs to be implemented Integration of the PROOF interface in TTreePlayer::DrawSelect for transparent availability in TTree::Draw Requires a bit of brainstorming

slide-11
SLIDE 11

Parallelizing TTree::Draw functionality with PROOF 11

Personal impressions

Homely place; Group work exciting; Reliable and willing people; Every day I learnt something new; Project initially incomprehensible but as time went by and with the help of my supervisor everything became clearer; Definitely an experience that I would do it again!