Skip to content

Commit ebbb4dd

Browse files
committed
added checkIncomplete option
1 parent 1444787 commit ebbb4dd

File tree

4 files changed

+33
-17
lines changed

4 files changed

+33
-17
lines changed

doc/configurationParameters.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ The parameters related to 3rd-party libraries are described here for convenience
5454
| consumer-* | numaNode | int | -1 | If set (>=0), memory / thread will try to use given NUMA node. |
5555
| consumer-* | stopOnError | int | 0 | If 1, readout will stop automatically on consumer error. |
5656
| consumer-data-sampling-* | address | string | ipc:///tmp/readout-pipe-1 | Address of the data sampling. |
57+
| consumer-FairMQChannel-* | checkIncomplete | int | 0 | If set, readout checks for the completeness of HBF and issues warnings. Set automatically when dropIncomplete=1. |
5758
| consumer-FairMQChannel-* | checkResources | string | | Check beforehand if unmanaged region would fit in given list of resources. Comma-separated list of items to be checked: eg /dev/shm, MemFree, MemAvailable. (any filesystem path, and any /proc/meminfo entry).|
5859
| consumer-FairMQChannel-* | disableSending | int | 0 | If set, no data is output to FMQ channel. Used for performance test to create FMQ shared memory segment without pushing the data. |
5960
| consumer-FairMQChannel-* | dropIncomplete | int | 0 | If set, TF with incomplete HBF (i.e. HBF having missing packets) are discarded. |

doc/releaseNotes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,3 +544,7 @@ This file describes the main feature changes for each readout.exe released versi
544544
## v2.18.1 - 23/03/2023
545545
- Optimized EOR sequence in case FMQ stuck, as per timeout readout.flushConsumerTimeout definition. Pending data are discarded.
546546
- Moved FMQ repack stats logs at STOP instead of RESET.
547+
548+
## v2.18.2 - 29/03/2023
549+
- Updated configuration parameters:
550+
- added consumer-FairMQchannel.checkIncomplete: when set, TF with incomplete HBF are detected and warnings issued. Off by default (in particular, check is currently not valid for DDL detector). In previous v2.18 versions, this check was enabled by default.

src/ConsumerFMQchannel.cxx

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ class ConsumerFMQchannel : public Consumer
157157
bool enableStfSuperpage = false; // optimized stf transport: minimize STF packets
158158
bool enableRawFormatDatablock = false;
159159
int enablePackedCopy = 1; // default mode for repacking of page overlapping HBF. 0 = one page per copy, 1 = change page on TF only
160+
int checkIncomplete = 0; // TF are checked to detect missing packets
160161
int dropIncomplete = 0; // TF with missing packets are discarded
161162

162163
std::shared_ptr<MemoryBank> memBank; // a dedicated memory bank allocated by FMQ mechanism
@@ -248,10 +249,16 @@ class ConsumerFMQchannel : public Consumer
248249
gReadoutStats.isFairMQ = 1; // enable FMQ stats
249250
}
250251

252+
// configuration parameter: | consumer-FairMQChannel-* | checkIncomplete | int | 0 | If set, readout checks for the completeness of HBF and issues warnings. Set automatically when dropIncomplete=1. |
253+
cfg.getOptionalValue<int>(cfgEntryPoint + ".checkIncomplete", checkIncomplete, checkIncomplete);
254+
251255
// configuration parameter: | consumer-FairMQChannel-* | dropIncomplete | int | 0 | If set, TF with incomplete HBF (i.e. HBF having missing packets) are discarded. |
252256
cfg.getOptionalValue<int>(cfgEntryPoint + ".dropIncomplete", dropIncomplete, dropIncomplete);
253257
if (dropIncomplete) {
258+
checkIncomplete = 1;
254259
theLog.log(LogInfoDevel_(3002), "TF with incomplete HBF will be discarded");
260+
} else if (checkIncomplete) {
261+
theLog.log(LogInfoDevel_(3002), "TF with incomplete HBF will be checked");
255262
}
256263

257264
// configuration parameter: | consumer-FairMQChannel-* | enableRawFormat | int | 0 | If 0, data is pushed 1 STF header + 1 part per HBF. If 1, data is pushed in raw format without STF headers, 1 FMQ message per data page. If 2, format is 1 STF header + 1 part per data page.|
@@ -847,6 +854,7 @@ int ConsumerFMQchannel::DDformatMessage(DataSetReference &bc, DDMessage &ddm) {
847854
HBFerr += " (" + std::to_string(++HBFerrid) + ") ";
848855
};
849856
auto checkLastHB = [&] () {
857+
if (!checkIncomplete) return;
850858
if (HBFisFirst) {
851859
return; // no HBF seen so far
852860
}
@@ -935,25 +943,27 @@ int ConsumerFMQchannel::DDformatMessage(DataSetReference &bc, DDMessage &ddm) {
935943
// printf("block %p : offset %d = %p\n",b,offset,rdh);
936944
}
937945

938-
uint16_t HBFpagescounterNew = (uint16_t)rdh->pagesCounter;
939-
if (HBFisFirst) {
940-
HBFpagescounterFirst = HBFpagescounterNew;
941-
HBFisFirst = 0;
942-
if (HBFpagescounterFirst != 0) {
943-
HBFincrerr();
944-
HBFerr += "first pagesCounter not zero: " + std::to_string((int)HBFpagescounterFirst);
945-
}
946-
} else {
947-
if (HBFpagescounterNew != HBFpagescounterLast + 1) {
948-
HBFincrerr();
949-
HBFerr += "pagesCounter jump from " + std::to_string((int)HBFpagescounterLast)+ " to " + std::to_string( (int)HBFpagescounterNew);
950-
HBFisOk = 0;
946+
if (checkIncomplete) {
947+
uint16_t HBFpagescounterNew = (uint16_t)rdh->pagesCounter;
948+
if (HBFisFirst) {
949+
HBFpagescounterFirst = HBFpagescounterNew;
950+
HBFisFirst = 0;
951+
if (HBFpagescounterFirst != 0) {
952+
HBFincrerr();
953+
HBFerr += "first pagesCounter not zero: " + std::to_string((int)HBFpagescounterFirst);
954+
}
955+
} else {
956+
if (HBFpagescounterNew != HBFpagescounterLast + 1) {
957+
HBFincrerr();
958+
HBFerr += "pagesCounter jump from " + std::to_string((int)HBFpagescounterLast)+ " to " + std::to_string( (int)HBFpagescounterNew);
959+
HBFisOk = 0;
960+
}
951961
}
962+
HBFpagescounter++;
963+
HBFpagescounterLast = HBFpagescounterNew;
964+
HBFstop += rdh->stopBit;
965+
HBFstopLast = rdh->stopBit;
952966
}
953-
HBFpagescounter++;
954-
HBFpagescounterLast = HBFpagescounterNew;
955-
HBFstop += rdh->stopBit;
956-
HBFstopLast = rdh->stopBit;
957967

958968
uint16_t offsetNextPacket = rdh->offsetNextPacket;
959969
if (offsetNextPacket == 0) {

src/readoutConfigEditor.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ set configurationParametersDescriptor {
3030
| consumer-* | numaNode | int | -1 | If set (>=0), memory / thread will try to use given NUMA node. |
3131
| consumer-* | stopOnError | int | 0 | If 1, readout will stop automatically on consumer error. |
3232
| consumer-data-sampling-* | address | string | ipc:///tmp/readout-pipe-1 | Address of the data sampling. |
33+
| consumer-FairMQChannel-* | checkIncomplete | int | 0 | If set, readout checks for the completeness of HBF and issues warnings. Set automatically when dropIncomplete=1. |
3334
| consumer-FairMQChannel-* | checkResources | string | | Check beforehand if unmanaged region would fit in given list of resources. Comma-separated list of items to be checked: eg /dev/shm, MemFree, MemAvailable. (any filesystem path, and any /proc/meminfo entry).|
3435
| consumer-FairMQChannel-* | disableSending | int | 0 | If set, no data is output to FMQ channel. Used for performance test to create FMQ shared memory segment without pushing the data. |
3536
| consumer-FairMQChannel-* | dropIncomplete | int | 0 | If set, TF with incomplete HBF (i.e. HBF having missing packets) are discarded. |

0 commit comments

Comments
 (0)