Skip to content

Commit cbc8415

Browse files
committed
added readout.tfRateLimitMode
1 parent 46ecda9 commit cbc8415

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

doc/configurationParameters.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ The parameters related to 3rd-party libraries are described here for convenience
213213
| readout | numberOfRuns | int | 1 | In standalone mode, number of runs to execute (ie START/STOP cycles). |
214214
| readout | rate | double | -1 | Data rate limit, per equipment, in Hertz. -1 for unlimited. |
215215
| readout | tfRateLimit | double | 0 | When set, the output is limited to a given timeframe rate. |
216+
| readout | tfRateLimitMode | int | 0 | Defines the source for TF rate limit: 0 = use TF id, 1 = use number of TF. |
216217
| readout | timeframeServerUrl | string | | The address to be used to publish current timeframe, e.g. to be used as reference clock for other readout instances. |
217218
| readout | timeStart | string | | In standalone mode, time at which to execute start. If not set, immediately. |
218219
| readout | timeStop | string | | In standalone mode, time at which to execute stop. If not set, on int/term/quit signal. |

doc/releaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,3 +575,4 @@ This file describes the main feature changes for each readout.exe released versi
575575
- When running from the command line, the environment variable O2_RUN can be used to set the run number. It is set to 0 by default, i.e. undefined run number.
576576
- Updated configuration parameters:
577577
- added readout.numberOfRuns: in standalone mode, number of START/STOP cycles to execute (used for testing).
578+
- added readout.tfRateLimitMode: can be set to 1 to use number of TF instead of computed TF id. Useful when replaying files with jumps in TF ids.

src/mainReadout.cxx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ class Readout
358358
double cfgAggregatorSliceTimeout;
359359
double cfgAggregatorStfTimeout;
360360
double cfgTfRateLimit;
361+
int cfgTfRateLimitMode;
361362
int cfgLogbookEnabled;
362363
std::string cfgLogbookUrl;
363364
std::string cfgLogbookApiToken;
@@ -408,6 +409,7 @@ class Readout
408409
AliceO2::Common::Timer logbookTimer; // timer to handle readout logbook publish interval
409410

410411
uint64_t maxTimeframeId;
412+
uint64_t countTimeframeId;
411413

412414
#ifdef WITH_ZMQ
413415
std::unique_ptr<ZmqServer> tfServer;
@@ -938,6 +940,9 @@ int Readout::_configure(const boost::property_tree::ptree& properties)
938940
// configuration parameter: | readout | tfRateLimit | double | 0 | When set, the output is limited to a given timeframe rate. |
939941
cfgTfRateLimit = 0;
940942
cfg.getOptionalValue<double>("readout.tfRateLimit", cfgTfRateLimit);
943+
// configuration parameter: | readout | tfRateLimitMode | int | 0 | Defines the source for TF rate limit: 0 = use TF id, 1 = use number of TF. |
944+
cfgTfRateLimitMode = 0;
945+
cfg.getOptionalValue<int>("readout.tfRateLimitMode", cfgTfRateLimitMode);
941946

942947
// configuration parameter: | readout | disableTimeframes | int | 0 | When set, all timeframe related features are disabled (this may supersede other config parameters). |
943948
cfgDisableTimeframes = 0;
@@ -1391,6 +1396,7 @@ int Readout::_start()
13911396
publishLogbookStats();
13921397
logbookTimer.reset(cfgLogbookUpdateInterval * 1000000);
13931398
maxTimeframeId = 0;
1399+
countTimeframeId = 0;
13941400

13951401
// execute custom command
13961402
executeCustomCommand("preSTART");
@@ -1498,13 +1504,18 @@ void Readout::loopRunning()
14981504
if (bc->size() > 0) {
14991505
if (bc->at(0)->getData() != nullptr) {
15001506
uint64_t newTimeframeId = bc->at(0)->getData()->header.timeframeId;
1507+
if (cfgTfRateLimitMode == 1) {
1508+
// use number of TF instead of computed TF id. Useful when replaying files with jumps in TF ids.
1509+
newTimeframeId = countTimeframeId + 1;
1510+
}
15011511
// are we complying with maximum TF rate ?
15021512
if (cfgTfRateLimit > 0) {
15031513
if (newTimeframeId > floor(startTimer.getTime() * cfgTfRateLimit) + 1) {
15041514
usleep(1000);
15051515
continue;
15061516
}
15071517
}
1518+
countTimeframeId++;
15081519
if (newTimeframeId > maxTimeframeId) {
15091520
maxTimeframeId = newTimeframeId;
15101521
#ifdef WITH_ZMQ

src/readoutConfigEditor.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ set configurationParametersDescriptor {
159159
| readout | numberOfRuns | int | 1 | In standalone mode, number of runs to execute (ie START/STOP cycles). |
160160
| readout | rate | double | -1 | Data rate limit, per equipment, in Hertz. -1 for unlimited. |
161161
| readout | tfRateLimit | double | 0 | When set, the output is limited to a given timeframe rate. |
162+
| readout | tfRateLimitMode | int | 0 | Defines the source for TF rate limit: 0 = use TF id, 1 = use number of TF. |
162163
| readout | timeframeServerUrl | string | | The address to be used to publish current timeframe, e.g. to be used as reference clock for other readout instances. |
163164
| readout | timeStart | string | | In standalone mode, time at which to execute start. If not set, immediately. |
164165
| readout | timeStop | string | | In standalone mode, time at which to execute stop. If not set, on int/term/quit signal. |

0 commit comments

Comments
 (0)