Presentation is loading. Please wait.

Presentation is loading. Please wait.

CINT & Reflex: New Reflection Data Structures Masa(haru) Goto Agilent Philippe Canal Fermilab/CD Stefan Roiser, Axel Naumann PH/SFT.

Similar presentations


Presentation on theme: "CINT & Reflex: New Reflection Data Structures Masa(haru) Goto Agilent Philippe Canal Fermilab/CD Stefan Roiser, Axel Naumann PH/SFT."— Presentation transcript:

1 CINT & Reflex: New Reflection Data Structures Masa(haru) Goto Agilent Philippe Canal Fermilab/CD Stefan Roiser, Axel Naumann PH/SFT

2 2006-09-18AA Review 20062 CINT Is The Prompt, Right? CINT is Backend for all dictionary based interpreters Execution engine (compiled and interpreted code) Prerequisite for signal/slot Prerequisite for I/O Reflection is Part of CINT’s knowledge, used for all of above Info on types and their members: name, type, access to values or call

3 2006-09-18AA Review 20063 Data flow CINT And Reflection C++ Parser Reflection Data Generate Dictionary Load Dictionary Interpreter Reflection C++ API Compiled Function Call ROOT Uses Auto-Load gccxml rootcint Dict Gen

4 2006-09-18AA Review 20064 Common Linkdef.h interface rootcint -cint, -reflex, -gccxml Unified Python interface: PyROOT Comments From Last Review Common Dictionary - unify dictionary clients for experiments using lcgdict/reflex, unify automatic generation of glue code (e.g. python bindings) [JJ Blaising, feedback talk 1.4.2005] “

5 2006-09-18AA Review 20065 Dictionary Options – You Choose! CINT dictionary Reflex dictionary selection.xml Linkdef.h genreflex.p y rootcint ROOT Cintex CINT parser gccxml parser

6 2006-09-18AA Review 20066 Dictionary Options – The Goal Reflex dictionary selection.xml Linkdef.h genreflex.p y rootcint ROOT CINT parser gccxml parser

7 2006-09-18AA Review 20067 Comments From Last Review (cont’ed) First version of Cint with Reflex reflection data base expected for end of year – not yet production grade! Production-grade version available mid 2007 Reasons for delay: Moving functionality from CINT to Reflex Keeping CINT API backward compatible Merge process more involved than expected Ordering, scheduling, priorities [Final Report 2005] “

8 2006-09-18AA Review 20068 That’s It? Already? No. This talk’s menu offers following courses: Motivation: why we (still) need the merge Merge implementation details Steps of the merge Merge related development in Cint and Reflex Status Outlook

9 2006-09-18AA Review 20069 Motivation For Cint-Reflex Merge C++ code replacing C structs Smaller heap footprint: factor 3 in current CVS for CLHEP based example – expected to deteriorate Dynamic data structures, no hard-wired limits Easier to maintain Refactoring, separation of functionality Preparation for thread-safety

10 2006-09-18AA Review 200610 C++ Code Vs. C structs Example Current Cint has global C structs struct G__tagtable { char* name[G__MAXSTRUCT]; … } G__struct; Reflex allows OO access to reflection data Reflex::Scope::GlobalScope(); Covers types, data members, function members, templates,…

11 2006-09-18AA Review 200611 Merge Implementation - Context Why you care: reason for merge schedule CINT mixes reflection and execution data, need to split carefully CINT extremely complex: extensive use of globals, spread of functionality, side effects CINT grown and debugged, don’t want to risk breaking parts that work Changes need to be “invisible” to users

12 2006-09-18AA Review 200612 Merge Implementation - Consequence Small step changes Always compare to working version with extensive test suite Replace data structures first Major benefit will come only later: replace functionality remove code duplication take advantage of OO data structures

13 2006-09-18AA Review 200613 Steps Of Merge Need duplication of scope info for both CINT and Reflex while merging (for contained types) Scaffolding, wrappers, convenience functions for Reflex and CINT Typedef database: G__newtype  Reflex::Type Globals: G__*tagnum  Reflex::Scope Structs: G__struct  Reflex::Scope Functions: G__ifunc  Reflex::FunctionMember Data members: G__vararry  Reflex::DataMember

14 2006-09-18AA Review 200614 Merge Tactics New configure; make CINT build system to allow sensible multi-platform tests CVS branch for merge, apply bug fixes from HEAD All other major development for CINT stalled until merge is done Update definition of CINT’s API. Will keep API backward compatible, use export statements to ensure no internal function is used by e.g. ROOT Once done, make libCint.so and libCintNew.so binary compatible, to allow switch without rebuild: mv lib/libCintNew.so lib/libCint.so; root

15 2006-09-18AA Review 200615 Development In CINT For Merge New build system for standalone CINT/Reflex API redefinition Scaffolding to allow transition of data structures without large re-write of code extern “C” wrappers for some functions and classes + the actual merge…

16 2006-09-18AA Review 200616 Development In Reflex For Merge Unloading of dictionary Changes to Reflex::Builder interface Late (on-demand) initialization of reflection data Extended C++ support: using directives, hiding typedef struct A A, using declarations, friend Name Lookup: major boost in Reflex functionality, and damn complex

17 2006-09-18AA Review 200617 Development In Reflex (cont’ed) Fast access of reflex objects’ properties, needed for CINT execution data Reflex objects can create dictionary representation of themselves Several convenience functions, e.g. discover the raw type ( const char*  char ), the kind of fundamental type etc.

18 2006-09-18AA Review 200618 Name Lookup Reflex dictionary generator API On the way Duplication of scopes for CINT and Reflex Scaffolding, wrappers, convenience functionality configure && make build system Update of definition of CINT API Typedef, globals reflection database Unloading of dictionary Reflex::Builder interface changes Reflex support for using directives, hiding typedef struct A A Fast access to Reflex objects’ properties Done! struct/class/…, function, data member reflection database On demand initialization of Reflex data Reflex support for using declarations, friend To Do Status - Where Are We Now? ! ! ! ! ! ! : a lot of work

19 2006-09-18AA Review 200619 Outlook - Merge Merge related: First version of CINT using Reflex by end of year ROOT’s TClass, TMethod,… classes to be updated after Cint/Reflex merge, i.e. 2007 Adaptation of PyROOT to use Reflex API Other ROOT occurrences of CINT API calls to be replaced by Reflex API calls

20 2006-09-18AA Review 200620 Outlook - CINT 2007: Function stubs / call wrappers will be removed on selected platforms (GCC3,4; MSVC) Just-in-time dictionary generator builds dictionary for all template instances needed, when needed 2008: Reflex persistency -.root instead of.so ???

21 2006-09-18AA Review 200621 Outlook – Dictionary Reflex dictionary Linkdef.h / selection.xml genreflex.p y rootcint ROOT CINT parser gccxml parser

22 2006-09-18AA Review 200622 Outlook – Dictionary Current Reflex dictionaries: 2007: Remove function stubs on selected platforms 2007: Generate template dictionaries on demand 2008: Don’t “store” Reflex database as.cxx/.o (part of lib) but as.root file, generate member offset info on-the-fly: ROOT itself would shrink by ~25%! Improvement independent of selection.xml / Linkdef.h and gendict.py / rootcint 100% 33% ~1%

23 2006-09-18AA Review 200623 Outlook 2008+: Future: reconsider gccxml to Reflex path: gendict.py? C++? PyROOT based? CINT thread safety More details in the coming months – early comments welcome!

24 2006-09-18AA Review 200624 FIN

25 2006-09-18AA Review 200625 Dictionaries – The Full Picture 200x CINT parser genreflex2 gccxml genreflex.py Builder API User API cint>>>> CINT interpreter PyReflex libMy.so Dictionary Generator My.h My_rflx.cpp My_rflx.root PyROOT Linkdef.h / selection.xml Reflex DS libMyRflx.so make Symbol Lookup Stub comp. / Offset calc. ROOT meta hist math … Python ROOT XML C/C++ ? XML parser (e.g. Xerces) genreflex.cpp XML parser (e.g. expat) genreflex2.py PyReflex either / or Just in time compiler My.xml dlopen File Process Data Library Flow

26 2006-09-18AA Review 200626 Dictionary Heap Usage CINT, CLHEP example 2500k

27 2006-09-18AA Review 200627 Dictionary Heap Usage Reflex, CLHEP example 700k


Download ppt "CINT & Reflex: New Reflection Data Structures Masa(haru) Goto Agilent Philippe Canal Fermilab/CD Stefan Roiser, Axel Naumann PH/SFT."

Similar presentations


Ads by Google