Skip to content

Commit 880eb96

Browse files
authored
Merge pull request #222 from sy-c/master
v2.10.4
2 parents 178de47 + d524c04 commit 880eb96

File tree

7 files changed

+46
-18
lines changed

7 files changed

+46
-18
lines changed

doc/memory.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,20 @@ Considerations to make good use of the FLP memory and tune the corresponding Rea
4444
* the good way to evaluate this parameter is too look at readout logs and see what is the maximum actual size used for this buffer after some reference runs, and add some 50% margin. The current parameters have been set based on initial detector tests, and can be reevaluated any time with the same method.
4545

4646
The readout memory parameters are not critical in most conditions. Tuning them may help to handle high peak loads (e.g. in case of bursts in rates) or handle startup setup time for the processing system to reach a stable state. It will however not solve issues where the output system can not cope with the input rate or when it degrades over time, it will just delay the appearance of the symptoms.
47+
48+
49+
## How much memory is needed by Readout ?
50+
51+
The following is the minimum amount of buffer needed to run Readout, in number of pages: `128 * (number of enabled links) + readout.aggregatorStfTimeout * (page rate)`
52+
53+
* Each end-point needs at least 128 pages per enabled link. This is the size of the FIFO providing empty data pages to ROC device, and it should be filled to guarantee uninterrupted DMA. Readout logs can be checked for runtime statistics about the effective page rate observed (see 'blockRate' metric).
54+
* The readout.aggregatorStfTimeout configuration parameter defines the amount of time the ready pages are waiting in the readout aggregator before the corresponding TF to be processed. This allows some delay to receive data from all the different equipments / links (the links contributing to a TF are not known, so readout must wait before assuming all data are there). A corresponding amount of buffer must be reserved, according to the superpage rate observed at runtime.
55+
* 20% extra is needed for the 'overlapping HBF data' copy.
56+
* DD can buffer up to 32GB before stfSender goes to "discard mode" and release memory, when data input exceeds FLP output.
57+
* Additionnal processing pipelines in the FMQ chain must be accounted for: up to 10GB can be pending in DPL before reaching stfSender, and are not counted in the DD 32GB.
58+
59+
The grand-total for the shared memory block is therefore typically: `((128 * (number of enabled links) * pageSize + readout.aggregatorStfTimeout * throughput) * 1.2 + 42 GB)`
60+
61+
Which makes, for a FLP with 3 CRUs, 12 links per end-point, 5GB/s data throughput, 0.5s aggregator STF timeout, .25M page size and 30% safety margin:
62+
( (128 * 3 * 2 * 12 * 0.25 + 0.5 * 5000 ) * 1.2 + 42000 ) * 1.3 = 62 GB
63+

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,3 +457,6 @@ This file describes the main feature changes for each readout.exe released versi
457457

458458
## v2.10.3 - 05/05/2022
459459
- Bug fixed in the readout TF rate regulator (was ineffective after 35 minutes = 2^31 microseconds - wrong variable width in a conversion).
460+
461+
## v2.10.4 - 18/05/2022
462+
- Changed level of "Bypassing RORC firmware compatibility check", retrograded from support warning to developper info.

src/MemoryPagesPool.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,5 +321,5 @@ int MemoryPagesPool::getId() {
321321
void MemoryPagesPool::setBufferStateVariable(std::atomic<double> *bufferStateVar) {
322322
pBufferState=bufferStateVar;
323323
updateBufferState();
324-
printf("buffer usage = %lf @ 0x%p\n", pBufferState->load(),pBufferState);
324+
//printf("buffer usage = %lf @ 0x%p\n", pBufferState->load(),pBufferState);
325325
}

src/ReadoutEquipmentRORC.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ReadoutEquipmentRORC::ReadoutEquipmentRORC(ConfigFile& cfg, std::string name) :
102102
// configuration parameter: | equipment-rorc-* | firmwareCheckEnabled | int | 1 | If set, RORC driver checks compatibility with detected firmware. Use 0 to bypass this check (eg new fw version not yet recognized by ReadoutCard version). |
103103
cfg.getOptionalValue<int>(name + ".firmwareCheckEnabled", cfgFirmwareCheckEnabled);
104104
if (!cfgFirmwareCheckEnabled) {
105-
theLog.log(LogWarningSupport_(3002), "Bypassing RORC firmware compatibility check");
105+
theLog.log(LogInfoDevel_(3002), "Bypassing RORC firmware compatibility check");
106106
}
107107

108108
// configuration parameter: | equipment-rorc-* | debugStatsEnabled | int | 0 | If set, enable extra statistics about internal buffers status. (printed to stdout when stopping) |

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.10.3"
12+
#define READOUT_VERSION "2.10.4"
1313

src/mainReadout.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,7 @@ void Readout::executeCustomCommand(const char *stateChange) {
14751475
theLog.log(LogInfoDevel_(3013), "Executing custom command for %s : %s", it->first.c_str(), it->second.c_str());
14761476
std::string cmd = it->second + "\n";
14771477
write(customCommandsShellFdIn, cmd.c_str(), cmd.length());
1478+
fsync(customCommandsShellFdIn);
14781479
LineBuffer b;
14791480
const int cmdTimeout = 10000; // 10s timeout
14801481
b.appendFromFileDescriptor(customCommandsShellFdOut, cmdTimeout);

src/readoutStatus.tcl

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -434,21 +434,28 @@ if {1} {
434434
proc NumberOfBytesToString {value suffix} {
435435
set prefixes { " " "k" "M" "G" "T" "P" }
436436
set maxPrefixIndex [llength $prefixes]
437-
set prefixIndex [expr int(floor(log($value) / log(1024)))]
438-
if {$prefixIndex > $maxPrefixIndex} {
439-
set prefixIndex $maxPrefixIndex
440-
}
441-
if {$prefixIndex < 0} {
442-
set prefixIndex 0
443-
}
444-
set scaledValue [expr $value / pow(1024, $prefixIndex)]
445-
set l [expr int(floor(log10(abs($scaledValue))))]
446-
if {$l < 0} {
447-
set l 3
448-
} elseif {$l <= 3} {
449-
set l [expr 3 - $l]
450-
} else {
451-
set l 0
437+
set prefixIndex 0
438+
set l 0
439+
set scaledValue $value
440+
catch {
441+
if {$value > 0} {
442+
set prefixIndex [expr int(floor(log($value) / log(1024)))]
443+
if {$prefixIndex > $maxPrefixIndex} {
444+
set prefixIndex $maxPrefixIndex
445+
}
446+
if {$prefixIndex < 0} {
447+
set prefixIndex 0
448+
}
449+
set scaledValue [expr $value / pow(1024, $prefixIndex)]
450+
set l [expr int(floor(log10(abs($scaledValue))))]
451+
if {$l < 0} {
452+
set l 3
453+
} elseif {$l <= 3} {
454+
set l [expr 3 - $l]
455+
} else {
456+
set l 0
457+
}
458+
}
452459
}
453460
return [format "%.*f %s%s" $l $scaledValue [lindex $prefixes $prefixIndex] $suffix];
454461
}

0 commit comments

Comments
 (0)