This package contains the core' schema for the DUNE daq OKS configuration.
The top level of the schema is the Session which defines some global DAQ parameters and has a relationship to a single top-level Segment. It also has a list of disabled Resources. It is intended that parts of the DAQ system that are not required in the current run are simply disabled rather than deleted from the database altogether.
A Segment is a logical grouping of applications which are controlled by a single controller (RCApplication). A Segment may contain other nested Segments. A Segment is a Resource that can be enabled/disabled (see below), disabling a Segment disables all of its nested Segments.
The Application class has attributes defining the application's
application_name
(executable name) and commandline_parameters
. Its
application_environment
relationship lists environment variables needed by the
application in addition to those defined by the Session.
Resource is an abstract class describing an item that can be
disabled directly. It has the method disabled()
which can be called
by application code to determine if the object should be considered
disabled for this session. The disabling logic calls the virtual
is_disabled()
method to determine the state of the Resource. The
implementation provided by the base class just checks that the object
itself is not in the list of disabled objects. Derived classes can
re-implement this method with whatever logic is needed to determine the
state of the object, for example the ResourceSetDisableAND class
provides an implementation that ANDs together the state of all of its
contained objects.
ResourceSet is an abstract container of Resources which can be disabled together. It
is itself a Resource (so can be nested). It defines a pure virtual method contained_resources()
to get the list of contained resources. Developers should implement this method to extract any resources that need to be considered for determining the disabled state of the set from among the class's relationships. The class may have relationships to other Resource derived
objects that will be ignored for the disabled check.
ResourceSetDisableAND is a container of Resources which will be disabled if all of its Resources are disabled. It provides a final implementation of the ResourceSet::is_disabled() method.
ResourceSetDisableOR is a container of Resources which provides a final implementation of the ResourceSet::is_disabled() method returning true if any of its contained Resources are disabled.
Segment is a container of Segments and Applications which inherits from ResourceSetDisableAND so it can be disabled directly or indirectly if all its components are disabled.
The Resource disabled logic works on a single tree of ResourceSets.
It is held by the virtual class ResourceTree currently Session
is the only concrete class derived from it.
The ResourceTree holds a DisabledResources object which is initialised with a reference to the root Segment
and the list of disabled resources from its disabled
relationship.
The DisabledResources constructor will configure itself using the
tree of Resources and initial list of disabled Resources.
To start with, the UID of each member of the list is inserted into a
set and any 'contained' (using the contained_resources()
method) Resources
are also disabled.
A list of all ResourceSets in the tree is generated by recursively
calling contained_resources()
and iterating over all the ResourceSets.
Then it iterates over the list of ResourceSets. If a ResourceSet
is not currently in the disabled set, it will call the is_disabled()
method to see if its state has been changed by the current content of
the disabled set. It will repeat this procedure until an iteration
that ends with the same number of disabled resources it started with.
(the blue classes in the diagram are not part of confmodel and are there to show how the other parts fit together)
The readout map is defined in terms of DetectorStream objects which define a one to one mapping between a source_id and a **GeoID" object. A collection of streams are aggregated into a DetDataSender and a group of DetDataSender objects are contained in a DetectorToDaqConnection along with a single DetDataReceiver.
The DetectorToDaqConnection is a ResourceSet with a custom implementation of is_disabled()
that checks that the DetDataReceiver and at least one DetDataSender are enabled.
The DetDataSender is a ResourceSetDisableAND that contains a set of DetectorStream Resources.
Each controller (RCApplication) uses one FSMConfiguration object that describes action, transitions and sequences.
The idea is that this describes the subset of resources of a physical host server that are available to an Application. For example two applications may be assigned to the same physical server but each be allocated resources of a different NUMA node.
The DaqApplication contains a list of DaqModules each of which has a
list of used resources. The DaqApplication provides a method
get_used_hostresources
which can be called by appfwk
in order to check
that these resources are indeed associated with the VirtualHost by
comparing with those listed in its hw_resources
relationship.
Describes the connection type and points to the Service running over this connection.