Feature #2886

All configured services shall be created

Added by Adam Lyon over 8 years ago. Updated over 8 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
SSI Package:


This is a feature request resulting from a conversation that Marc Paterno and I had about g-2's plans for a generic Geant+Art based simulation system.

Currently, a service configured in a FHICL file is not actually created until some piece of code requests a handle to it (this is unlike producer/filter/analyzer modules which are always created if they are configured in the FHICL). Marc could not remember a good reason for this delayed service creation, except that it was possibly inherited from CMS. Unlike the CMS configuration system, FHICL has the notion of a PROLOG, where modules and services can be pre-defined and are only brought into a run of Art if the FHICL file brings them in via @local. So we think having PROLOG in FHICL alleviates the need for delayed service creation.

Delayed service creation means that for a service to be created, some other piece of code needs to know about that service by name (it's type) in order to get the handle. This requires some "uber-code" to know about all of the expected services and makes a modular "generic" system of services impossible (see below).

I want to request that Art be changed so that if a service is mentioned specifically in a FHICL file, it be constructed just as regular modules do. This does not change the behavior of services mentioned in a FHICL PROLOG.

The specific use case here is that we want to make a completely generic Geant simulation system within Art, where detectors and actions are embodied by services. We do not want an "uber-module" to know what services are expected - rather, when a detector service is created, it will register itself with a "DetectorHolder" service. This DetectorHolder service will maintain a container of the detector services. For this to work, the detector service must be created without some other code asking a handle for it, in order to avoid the uber-code situation. With such a system, it would be possible to construct a simulation by listing services in a FHICL file without any changes to infrastructure code.

The order of service creation may be arbitrary. BUT, if a service's constructor does ask for a handle of a service that has not yet been created, that corresponding service should be created on the spot, just like it is now.

So in summary, the request is...

1) All services configured in a FHICL file are created before the beginJob state (no delayed creation).
2) The order of service creation is arbitrary, but if a service's constructor gets a handle to a yet-to-be created service, that service is created on the spot and returned.
3) Services mentioned in a FHICL PROLOG have the same behavior as now (not created unless brought in via @local).

Possible risks:
If a user's FHICL file has a service configured but never used by the code, that service is never created. With this change, the service will be constructed. If the constructor fails, the Art run may die.


#1 Updated by Adam Lyon over 8 years ago

Arrgh - (it's type) -> (its type)

#2 Updated by Christopher Green over 8 years ago

  • Category set to Infrastructure
  • Status changed from New to Closed

This feature is already in place. We have discussed with the experiments and there are no plans to change this feature in future.

Also available in: Atom PDF