Skip to content

Disabling Segments and Resources

Gordon Crone edited this page Sep 10, 2024 · 4 revisions

Disabling Segments and Resources

Resources and ResourceSets

ResourceBase is a class describing items that can be disabled directly. It inherits from Component which has the method disabled(). This is historic from ATLAS. The ResourceBase and Component classes could be combined into a single class.

A Segment is a container of Segments and Applications which inherits from ResourceBase so it can be disabled directly.

A ResorceSetAnd is a container of Resources (actually items inheriting from ResourceBase) which will be disabled if all of its contained Resources are disabled.

A ResourceSetOr is a container of Resources which will be disabled if any of its contained Resources are disabled.

The Component::disabled(const Session&) method

The first time this method is called it updates the Session's disabled components member. Later calls just look up the Component in that member.

The disabled method gets the list of disabled ResourceBase objects (Resources and ResourceSets) from the Session and adds them to its disabled components member. It iterates over these directly disabled components and also adds any child Components to the Sessions disabled components list.

It then iterates over all the ResourceSetOrs in the Session. If any member of the ResourceSetOr is disabled, the ResourceSetOr is added to its disabled member along with all children of the ResourceSetOr.

Then it iterates over the ResorceSetAnds in the Session. If any ResorceSetAnd is found with no enabled member remaining, the ResorceSetAnd and all its children are added to the disabled member.

Examples

Given the configuration in the following snippets we can disable components at various levels of granularity.

<obj class="DetectorToDaqConnection" id="crp4-connections">
 <rel name="contains">
  <ref class="DPDKReceiver" id="dpdk-np02srv003-receiver0"/>
  <ref class="ResourceSetAND" id="crp4-senders"/>
 </rel>
</obj>

...

<obj class="ResourceSetAND" id="crp4-senders">
 <rel name="contains">
  <ref class="HermesDataSender" id="hds-np02-wib-1001-10g-0"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1001-10g-1"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1002-10g-0"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1002-10g-1"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1003-10g-0"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1003-10g-1"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1004-10g-0"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1004-10g-1"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1005-10g-0"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1005-10g-1"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1006-10g-0"/>
  <ref class="HermesDataSender" id="hds-np02-wib-1006-10g-1"/>
 </rel>
</obj>

...
<obj class="ReadoutApplication" id="runp02srv003eth0">
 <attr name="tp_source_id" type="u32" val="4"/>
 <attr name="application_name" type="string" val="daq_application"/>
 <attr name="tp_generation_enabled" type="bool" val="1"/>
 <attr name="ta_generation_enabled" type="bool" val="1"/>
 <rel name="contains">
  <ref class="DetectorToDaqConnection" id="crp4-connections"/>
 </rel>
...
<obj class="Segment" id="crp4-segment">
 <rel name="applications">
  <ref class="WIECApplication" id="crp4-wiec"/>
  <ref class="ReadoutApplication" id="runp02srv003eth0"/>
 </rel>
 <rel name="controller" class="RCApplication" id="crp4-controller"/>
</obj>
...
<obj class="WIECApplication" id="crp4-wiec">
 <attr name="application_name" type="string" val="daq_application"/>
 <rel name="runs_on" class="VirtualHost" id="vh-np04-srv-012"/>
 <rel name="exposes_service">
  <ref class="Service" id="crp4-wiec_control"/>
 </rel>
 <rel name="action_plans">
  <ref class="ActionPlan" id="wiec-conf"/>
 </rel>
 <rel name="contains">
  <ref class="DetectorToDaqConnection" id="crp4-connections"/>
 </rel>
...
> listApps np02-session.data.xml 
      Applications in Session: np02-oks-session
Segment root-segment
  Segment crp4-segment
    Application: crp4-wiec contains: {crp4-connections}
    Application: runp02srv003eth0 contains: {crp4-connections}
...

Disabling a segment

This disables all the applications in the segment along with the segment controller.

> oks_enable -d np02-session.data.xml crp4-segment
Adding crp4-segment to disabled relationship of Session np02-oks-session
> listApps np02-session.data.xml 
      Applications in Session: np02-oks-session
Segment root-segment
  Segment crp4-segment disabled
    Application: crp4-wiec <disabled segment>
    Application: runp02srv003eth0 <disabled segment>

Disabling the ReadoutApplication

This disables the ReadoutApplication itself and also the WIECApplication. This is because disabling the ReadoutApplication disables all of its child resources which in this case is the crp4-connections DetectorToDaqConnection which is a ResourceSet. Disabling the crp4-connections disables the WIECApplication since it is a RsourcesetAND and all of its contained resources are now disabled.

> oks_enable -d np02-session.data.xml runp02srv003eth0
Adding runp02srv003eth0 to disabled relationship of Session np02-oks-session
> listApps np02-session.data.xml 
      Applications in Session: np02-oks-session
Segment root-segment
  Segment crp4-segment
    Application: crp4-wiec contains: {crp4-connections<disabled indirectly>} <disabled due to state of related objects>
    Application: runp02srv003eth0 contains: {crp4-connections<disabled indirectly>} <disabled directly>

Disabling the DataSenders

Disabling the crp4-senders ResourceSet disables the DetectorToDaqConnection crp4-connections since it is a ResourceSetOR. This in turn disables both the ReadoutApplication and the WIECApplication

> oks_enable -d np02-session.data.xml crp4-senders
Adding crp4-senders to disabled relationship of Session np02-oks-session
> listApps np02-session.data.xml 
      Applications in Session: np02-oks-session
Segment root-segment
  Segment crp4-segment
    Application: crp4-wiec contains: {crp4-connections<disabled indirectly>} <disabled due to state of related objects>
    Application: runp02srv003eth0 contains: {crp4-connections<disabled indirectly>} <disabled due to state of related objects>

Disabling a single HermesDataSender within the crp4-senders resource set only disables the channels in that DataSender and has no knock on effects on other resources. Dsiabling all of the HermesDataSenders in the ResourceSetAND of course will have the same affect as disabling the set.