Skip to content

Commit 1fda257

Browse files
authored
[QC-429] Use info from DPL to know the deployment mode (#1844)
1 parent fe67d55 commit 1fda257

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

Framework/script/o2-qc-batch-test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ fi
5454

5555
delete_data
5656

57+
export O2_DPL_DEPLOYMENT_MODE=Grid
5758
# Run the Tasks 3 times, including twice with the same file.
5859
o2-qc-run-producer --message-amount 100 --message-rate 100 | o2-qc --config json:/${JSON_DIR}/batch-test.json --local-batch /tmp/batch_test_mergedA${UNIQUE_ID}.root --run
5960
o2-qc-run-producer --message-amount 100 --message-rate 100 | o2-qc --config json:/${JSON_DIR}/batch-test.json --local-batch /tmp/batch_test_mergedA${UNIQUE_ID}.root --run

Framework/src/TaskRunner.cxx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <Framework/EndOfStreamContext.h>
3333
#include <Framework/TimingInfo.h>
3434
#include <Framework/DataTakingContext.h>
35+
#include <Framework/DefaultsHelpers.h>
3536
#include <CommonUtils/ConfigurableParam.h>
3637
#include <DetectorsBase/GRPGeomHelper.h>
3738

@@ -164,12 +165,21 @@ void TaskRunner::init(InitContext& iCtx)
164165
mObjectsManager = std::make_shared<ObjectsManager>(mTaskConfig.taskName, mTaskConfig.className, mTaskConfig.detectorName, mTaskConfig.consulUrl, mTaskConfig.parallelTaskID);
165166

166167
// setup timekeeping
167-
// fixme: use DataTakingContext.deployment once we can get it during initialization
168-
// fixme: use DataTakingContext.nOrbitsPerTF once we can get it during initialization
169-
if (mTaskConfig.fallbackActivity.mProvenance == "qc") {
170-
mTimekeeper = std::make_shared<TimekeeperSynchronous>();
171-
} else {
172-
mTimekeeper = std::make_shared<TimekeeperAsynchronous>();
168+
switch (DefaultsHelpers::deploymentMode()) {
169+
case DeploymentMode::Grid: {
170+
ILOG(Info, Devel) << "Detected async deployment, object validity will be based on incoming data and available SOR/EOR times" << ENDM;
171+
mTimekeeper = std::make_shared<TimekeeperAsynchronous>();
172+
break;
173+
}
174+
case DeploymentMode::Local:
175+
case DeploymentMode::OnlineECS:
176+
case DeploymentMode::OnlineDDS:
177+
case DeploymentMode::OnlineAUX:
178+
case DeploymentMode::FST:
179+
default: {
180+
ILOG(Info, Devel) << "Detected sync deployment, object validity will be based primarily on current time" << ENDM;
181+
mTimekeeper = std::make_shared<TimekeeperSynchronous>();
182+
}
173183
}
174184

175185
// setup user's task

0 commit comments

Comments
 (0)