1 / 18

Framework Tutorial

Framework Tutorial. Algorithm Workship Jan. 21, 1999. H. Greenlee. Outline. Documentation. Creating a package class. Framework hooks. Compiling a package. Linking the framework executable. Running the framework executable. The framework rcp file. The package rcp file.

mchilders
Télécharger la présentation

Framework Tutorial

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Framework Tutorial Algorithm Workship Jan. 21, 1999 H. Greenlee

  2. Outline • Documentation. • Creating a package class. • Framework hooks. • Compiling a package. • Linking the framework executable. • Running the framework executable. • The framework rcp file. • The package rcp file. • The command line. • Standard packages.

  3. Documentation • Documentation is available in code release area: $BFDIST/releases/test/framework/doc. • Via web: http://www-d0.fnal.gov/d0dist/dist/releases/test/framework/doc/ • Available documents: • user_guide.ps. • Design and usage. • getting_started.ps. • getting_started.html. • Less detail.

  4. Creating a Package Class • Inherit from base class Package. • Inherit from hook base classes. • Required methods. • Constructor taking argument of type Context*(do not include Context header file). • Static methods: • static const string version(); • static const string package_name(); • Package class overrides: • string packageName(); (should call package_name()). • Hook overrides. • Define registration global variable using macro FWK_REGISTRY.

  5. MyPackage.hpp Package base class Hook base class Required constructor Hook override Package override Required static methods

  6. MyPackage.cpp Conventional implementation of version()

  7. RegMyPackage.cpp Registration macro Name of registration variable (irrelevant) Package class name

  8. Event-Oriented Hooks • Generator • Construct a new event. • Merge • Merge events from multiple generators. • Decide • Modify framework work queue. • Builder • Modify event. • Filter* • Optionally skip processing for this event. • Process • Modify event. • Analyze* • Analyze event. • Dump* • Produce an ascii dump of an event. * Read only access to event.

  9. Non-Event-Oriented Hooks • RunInit • Called at beginning of run. • RunEnd • Called at end of run. • JobSummary. • Called at end of job.

  10. Compiling a Package • Compile registration file as bare object file. • Compile other sources into a library. • Example SRT GNUmakefile: • In ctest/ctbuild: • List registration files in OBJECT_COMPONENTS. • List other sources in COMPONENTS.

  11. Standard Packages • Packages available in io_packages library: • ReadEvent.o • Read events from D0OM file. • NewEvent.o • Create an empty edm event. • MergeEvents.o • Merge events from several generators (copies chunks). • DropChunks.o • Drop chunks by name (builder hook). • WriteEvent.o • Write D0OM format file. • DumpEvent.o • Produce an ascii dump of edm events using method edm::AbsChunk::print.

  12. Linking the Framework Executable • Required link objects and libraries. • Framework main program framework.o. • Package registration object files, e.g.: • ReadEvent.o • WriteEvent.o • MyPackage.o • Libraries required by framework and standard I/O packages. • -lio_packages • -lframework • -ledm • -lrcp • -lidentifiers • -lExceptions • -lZMutility • -lZMtools • -lErrorLogger

  13. Linking (cont.) • Libraries required by your own or other packages. • Libraries and objects required by D0OM and DSPACK: • LoadDSPACK.o or LoadEVPACK.o (typically). • $(D0OM_DS_LIBES) or $(D0OM_EV_LIBES) (defined in d0om_ds/arch_spec_d0om_ds.mk). • In SRT, use d0_util/binaries.mk to generate linking rule and dependencies on $(LOADLIBES). • In ctest/ctbuild: • Store link objects in file OBJECTS. • Store link libraries in file LIBRARIES. • Store executable files in file BINARIES or ITESTS.

  14. An Example GNUmakefile

  15. Running the Framework Executable • Copy framework rcp file and package rcp file to working directory. • Run framework program. Give framework rcp file on command line: • MyProgram.x -rcp framwork.rcp • Use -help option or run program without any options to see list of supported options.

  16. Framework Program Command Line Options

  17. The Framework RCP File List all used hooks Event hooks in order Package “instance names” (arbitrary) Package rcp files

  18. The Package RCP File Required rcp parameter for all packages Arbitrary rcp parameters allowed here.

More Related