Project
Loading...
Searching...
No Matches
DefaultsHelpers.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14#include <cstdlib>
15#include <cstring>
16#include <stdexcept>
17
18namespace o2::framework
19{
20
22{
23 static bool override = getenv("DPL_DEFAULT_PIPELINE_LENGTH");
24 if (override) {
25 static unsigned int retval = atoi(getenv("DPL_DEFAULT_PIPELINE_LENGTH"));
26 return retval;
27 }
29 // just some reasonable numers
30 // The number should really be tuned at runtime for each processor.
32 return 512;
33 } else {
34 return 64;
35 }
36}
37
38static DeploymentMode getDeploymentMode_internal()
39{
40 char* explicitMode = getenv("O2_DPL_DEPLOYMENT_MODE");
41 if (explicitMode != nullptr) {
42 if (strcmp(explicitMode, "OnlineDDS") == 0) {
44 } else if (strcmp(explicitMode, "OnlineECS") == 0) {
46 } else if (strcmp(explicitMode, "OnlineAUX") == 0) {
48 } else if (strcmp(explicitMode, "Local") == 0) {
50 } else if (strcmp(explicitMode, "Grid") == 0) {
52 } else if (strcmp(explicitMode, "FST") == 0) {
54 } else {
55 throw std::runtime_error("Invalid deployment mode");
56 }
57 }
58 return getenv("DDS_SESSION_ID") != nullptr ? DeploymentMode::OnlineDDS : (getenv("OCC_CONTROL_PORT") != nullptr ? DeploymentMode::OnlineECS : (getenv("ALIEN_PROC_ID") != nullptr ? DeploymentMode::Grid : (getenv("ALICE_O2_FST") ? DeploymentMode::FST : (DeploymentMode::Local))));
59}
60
62{
63 static DeploymentMode retVal = getDeploymentMode_internal();
64 return retVal;
65}
66
68{
73 return true;
74 default:
75 return false;
76 }
77}
78
79} // namespace o2::framework
int32_t retVal
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
static DeploymentMode deploymentMode()
static unsigned int pipelineLength()
get max number of timeslices in the queue
static bool onlineDeploymentMode()
@true if running online