Persistent Object References in ROOT1 Persistent Object References in ROOT I/O Status & Proposal LCG meeting CERN- 5 June Ren é Brun ftp://root.cern.ch/root/longrefs.ppt.

Slides:



Advertisements
Similar presentations
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
Advertisements

Chapter 10: File-System Interface
File Management Chapter 12. File Management A file is a named entity used to save results from a program or provide data to a program. Access control.
File System Interface CSCI 444/544 Operating Systems Fall 2008.
11/13/01CS-550 Presentation - Overview of Microsoft disk operating system. 1 An Overview of Microsoft Disk Operating System.
Chapter 12 File Management
Operating Systems File Systems (in a Day) Ch
Introduction to Kernel
Chapter 3.2 : Virtual Memory
1 File Management Chapter File Management File management system consists of system utility programs that run as privileged applications Input to.
File Management.
File Concept l Contiguous logical address space l Types: Data: numeric, character, binary Program: source, object (load image) Documents.
File Management Chapter 12.
ROOT courses1 The ROOT System A Data Access & Analysis Framework February 2003 Ren é Brun/EP Trees.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10: File-System Interface.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
Chapter pages1 File Management Chapter 12.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
File System Review bottomupcs.com J. Kubiatowicz, UC Berkeley.
File Systems CSCI What is a file? A file is information that is stored on disks or other external media.
File System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing (skip)‏ File Protection.
Data Structure & File Systems Hun Myoung Park, Ph.D., Public Management and Policy Analysis Program Graduate School of International Relations International.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
ROOT for Data Analysis1 Intel discussion meeting CERN 5 Oct 2003 Ren é Brun CERN Distributed Data Analysis.
Lecture 5 Cost Estimation and Data Access Methods.
1 Floppy Drive Formatting ©Richard Goldman February, 2001.
Persistent Object References in ROOT1 Persistent Object References in ROOT I/O Status & Proposal CMS-ROOT meeting CERN- November 27 Ren é Brun ftp://root.cern.ch/root/refs.ppt.
Disk & File System Management Disk Allocation Free Space Management Directory Structure Naming Disk Scheduling Protection CSE 331 Operating Systems Design.
CE Operating Systems Lecture 17 File systems – interface and implementation.
ROOT courses1 The ROOT System A Data Access & Analysis Framework February 2003 Ren é Brun/EP Input/Output.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
March, PROOF - Parallel ROOT Facility Maarten Ballintijn Bring the KB to the PB not the PB to the KB.
1 CSC103: Introduction to Computer and Programming Lecture No 27.
ROOT Workshop M.Frank LHCb/CERN Improvements in the I/O Area (*)  General I/O related improvements  Tree related issues  Plans (*) I present.
Trees: New Developments1 Trees: New Developments Folders and Tasks ROOT Workshop 2001 June 13 FNAL Ren é Brun CERN
File System Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi Fujinoki CS 314.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems File System Interface.
W4118 Operating Systems Instructor: Junfeng Yang.
SVBIT SUBJECT:- Operating System TOPICS:- File Management
Lecture : chapter 9 and 10 file system 1. File Concept A file is a collection of related information defined by its creator. Contiguous logical address.
File System Design David E. Culler CS162 – Operating Systems and Systems Programming Lecture 23 October 22, 2014 Reading: A&D a HW 4 out Proj 2 out.
File System Implementation
Input/Output (I/O) Important OS function – control I/O
File System Interface CSSE 332 Operating Systems
Introduction to Kernel
Module 11: File Structure
Chapter 12 File Management
Structure of Processes
File Management Computer can store information on storage media such as magnetic disks, tape and so on. The physical storage is converted into logical.
Module 10: File-System Interface
Chapter 11: File-System Interface
Chapter 11: File System Implementation
Review.
Operation System Program 4
Chapter 11: File System Implementation
Thrashing If a process does not have “enough” pages, the page-fault rate is very high. This leads to: low CPU utilization operating system thinks that.
Recent Developments in ROOT I/O Support for foreign classes
Chapter 10: File-System Interface
Process Description and Control
RDBMS Chapter 4.
Modern PC operating systems
Chapter 16 File Management
Disk Structure Analysis
Persistent Object References in ROOT I/O Status & Proposal
Zooming on ROOT files and Containers
Chapter 11: File System Implementation
Module 10: File-System Interface
Chapter 11 Processor Structure and function
Department of Computer Science
Lecture Topics: 11/20 HW 7 What happens on a memory reference Traps
Presentation transcript:

Persistent Object References in ROOT1 Persistent Object References in ROOT I/O Status & Proposal LCG meeting CERN- 5 June Ren é Brun ftp://root.cern.ch/root/longrefs.ppt

LCG 6 June Rene BrunPersistent Object References in ROOT2 Normal Streaming mode References using C++ pointers A TBuffer b; A.Streamer(b) Only one copy of each object in the graph saved to buffer

LCG 6 June Rene BrunPersistent Object References in ROOT3 Normal Streaming mode References using C++ pointers TBuffer b1; A.Streamer(b1) TBuffer b2; B.Streamer(b2) B A Objects in red are in b1 and b2 C++ pointer

LCG 6 June Rene BrunPersistent Object References in ROOT4 Normal Streaming mode References using TRef pointers TBuffer b1; A.Streamer(b1) TBuffer b2; B.Streamer(b2) B Objects in blue are only in b1 C++ pointer TRef A Bz z Set pointer to z with: TRef Bz = z; Get pointer to z with: z = Bz.GetObject()

LCG 6 June Rene BrunPersistent Object References in ROOT5 ROOT I/O : An Example TFile f(“example.root”,”new”); TH1F h(“h”,”My histogram”,100,-3,3); h.FillRandom(“gaus”,5000); h.Write(); TFile f(“example.root”); TH1F *h = (TH1F*)f.Get(“h”): h->Draw(); f.Map(); Program Writing Program Reading / At:64 N=90 TFile / At:154 N=453 TH1F CX = / At:607 N=2364 StreamerInfo CX = / At:2971 N=96 KeysList / At:3067 N=56 FreeSegments / At:3123 N=1 END

LCG 6 June Rene BrunPersistent Object References in ROOT6 Memory Tree The Tree entry serial number tr T.Fill() T.GetEntry(6) T Memory

LCG 6 June Rene BrunPersistent Object References in ROOT7 Tree Friends tr Public read Public read User Write Entry # 8

LCG 6 June Rene BrunPersistent Object References in ROOT8 Tree Friends Root > TFile f1(“tree1.root”); Root > tree.AddFriend(“tree2”,“tree2.root”) Root > tree.AddFriend(“tree3”,“tree3.root”); Root > tree.Draw(“x:a”,”k<c”); Root > tree.Draw(“x:tree2.x”,”sqrt(p)<b”); x Processing time independent of the number of friends unlike table joins in RDBMS Collaboration-wide public read Analysis group protected user private

LCG 6 June Rene BrunPersistent Object References in ROOT9 Chains of Trees tr TChain ch(“T”); ch.Add(“f0.root”); ch.Add(“f1.root”); ch.Add(“f2.root”); ch.Add(“f3.root”); ch.Add(“f4.root”); ch.Add(“f5.root”); ch.Add(“f6.root”); ch.Add(“f7.root”); ch.GetEntry(28); Binary search in table above find slot 4, local entry 2 T.GetEntry(2) in f4.root ch.GetEntryWithIndex(12,567); f0f2f3f4f5f6f7f1

LCG 6 June Rene BrunPersistent Object References in ROOT10 Existing TRef, TRefArray Designed as light weight entities Assume large number of TRefs per event Very fast dereferencing (direct access tables) Cannot (not designed for) find an object in a file TLongRef, TLongID classes proposed for references with load on demand

LCG 6 June Rene BrunPersistent Object References in ROOT11 TRef/TRefArray advantages TRef is perfect for referencing objects like hits, clusters, tracks that may be > You would not like to have the size of a TRef bigger than the size of its referenced object ! A TRef occupies in average 2.5 bytes in the file There is no point in providing load on demand for one single hit, cluster or track.

LCG 6 June Rene BrunPersistent Object References in ROOT12 TRef example: Event.h class Event : public TObject { private: char fType[20]; //event type char *fEventName; //run+event number in character format int fNtrack; //Number of tracks int fNseg; //Number of track segments int fNvertex; int fMeasures[10]; float fMatrix[4][4]; float *fClosestDistance; //[fNvertex] EventHeader fEvtHdr; TClonesArray *fTracks; //->array with all tracks TRefArray *fHighPt; //array of High Pt tracks only TRefArray *fMuons; //array of Muon tracks only TRef fLastTrack; //reference pointer to last track TRef fWebHistogram; //EXEC:GetWebHistogram TH1F *fH; //-> public:... TH1F *GetHistogram() const {return fH;} TH1F *GetWebHistogram(Bool_t reload=kFALSE) const { return (TH1F*)fWebHistogram.GetObject(reload);} Can also do load on demand

LCG 6 June Rene BrunPersistent Object References in ROOT13 Load on demand It makes sense for objects like large collections of hits, clusters, tracks files mag field geometry Assuming that an event will contain < 100 such objects to be requested on demand, there is no problem in having fat references (eg 50 bytes) TLongRef TLongID

LCG 6 June Rene BrunPersistent Object References in ROOT14 TLongRef, TLongID File 1 container X File 2 container Y Object A has a TLongRef Object B is a TLongID Map of TLongIDs

LCG 6 June Rene BrunPersistent Object References in ROOT15 Object Identification Pointer to object in memory File Identification and directory Access method in file (Tree, etc) ID

LCG 6 June Rene BrunPersistent Object References in ROOT16 TLongID An object referenced by a TLongRef must inherit from class TLongID When a TLongID is created, it is added to one single table (map) of LongIDs When a TLongID is written to a file, its persistent components are written to the file. When a TLongID is read, it is added to the map of LongIDs.

LCG 6 June Rene BrunPersistent Object References in ROOT17 TLongRef A TLongRef points to an object inheriting from TLongID. TLongRef attributes are identical to TLongID. In addition it includes a pointer to the object. When a TLongRef is written, its TLongID components are written. When a TLongRef is dereferenced, its pointer is computed (if not already there) by searching in the map of TLongIDs.

LCG 6 June Rene BrunPersistent Object References in ROOT18 TLongID class TLongID { TUUID fUUID; TString fText1; TString fText2; etc… } root [0] TUUID u root [1] u.AsString() (const char* 0x40476a80)"c62ad97a-78c9-11d6-9e58-4ed58a89beef" Additional info to be discussed TUUID unique in time (nanoseconds) and space Up to 128 bits TLongID could be reduced to TUUID

LCG 6 June Rene BrunPersistent Object References in ROOT19 TLongRef class TLongRef { TUUID fUUID; TString fWhere; TString fHow; etc… } Additional info to be discussed FileID subdirectory branch in Tree, etc A copy of the TUUID in TLongID