Skip to content

Commit 2f95918

Browse files
chiarazampollishahor02
authored andcommitted
Aggregator
changes to aggregator Fix logic in case of multiple slots Fix in OutputSpec Tool to run EPN + aggregator simulation Remove aggregator since raw-proxy can be used forgotten from the CMakeLists clang-format more info
1 parent 9cda763 commit 2f95918

5 files changed

Lines changed: 66 additions & 2 deletions

File tree

Detectors/Calibration/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@ o2_add_executable(ccdb-populator-workflow
4141
O2::DetectorsCalibration
4242
O2::DataFormatsTOF
4343
O2::CCDB)
44-
4544
add_subdirectory(workflow)
4645
add_subdirectory(testMacros)

Detectors/Calibration/testMacros/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ install(FILES populateCCDB.C
1515
install(FILES cdbSizeV0.txt
1616
DESTINATION share/Detectors/Calibration/data)
1717

18+
install(FILES runEPNsimulation.sh
19+
DESTINATION share/Detectors/Calibration/scripts)
20+
1821
o2_add_test_root_macro(populateCCDB.C
1922
PUBLIC_LINK_LIBRARIES O2::CCDB
2023
O2::Framework)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!-- doxy
2+
\page refDetectorsCalibration/testMacros Module 'Detectors/Calibration/testMacros'
3+
/doxy -->
4+
5+
# Simulation of sending of calibration data from EPNs to an aggregator
6+
7+
To be used when calibrations produced by several EPNs have to be sent to a single node, the aggregator.
8+
On the aggregator, the devices producing calibration will run and send the output to the CCDB.
9+
10+
* In order to populate the CCDB, the CCDB local server should be started, if the exercise is not meant to
11+
upload the official or test CCDB. In a terminal, run:
12+
```cpp
13+
java -jar local.jar
14+
```
15+
which will start a CCDB server on port 8080. See [instructions](https://github.com/AliceO2Group/AliceO2/tree/dev/CCDB#central-and-local-instances-of-the-ccdb).
16+
17+
* To run the calibration and aggregator, open a terminal and start the aggregator, which is just the `o2-dpl-raw-proxy`:
18+
```cpp
19+
o2-dpl-raw-proxy --dataspec A:TOF/CALIBDATA/0 --channel-config "name=readout-proxy,type=pull,method=bind,address=tcp://localhost:30453,rateLogging=1,transport=zeromq"
20+
```
21+
where, as you can see, you can overwrite the configurations of the `readout-proxy` channel, which is the channel used by the aggregator.
22+
The aggregator should be started **before the other devices**, since it will listen for data (it is the channel that is *binding*).
23+
24+
* The following example will pass the data arriving to the aggregator to the `o2-calibration-lhc-clockphase-workflow` device, and from there
25+
to the `o2-calibration-ccdb-populator-workflow` to update the CCDB.
26+
In another terminal, run:
27+
```cpp
28+
source runEPNsimulation.sh 3
29+
```
30+
31+
where the argument (`3` above) is the number of EPNs to be simulated. This will send the data to the aggregator process.
32+
33+
**N.B.**: the aggregator and calibration devices will need to use a different port from localHost:8080 in case the local
34+
CCDB server is used in its default configuration, since 8080 is used by CCDB. In the example above, port 30453 is used.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
iEPN=0
4+
xpos_start=100
5+
while [[ $iEPN -lt $1 ]]
6+
do
7+
echo $iEPN
8+
xpos=$((xpos_start+1000*$iEPN))
9+
xterm -hold -geometry 150x41+$xpos+300 -e bash -c "o2-calibration-data-generator-workflow --lanes 7 --gen-slot $iEPN --gen-norm 3 --mean-latency 100000 --max-timeframes 500 -b | o2-dpl-output-proxy --channel-config "name=downstream,method=connect,address=tcp://localhost:30453,type=push,transport=zeromq" --dataspec downstream:TOF/CALIBDATA -b ; exec bash" &
10+
((iEPN = iEPN +1 ))
11+
done

Detectors/TOF/calibration/testWorkflow/DataGeneratorSpec.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ class TFDispatcher : public o2::framework::Task
4949
LOG(INFO) << "Data generator reached TF " << tfid << ", stopping";
5050
pc.services().get<o2::framework::ControlService>().endOfStream();
5151
pc.services().get<o2::framework::ControlService>().readyToQuit(o2::framework::QuitRequest::Me);
52+
if (!acceptTF(tfid)) {
53+
return;
54+
}
5255
break;
5356
}
54-
if (((tfid / mNLanes) % mNGen) != mSlot) {
57+
if (!acceptTF(tfid)) {
5558
return;
5659
}
5760
}
@@ -60,6 +63,20 @@ class TFDispatcher : public o2::framework::Task
6063
pc.outputs().snapshot(o2::framework::OutputRef{"output", 0}, size);
6164
}
6265

66+
bool acceptTF(int tfid)
67+
{
68+
69+
// check if the current TF should be processed by this instance of the generator
70+
71+
int targetSlot = (tfid / mNLanes) % mNGen;
72+
if (targetSlot != mSlot) {
73+
LOG(INFO) << "tfid = " << tfid << ", mNLanes = " << mNLanes << ", mNGen = " << mNGen << ", mSlot = " << mSlot << " target slot = " << targetSlot << ": discarded";
74+
return false;
75+
}
76+
LOG(INFO) << "tfid = " << tfid << ", mNLanes = " << mNLanes << ", mNGen = " << mNGen << ", mSlot = " << mSlot << " target slot = " << targetSlot << ": accepted";
77+
return true;
78+
}
79+
6380
private:
6481
uint64_t mMaxTF = 1;
6582
int mSlot = 1;

0 commit comments

Comments
 (0)