210 likes | 301 Views
STOREG L TE A Data Model Toolkit for the Atlas Software Architecture. Paolo Calafiura , C. Leggett, H. Ma, D. Quarrie, S. Rajagopalan. Analysis. H. H. H. H. H. T. T. T. D. D. “The Event”. D. D. D. D. D. D. D. Tracking. Hit Reconstruction. Event Data Model . Knowledge
E N D
STOREGLTE A Data Model Toolkit for the Atlas Software Architecture Paolo Calafiura, C. Leggett, H. Ma, D. Quarrie, S. Rajagopalan
Analysis H H H H H T T T D D “The Event” D D D D D D D Tracking Hit Reconstruction Event Data Model StoreGate, a Data Model Toolkit…
Knowledge Source Knowledge Source Knowledge Source Control Framework Data Store read write wipe activates The Blackboard Pattern operates on execute loop nextSource adapted from the ”Siemens” Patterns book StoreGate, a Data Model Toolkit…
Tracking Data Flow Write TrackColl Event Store Track Collection Control Flow Read TrackColl Analysis Data Store Pros and Cons • Separates stabledata from evolving algorithms • Algorithms can be independently added, updated or removed from a running system • Algorithms need to locate data in the store • Control Framework must be configured correctly to reach the desired solution StoreGate, a Data Model Toolkit…
What is StoreGate? • A type-centric Data Store • StoreGateSvc: Data Store client API (Gaudi service) • Data Object virtual proxy with lazy instantiation • A set of Data Object design tools • Handle for “automatic update” of time-varying data • Persistable inter-object references • Polymorphic STL-like Collections with defined element ownership • Memory pool for optimized memory allocation StoreGate, a Data Model Toolkit…
retrieve(type, key) record(type, key) Data Object DataProxy StoreGateSvc StoreMap Type ProxyMap Key StoreGateSvc: Type-centric Store Templated read/write All types in store All instances of a given type Virtual proxy StoreGate, a Data Model Toolkit…
My Analysis Identifying Data Objects My Tracking provenance • Data object type • User defined key(well-known name) • Default data object • Use Data Object History (provenance) • Reduce user-defined keys • Not yet implemented Write “MyTracks” “MyTracks” TrackCollection Event Store “YourTracks” TrackCollection Read “MyTracks” Read “YourTracks” Your Analysis StoreGate, a Data Model Toolkit…
StoreGateSvc API To record (write) a data object StatusCode sc = p_sgSvc record(pTrkColl, TrkCollKey); To retrieve (read) a data object p_sgSvc retrieve(pTrkColl[,TrkCollKey]); p_sgSvc retrieve(beginTC, endTC); where : • pTrkCollis a (const) pointer to a TrackCollection • TrkCollKey is an identifier for a data object. It can be a simple string like: “MyTrackCollection” • beginTC, endTC are iterators over all TrkColl instances in the store StoreGate, a Data Model Toolkit…
DataProxy DataObject IConverter accessData createObj createRep Control Object Access and Creation • DataProxy • Virtual Proxy that collaborates with Gaudi (one day, POOL) transient-persistent conversion mechanism • In the future may use history info to reconstruct data object on-demand • Lazy data object instantiation (on client access) • Support/enforce const-correctness • StoreGateSvc allows to “freeze” a data object ready to be used or written out creates StoreGate, a Data Model Toolkit…
DataHandle for Time-Varying Data • Purpose: • Hide store dynamics from client code • Handle is bound to DataProxy during initialization • Automatically updated (again using lazy instantiation) when Data Object enters a new validity range • Use cases: • alignment data • calibration objects • detector description information • anything which has an associated validity range StoreGate, a Data Model Toolkit…
Asynchronous update of Calibration Data Alg Handle Storegate Proxy PPSvc IOVSvc IOVDbSvc PersSvc CondDB NovaCnv regHandle(handle,key) bind(handle,key) initialize bindHandle(handle) regProxy(proxy) regFcn(this,&Fcn,handle,key) accessData() getData(key) updateAddress(TA) updateAddress(TA) DataObj* IOA IOA IOV,string T* setRange(clID,key,IOV) buildIOA(string) buildIOA(string) IOA partial IOA setAddress(IOA) execute createObj(IOA) DataObj* T* reset() reset() async callback(dbKey) StoreGate, a Data Model Toolkit…
Work with User Types • What is a Data Object? An object recorded into StoreGate (SG) • Only constraint is to be an “Assignable” • No base class for SG data objects • SG uses generic programming to work with user types adapting to the interface they provide (“export”) • Same strategy used for SG collections and inter-object relationships StoreGate, a Data Model Toolkit…
<<DataObject>> HitCollection StoreGateSvc <<Element>> Hit Track Inter-Object Relationships Need Persistable Ptr that • is technology-independent • does not require Hit to derive from any base class • supports deferred access, creating the pointed-at object upon dereferencing • allows to point at • SG primary objects (Data Objects) • SG secondary objs (elements of a Data Object) registry unknown StoreGate, a Data Model Toolkit…
getDataObj locateElement Host Host StoragePolicy StoragePolicy IndexingPolicy DataLink ElementLink IndexingPolicy StoragePolicy getDataObj getElement DataLink and ElementLink • Policy-based design(parameterized inheritance) • ElementLink is a composition of policies • Default Indexing Policy generated according to host container type Host GenerateIndexing Policy StoreGate, a Data Model Toolkit…
Fixed number of digits/event (1M) random access record random access perfect hash The Need for Speed • Atlas L2 and EF are using Athena & SG • share Algorithms and Services with offline • Performance Studies • raw-data object access • Speed-up > x10 • Optimized containers • Key hashing • A lot of work StoreGate, a Data Model Toolkit…
Back to the Drawing Board Missed reqs and implementation surprises • Writing concrete and reading abstract • “Symlinks” (Concrete DObj) (ABC) • Proper solution when reflection available • Templates and physical design • Use PIMPL idiom to hide template implementation • Keep libraries and executables small • Templates and compilers • Undetected compilation errors • unit tests also improve compilation coverage • Unreadable compiler msgs (100+ lines) • boost concept-checking and compiler assertions StoreGate, a Data Model Toolkit…
Status and Outlook • SG blackboard is a mature product • Used extensively by Atlas developers offline and online • Performance and memory footprint meet requirements • Data Object tools (links, containers, DataHandle) complete but newer: will need some fine tuning • Need tools to exploit Athena History Objects • to Identify Data Objects • (perhaps) to steer Reconstruction-on-demand • Integration with LCG • New data link storage policy based on POOL Refs • Use SEAL Dictionary for Inheritance info StoreGate, a Data Model Toolkit…
Event Store H H H H H T T T D D D D D D D D D StoreGateSvc in Athena/Gaudi Application Manager Converter Converter Sequencer Converter Event LoopMgr Data Files Message Service Persistency Service StoreGateSvc JobOptions Service Algorithm Algorithm Particle Prop. Service Data Files StoreGateSvc Persistency Service Detector Store Other Services Auditors Histogram Service Scripting Service StoreGate, a Data Model Toolkit…
IOV Class Example class myIOVClass { public: virtual StatusCode CallBackFcn(list<string> &dbKeys);private:const DataHandle<CalAlign> m_align1;const DataHandle<CalAlign> m_align2; myIOVAlg2* that; }; myIOVClass::initialize() {p_IOVSvc->regHandle(m_align1, dBkey1);p_IOVSvc->regFcn(&myIOVClass::CallBackFcn, this, m_align1, dBkey1);p_IOVSvc->regFcn(&myIOVClass::CallBackFcn, this, m_align2, dBkey2); p_IOVSvc->regFcn(&myIOVClass::CallBackFcn, this, &myIOVClass2::OtherCallBackFcn, that); } StoreGate, a Data Model Toolkit…