Configuration.h 12.1 KB
Newer Older
1
2
3
#ifndef _evb_bu_configuration_h_
#define _evb_bu_configuration_h_

4
#include <memory>
5
#include <cstdint>
6
7

#include "evb/InfoSpaceItems.h"
8
#include "xdaq/ApplicationContext.h"
9
10
11
12
13
#include "xdata/Boolean.h"
#include "xdata/Double.h"
#include "xdata/String.h"
#include "xdata/Integer32.h"
#include "xdata/UnsignedInteger32.h"
14
#include "xdata/Vector.h"
15
16
17
18
19
20
21


namespace evb {

  namespace bu {

    /**
22
23
24
     * \ingroup xdaqApps
     * \brief Configuration for the builder unit (BU)
     */
25
26
    struct Configuration
    {
27
      xdata::String sendPoolName;                          // The pool name used for evb messages
28
29
30
      xdata::Integer32 evmInstance;                        // Instance of the EVM. If not set, discover the EVM over I2O.
      xdata::UnsignedInteger32 maxEvtsUnderConstruction;   // Maximum number of events in BU
      xdata::UnsignedInteger32 eventsPerRequest;           // Number of events requested at a time
31
      xdata::Double resourcesPerCore;                      // Number of resource IDs per active FU core
32
33
      xdata::UnsignedInteger32 sleepTimeBlocked;           // Time to sleep in ns for each blocked resource
      xdata::UnsignedInteger32 maxRequestRate;             // Maximum rate in Hz to send request to EVM
34
35
      xdata::Double fuOutputBandwidthLow;                  // Low water mark on bandwidth used for output of FUs
      xdata::Double fuOutputBandwidthHigh;                 // High water mark on bandwidth used for output of FUs
36
37
      xdata::UnsignedInteger32 lumiSectionLatencyLow;      // Low water mark on how many LS may be queued for the FUs
      xdata::UnsignedInteger32 lumiSectionLatencyHigh;     // High water mark on how many LS may be queued for the FUs
38
      xdata::UnsignedInteger32 maxFuLumiSectionLatency;    // Maximum number of lumi sections the FUs may lag behind
39
      xdata::UnsignedInteger32 maxTriesFUsStale;           // Maximum number of consecutive tests for FU staleness before failing
40
      xdata::UnsignedInteger32 staleResourceTime;          // Number of seconds after which a FU resource is no longer considered
41
      xdata::UnsignedInteger32 eventFragmentFIFOCapacity;  // Capacity of the FIFO used to buffer incoming event fragments
42
43
      xdata::UnsignedInteger32 superFragmentFIFOCapacity;  // Capacity of the FIFO for super-fragment
      xdata::Boolean dropEventData;                        // If true, drop the data as soon as the event is complete
44
45
      xdata::UnsignedInteger32 numberOfBuilders;           // Number of threads used to build events
      xdata::UnsignedInteger32 numberOfDiskWriters;        // Number of threads used to write events
46
47
      xdata::String rawDataDir;                            // Path to the top directory used to write the event data
      xdata::String metaDataDir;                           // Path to the top directory used to write the meta data (JSON)
48
49
50
      xdata::String jsdDirName;                            // Directory name under the run directory used for JSON definition files
      xdata::String hltDirName;                            // Directory name under the run directory used for HLT configuration files
      xdata::String fuLockName;                            // Filename of the lock file used to arbritrate file-access btw FUs
51
      xdata::String resourceSummaryFileName;               // Relative path to resource summary file
52
53
54
55
      xdata::Double rawDataHighWaterMark;                  // Relative high-water mark for the event data directory
      xdata::Double rawDataLowWaterMark;
      xdata::Double metaDataHighWaterMark;
      xdata::Double metaDataLowWaterMark;
56
      xdata::UnsignedInteger32 checkCRC;                   // Check the CRC of the FED fragments for every Nth event
57
      xdata::Boolean calculateCRC32c;                      // If set to true, a CRC32c checksum of data blob of each event is calculated
58
      xdata::Boolean useLock;                              // Prevent more than one BU in Configured or Enabled state
59
      xdata::Boolean deleteRawDataFiles;                   // If true, delete raw data files when the high-water mark is reached
60
      xdata::Boolean ignoreResourceSummary;                // If true, ignore the resource_summary file from hltd
61
      xdata::Boolean closeOldRuns;                         // If true, create empty EoR files in any old run directories without EoR files
62
      xdata::Boolean usePriorities;                        // If true, prioritize the event requests to the EVM
63
      xdata::UnsignedInteger32 minPriority;                // Minimum priority for requesting events
64
      xdata::UnsignedInteger32 maxEventsPerFile;           // Maximum number of events written into one file
65
      xdata::Double maxFileAgeSeconds;                     // Maximum time in seconds before events are written to disk
66
      xdata::UnsignedInteger32 fileInfoFIFOCapacity;       // Capacity of the FIFO used for files ready to be written
67
      xdata::UnsignedInteger32 closedFileInfoFIFOCapacity; // Capacity of the FIFO used for file accounting
68
      xdata::UnsignedInteger32 lumiSectionFIFOCapacity;    // Capacity of the FIFO used for lumi-section accounting
69
      xdata::UnsignedInteger32 lumiSectionTimeout;         // Time in seconds after which a lumi-section is considered complete
70
      xdata::String hltParameterSetURL;                    // URL of the HLT menu
71
      xdata::Vector<xdata::String> hltFiles;               // List of file names to retrieve from hltParameterSetURL
72
73
      xdata::String blacklistName;                         // Name of the blacklist file
      xdata::String fuBlacklist;                           // The FUs to blacklist as string
74
75
      xdata::String whitelistName;                         // Name of the whitelist file
      xdata::String fuWhitelist;                           // The FUs to whitelist as string
76
      xdata::String hltinfoName;                           // Name of the file containing the HLT info
77
      xdata::Boolean isGlobalRun;                          // Set to true if the configuration is for a global run
78
79
80
      xdata::String daqSystem;                             // Idenfier of the DAQ system, e.g. 'cDAQ','904', etc
      xdata::String daqInstance;                           // Idenfier of the DAQ instance, e.g. 'global','ecal','hcal', etc
      xdata::String fuGroup;                               // Name of the group of FUs assigned to this BU
81
82
83
      xdata::UnsignedInteger32 roundTripTimeSamples;       // Rolling average of round trip times for the last N I2O mesage (0 disables it)
      xdata::UnsignedInteger32 maxPostRetries;             // Max. attempts to post an I2O message

84
85

      Configuration()
86
87
        : sendPoolName("sudapl"),
          evmInstance(-1), // Explicitly indicate parameter not set
88
89
          maxEvtsUnderConstruction(256),
          eventsPerRequest(8),
90
91
          resourcesPerCore(0.4),
          sleepTimeBlocked(200),
92
          maxRequestRate(1000),
93
94
          fuOutputBandwidthLow(100),
          fuOutputBandwidthHigh(120),
95
96
          lumiSectionLatencyLow(1),
          lumiSectionLatencyHigh(4),
97
          maxFuLumiSectionLatency(3),
98
          maxTriesFUsStale(60),
99
          staleResourceTime(10),
Remi Mommsen's avatar
Remi Mommsen committed
100
          eventFragmentFIFOCapacity(256),
101
          superFragmentFIFOCapacity(3072),
102
          dropEventData(false),
103
          numberOfBuilders(5),
104
          numberOfDiskWriters(5),
105
106
107
108
109
          rawDataDir("/tmp/fff"),
          metaDataDir("/tmp/fff"),
          jsdDirName("jsd"),
          hltDirName("hlt"),
          fuLockName("fu.lock"),
110
          resourceSummaryFileName("appliance/resource_summary"),
111
112
113
114
          rawDataHighWaterMark(0.95),
          rawDataLowWaterMark(0.75),
          metaDataHighWaterMark(0.95),
          metaDataLowWaterMark(0.75),
115
          checkCRC(1),
116
          calculateCRC32c(true),
117
          useLock(true),
118
          deleteRawDataFiles(false),
119
          ignoreResourceSummary(false),
120
          closeOldRuns(true),
121
          usePriorities(true),
122
          minPriority(0),
123
          maxEventsPerFile(100),
124
          maxFileAgeSeconds(2),
125
126
          fileInfoFIFOCapacity(64),
          closedFileInfoFIFOCapacity(64),
127
          lumiSectionFIFOCapacity(128),
128
          lumiSectionTimeout(30),
129
          hltParameterSetURL(""),
130
131
          blacklistName("blacklist"),
          fuBlacklist("[]"),
132
133
          whitelistName("whitelist"),
          fuWhitelist("[]"),
134
          hltinfoName("hltinfo"),
135
          isGlobalRun(false),
136
137
138
          daqSystem(""),
          daqInstance(""),
          fuGroup(""),
139
140
          roundTripTimeSamples(1000),
          maxPostRetries(10)
141
142
      {
        hltFiles.push_back("HltConfig.py");
143
        hltFiles.push_back("fffParameters.jsn");
144
      };
145

146
147
148
149
150
      void addToInfoSpace
      (
        InfoSpaceItems& params,
        xdaq::ApplicationContext* context
      )
151
      {
152
        params.add("sendPoolName", &sendPoolName);
153
154
155
        params.add("evmInstance", &evmInstance);
        params.add("maxEvtsUnderConstruction", &maxEvtsUnderConstruction);
        params.add("eventsPerRequest", &eventsPerRequest);
156
        params.add("resourcesPerCore", &resourcesPerCore);
157
        params.add("sleepTimeBlocked", &sleepTimeBlocked);
158
        params.add("maxRequestRate", &maxRequestRate);
159
160
        params.add("fuOutputBandwidthLow", &fuOutputBandwidthLow);
        params.add("fuOutputBandwidthHigh", &fuOutputBandwidthHigh);
161
162
        params.add("lumiSectionLatencyLow", &lumiSectionLatencyLow);
        params.add("lumiSectionLatencyHigh", &lumiSectionLatencyHigh);
163
        params.add("maxFuLumiSectionLatency", &maxFuLumiSectionLatency);
164
        params.add("maxTriesFUsStale", &maxTriesFUsStale);
165
        params.add("staleResourceTime", &staleResourceTime);
Remi Mommsen's avatar
Remi Mommsen committed
166
        params.add("eventFragmentFIFOCapacity", &eventFragmentFIFOCapacity);
167
168
169
        params.add("superFragmentFIFOCapacity", &superFragmentFIFOCapacity);
        params.add("dropEventData", &dropEventData);
        params.add("numberOfBuilders", &numberOfBuilders);
170
        params.add("numberOfDiskWriters", &numberOfDiskWriters);
171
172
        params.add("rawDataDir", &rawDataDir);
        params.add("metaDataDir", &metaDataDir);
173
174
175
        params.add("jsdDirName", &jsdDirName);
        params.add("hltDirName", &hltDirName);
        params.add("fuLockName", &fuLockName);
176
        params.add("resourceSummaryFileName", &resourceSummaryFileName);
177
178
179
180
        params.add("rawDataHighWaterMark", &rawDataHighWaterMark);
        params.add("rawDataLowWaterMark", &rawDataLowWaterMark);
        params.add("metaDataHighWaterMark", &metaDataHighWaterMark);
        params.add("metaDataLowWaterMark", &metaDataLowWaterMark);
181
        params.add("checkCRC", &checkCRC);
182
        params.add("calculateCRC32c", &calculateCRC32c);
183
        params.add("useLock", &useLock);
184
        params.add("deleteRawDataFiles", &deleteRawDataFiles);
185
        params.add("ignoreResourceSummary", &ignoreResourceSummary);
186
        params.add("closeOldRuns", &closeOldRuns);
187
        params.add("usePriorities", &usePriorities);
188
        params.add("minPriority", &minPriority);
189
        params.add("maxEventsPerFile", &maxEventsPerFile);
190
        params.add("maxFileAgeSeconds", &maxFileAgeSeconds);
191
        params.add("fileInfoFIFOCapacity", &fileInfoFIFOCapacity);
192
        params.add("closedFileInfoFIFOCapacity", &closedFileInfoFIFOCapacity);
193
        params.add("lumiSectionFIFOCapacity", &lumiSectionFIFOCapacity);
194
        params.add("lumiSectionTimeout", &lumiSectionTimeout);
195
        params.add("hltParameterSetURL", &hltParameterSetURL);
196
        params.add("hltFiles", &hltFiles);
197
198
        params.add("blacklistName", &blacklistName);
        params.add("fuBlacklist", &fuBlacklist);
199
200
        params.add("whitelistName", &whitelistName);
        params.add("fuWhitelist", &fuWhitelist);
201
        params.add("hltinfoName", &hltinfoName);
202
        params.add("isGlobalRun", &isGlobalRun);
203
204
205
        params.add("daqSystem", &daqSystem);
        params.add("daqInstance", &daqInstance);
        params.add("fuGroup", &fuGroup);
206
207
        params.add("roundTripTimeSamples", &roundTripTimeSamples);
        params.add("maxPostRetries", &maxPostRetries);
208
209
210
      }
    };

211
    using ConfigurationPtr = std::unique_ptr<Configuration>;
212
213
214
215
216
217
218
219
220
221
222
223

  } } // namespace evb::bu

#endif // _evb_bu_configuration_h_


/// emacs configuration
/// Local Variables: -
/// mode: c++ -
/// c-basic-offset: 2 -
/// indent-tabs-mode: nil -
/// End: -