Skip to content

Commit fe4588a

Browse files
authored
Merge pull request #258 from sy-c/master
v2.20.0
2 parents bae812c + efbe74a commit fe4588a

File tree

7 files changed

+24
-10
lines changed

7 files changed

+24
-10
lines changed

doc/configurationParameters.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This document describes all the configuration parameters that can be set in readout.
44

5-
Some parameters control the behavior of readout as soon as it starts, and valid for the lifetime of the process. (1)
5+
Some parameters control the behavior of readout as soon as it starts, and are valid for the lifetime of the process. (1)
66

77
Other parameters (2) are set whenever the control state-machine receives the CONFIGURE command (or shortly after startup when running o2-readout-exe outside from the ECS workflow, typically from the command line) and until the RESET command.
88
The corresponding parameters usually come from a local file or from a central reposity, as provided by the O2 system.
@@ -11,20 +11,20 @@ They can be reloaded several time during the lifetime of the process.
1111

1212
# Readout defaults (1)
1313

14-
These are defined in local file `/etc/o2.d/readout-default.cfg`, which is loaded on `o2-readout-exe` startup (if file exists). They are valid for the lifetime of the o2-readout-exe process. There is usually no need for users to edit these settings. The file format is '.ini' style, with `[sections]` and `key=value` pairs.
14+
These are defined in local file `/etc/o2.d/readout-default.cfg`, which is loaded on `o2-readout-exe` startup (if the file exists). They are valid for the lifetime of the o2-readout-exe process. There is usually no need for users to edit these settings. The file format is '.ini' style, with `[sections]` and `key=value` pairs.
1515

16-
Following table describe the parameters of the `[readout]` section.
16+
Following table describes the parameters of the `[readout]` section.
1717

1818
| Parameter name | Type | Default value | Description |
1919
|--|--|--|--|
2020
| memLock | int | 0 | Defines the memory swapping policy. If set, all readout memory is locked in RAM with mlockall() |
2121
| readoutExe | string | | If set, overwrites the current running executable with the one at given path. Used for tests. |
2222
| readoutConfig | string | | If set with readoutExe, launch the new exe with this parameter as argument. Used for tests. |
23-
| statsPublishAddress | string | | If set, address where to publish readout stats, eg "tcp://127.0.0.1:6008". Connect to this service with o2-readout-monitor. |
23+
| statsPublishAddress | string | | If set, address where to publish readout stats, eg "tcp://127.0.0.1:6008" (o2-readout-monitor should listen there). |
2424
| statsPublishInterval | string | | If set, interval for readout stats publish, in seconds. |
2525
| db | string | | If set, defines connection parameters to a MySQL database in the form 'user:password@host/dbname'. Runtime statistics are stored in a table. Structure can be created with o2-readout-admin-db. |
2626
| customCommandsEnabled | int | 0 | If set, custom commands are enabled, i.e. launching external scripts at some specific state transitions. See customCommands keyword below. |
27-
| membanksMonitorPath | string | | Path to memory banks monitor output (a local file FIFO, to be connected with o2-readout-monitor). |
27+
| membanksMonitorPath | string | | Path to memory banks monitor output (a local file FIFO, to be connected with o2-readout-monitor-memory). |
2828
| membanksMonitorRate | double | 0 | Rate (in Hertz) at which to publish memory status. |
2929

3030

doc/releaseNotes.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,9 @@ This file describes the main feature changes for each readout.exe released versi
564564
- Added protection against unhandled exceptions (e.g. from ReadoutCard).
565565
- Added protection against unexpected state machine transitions (e.g. ECS sending RESET while STARTING).
566566

567-
## next version
567+
## v2.20.0 - 12/06/2023
568568
- Added a separate thread to call bookkeeping API functions, so that data flow is not affected in case they are blocking.
569569
- o2-readout-test-lib-bookkeeping: more options.
570570
- Added o2-readout-monitor-memory: to view in real time state of data pages.
571+
- Added consistency check of orbit vs timestamp when large gas in TF ids detected.
572+
- Updated configuration parameters documentation.

src/DataBlock.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ struct DataBlockHeader {
6262
uint32_t timeframeOrbitLast; ///< from timeframe
6363
uint8_t flagEndOfTimeframe; ///< flag to signal this is the last TF block
6464
uint8_t isRdhFormat; ///< flag set when payload is RDH-formatted
65+
uint32_t orbitFirstInBlock; ///< the first orbit in this block
6566
uint32_t orbitOffset; ///< set when RDH orbits should be added given offset to match TFid
6667
uint32_t memorySize; ///< size in memory of current block
6768

@@ -70,10 +71,10 @@ struct DataBlockHeader {
7071

7172
// Version of this header
7273
// with DB marker for DataBlock start, 1st byte in header little-endian
73-
const uint32_t DataBlockVersion = 0x0004DBDB;
74+
const uint32_t DataBlockVersion = 0x0005DBDB;
7475

7576
// DataBlockHeader instance with all default fields
76-
const DataBlockHeader defaultDataBlockHeader = { .headerVersion = DataBlockVersion, .headerSize = sizeof(DataBlockHeader), .dataSize = 0, .blockId = undefinedBlockId, .pipelineId = undefinedBlockId, .timeframeId = undefinedTimeframeId, .runNumber = undefinedRunNumber, .systemId = undefinedSystemId, .feeId = undefinedFeeId, .equipmentId = undefinedEquipmentId, .linkId = undefinedLinkId, .timeframeOrbitFirst = undefinedOrbit, .timeframeOrbitLast = undefinedOrbit, .flagEndOfTimeframe = 0, .isRdhFormat = 1, .orbitOffset = undefinedOrbit, .memorySize = 0, .userSpace = { 0 } };
77+
const DataBlockHeader defaultDataBlockHeader = { .headerVersion = DataBlockVersion, .headerSize = sizeof(DataBlockHeader), .dataSize = 0, .blockId = undefinedBlockId, .pipelineId = undefinedBlockId, .timeframeId = undefinedTimeframeId, .runNumber = undefinedRunNumber, .systemId = undefinedSystemId, .feeId = undefinedFeeId, .equipmentId = undefinedEquipmentId, .linkId = undefinedLinkId, .timeframeOrbitFirst = undefinedOrbit, .timeframeOrbitLast = undefinedOrbit, .flagEndOfTimeframe = 0, .isRdhFormat = 1, .orbitFirstInBlock = undefinedOrbit, .orbitOffset = undefinedOrbit, .memorySize = 0, .userSpace = { 0 } };
7778

7879
// DataBlock
7980
// Pair of header + payload data

src/ReadoutEquipment.cxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,20 @@ Thread::CallbackResult ReadoutEquipment::threadCallback(void* arg)
487487
}
488488

489489
static InfoLogger::AutoMuteToken logTFdiscontinuityToken(LogWarningSupport_(3004), 10, 60);
490+
static InfoLogger::AutoMuteToken logTFdiscontinuityTokenError(LogErrorSupport_(3004), 10, 60);
490491

491492
ptr->statsNumberOfTimeframes++;
492493
// detect gaps in TF id continuity
493494
if (tfId != ptr->lastTimeframe + 1) {
494495
if (ptr->cfgRdhDumpWarningEnabled) {
495496
theLog.log(logTFdiscontinuityToken, "Non-contiguous timeframe IDs %llu ... %llu", (unsigned long long)ptr->lastTimeframe, (unsigned long long)tfId);
497+
// check if difference is large and orbit consistant with timestamp
498+
double now = ptr->firstTimeframeTimestamp.getTime();
499+
double dt = (nextBlock->getData()->header.orbitFirstInBlock - ptr->firstTimeframeHbOrbitBegin) * 1.0 / ptr->LHCOrbitRate; // diff in orbit / orbit rate = should be close to current timestamp
500+
uint32_t expected = ptr->firstTimeframeHbOrbitBegin + (uint32_t)(now * ptr->LHCOrbitRate);
501+
if (fabs(dt - now) > 10) {
502+
theLog.log(logTFdiscontinuityTokenError, "Orbit 0x%X seems inconsistent from expected ~0x%X (orbit rate %u, elapsed time %.1fs)", (int)nextBlock->getData()->header.orbitFirstInBlock, expected, ptr->LHCOrbitRate, now);
503+
}
496504
}
497505
}
498506
ptr->lastTimeframe = tfId;
@@ -640,6 +648,7 @@ uint64_t ReadoutEquipment::getTimeframeFromOrbit(uint32_t hbOrbit)
640648
{
641649
if (!isDefinedFirstTimeframeHbOrbitBegin) {
642650
firstTimeframeHbOrbitBegin = hbOrbit;
651+
firstTimeframeTimestamp.reset();
643652
isDefinedFirstTimeframeHbOrbitBegin = 1;
644653
bool isOk = true;
645654
gReadoutStats.mutex.lock();
@@ -730,6 +739,7 @@ int ReadoutEquipment::tagDatablockFromRdh(RdhHandle& h, DataBlockHeader& bh)
730739
}
731740
}
732741
getTimeframeOrbitRange(tfId, bh.timeframeOrbitFirst, bh.timeframeOrbitLast);
742+
bh.orbitFirstInBlock = hbOrbit;
733743
bh.timeframeOrbitFirst -= bh.orbitOffset;
734744
bh.timeframeOrbitLast -= bh.orbitOffset;
735745
// printf("TF %d eq %d link %d : orbits %X - %X\n", (int)bh.timeframeId, (int)bh.equipmentId, (int)bh.linkId, (int)bh.timeframeOrbitFirst, (int)bh.timeframeOrbitLast);

src/ReadoutEquipment.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class ReadoutEquipment
156156
unsigned long long statsNumberOfTimeframes = 0; // number of timeframes read out
157157
uint32_t firstTimeframeHbOrbitBegin = 0; // HbOrbit of beginning of first timeframe
158158
bool isDefinedFirstTimeframeHbOrbitBegin = 0;
159+
AliceO2::Common::Timer firstTimeframeTimestamp; // timestamp of first timeframe/orbit received, for consistency checks
159160

160161
AliceO2::Common::Timer timeframeClock; // timeframe id should be increased at each clock cycle
161162
uint64_t currentTimeframe = 0; // id of current timeframe

src/ReadoutEquipmentRORC.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Thread::CallbackResult ReadoutEquipmentRORC::prepareBlocks()
232232
// check CRU FIFO status - but only after first loop, otherwise would be empty yet
233233
if (!channel->areSuperpageFifosHealthy()) {
234234
static InfoLogger::AutoMuteToken logToken(LogWarningSupport_(3235), 5, 60);
235-
theLog.log(logToken, "Equipment %s: ROC memory fifo not healthy", name.c_str());
235+
theLog.log(logToken, "Equipment %s: ROC is lacking data pages", name.c_str());
236236
}
237237
}
238238
}

src/ReadoutVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#define READOUT_VERSION "2.19.1"
12+
#define READOUT_VERSION "2.20.0"
1313

0 commit comments

Comments
 (0)