Skip to content

Commit b2c192d

Browse files
committed
GPU Workflow: Move TPC CA Tracker Spec into GPU workflow
1 parent 2207e28 commit b2c192d

5 files changed

Lines changed: 35 additions & 30 deletions

File tree

Detectors/TPC/workflow/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
# granted to it by virtue of its status as an Intergovernmental Organization or
99
# submit itself to any jurisdiction.
1010

11-
12-
# FIXME: do we really need a library here ? Is the exe not enough ?
1311
o2_add_library(TPCWorkflow
1412
SOURCES src/RecoWorkflow.cxx
1513
src/ClusterReaderSpec.cxx
1614
src/PublisherSpec.cxx
1715
src/ClustererSpec.cxx
1816
src/ClusterDecoderRawSpec.cxx
19-
src/CATrackerSpec.cxx
2017
src/EntropyEncoderSpec.cxx
2118
src/EntropyDecoderSpec.cxx
2219
src/TrackReaderSpec.cxx
@@ -33,7 +30,8 @@ o2_add_library(TPCWorkflow
3330
PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsTPC
3431
O2::DPLUtils O2::TPCReconstruction
3532
O2::TPCCalibration O2::TPCSimulation
36-
O2::TPCQC O2::DetectorsCalibration)
33+
O2::TPCQC O2::DetectorsCalibration
34+
O2::GPUWorkflow)
3735

3836

3937
o2_add_executable(chunkeddigit-merger

Detectors/TPC/workflow/src/RecoWorkflow.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "TPCWorkflow/PublisherSpec.h"
2222
#include "TPCWorkflow/ClustererSpec.h"
2323
#include "TPCWorkflow/ClusterDecoderRawSpec.h"
24-
#include "TPCWorkflow/CATrackerSpec.h"
24+
#include "GPUWorkflow/GPUWorkflowSpec.h"
2525
#include "TPCWorkflow/EntropyEncoderSpec.h"
2626
#include "TPCWorkflow/ZSSpec.h"
2727
#include "Algorithm/RangeTokenizer.h"
@@ -413,7 +413,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
413413
//
414414
// selected by output type 'tracks'
415415
if (runTracker) {
416-
ca::Config cfg;
416+
o2::gpu::GPUWorkflow::Config cfg;
417417
cfg.decompressTPC = decompressTPC;
418418
cfg.decompressTPCFromROOT = decompressTPC && inputType == InputType::CompClusters;
419419
cfg.caClusterer = caClusterer;
@@ -428,7 +428,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
428428
cfg.processMC = propagateMC;
429429
cfg.sendClustersPerSector = isEnabled(OutputType::SendClustersPerSector);
430430
cfg.askDISTSTF = askDISTSTF;
431-
specs.emplace_back(o2::tpc::getCATrackerSpec(policyData, cfg, tpcSectors, tpcSectorMask));
431+
specs.emplace_back(o2::gpu::getGPURecoWorkflowSpec(policyData, cfg, tpcSectors, tpcSectorMask));
432432
}
433433

434434
//////////////////////////////////////////////////////////////////////////////////////////////

GPU/Workflow/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
# In applying this license CERN does not waive the privileges and immunities
88
# granted to it by virtue of its status as an Intergovernmental Organization or
99
# submit itself to any jurisdiction.
10-
10+
11+
o2_add_library(GPUWorkflow
12+
SOURCES src/GPUWorkflowSpec.cxx
13+
TARGETVARNAME targetName
14+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsTPC
15+
O2::DPLUtils O2::TPCReconstruction
16+
O2::TPCCalibration O2::TPCSimulation
17+
O2::TPCQC O2::DetectorsCalibration)
18+
1119
o2_add_executable(display
1220
COMPONENT_NAME gpu
1321
TARGETVARNAME targetName

Detectors/TPC/workflow/include/TPCWorkflow/CATrackerSpec.h renamed to GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
// granted to it by virtue of its status as an Intergovernmental Organization
99
// or submit itself to any jurisdiction.
1010

11-
/// @file CATrackerSpec.h
11+
/// @file GPURecoWorkflowSpec.h
1212
/// @author Matthias Richter
1313
/// @since 2018-04-18
1414
/// @brief Processor spec for running TPC CA tracking
1515

16+
#ifndef O2_GPU_WORKFLOW_SPEC_H
17+
#define O2_GPU_WORKFLOW_SPEC_H
18+
1619
#include "Framework/DataProcessorSpec.h"
17-
#include "RecoWorkflow.h"
1820
#include <utility> // std::forward
1921

2022
namespace o2
@@ -24,10 +26,9 @@ namespace framework
2426
struct CompletionPolicy;
2527
}
2628

27-
namespace tpc
29+
namespace gpu
2830
{
29-
30-
namespace ca
31+
namespace GPUWorkflow
3132
{
3233
struct Config {
3334
bool decompressTPC = false;
@@ -45,7 +46,8 @@ struct Config {
4546
bool sendClustersPerSector = false;
4647
bool askDISTSTF = true;
4748
};
48-
} // namespace ca
49+
using CompletionPolicyData = std::vector<framework::InputSpec>;
50+
} // namespace GPUWorkflow
4951

5052
/// create a processor spec for the CATracker
5153
/// The CA tracker is actually much more than the tracker it has evolved to a
@@ -63,8 +65,10 @@ struct Config {
6365
///
6466
/// @param specconfig configuration options for the processor spec
6567
/// @param tpcsectors list of sector numbers
66-
framework::DataProcessorSpec getCATrackerSpec(o2::tpc::reco_workflow::CompletionPolicyData* policyData, ca::Config const& specconfig, std::vector<int> const& tpcsectors, unsigned long tpcSectorMask);
68+
framework::DataProcessorSpec getGPURecoWorkflowSpec(GPUWorkflow::CompletionPolicyData* policyData, GPUWorkflow::Config const& specconfig, std::vector<int> const& tpcsectors, unsigned long tpcSectorMask);
6769

6870
o2::framework::CompletionPolicy getCATrackerCompletionPolicy();
69-
} // end namespace tpc
71+
} // end namespace gpu
7072
} // end namespace o2
73+
74+
#endif // O2_GPU_WORKFLOW_SPEC_H

Detectors/TPC/workflow/src/CATrackerSpec.cxx renamed to GPU/Workflow/src/GPUWorkflowSpec.cxx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// granted to it by virtue of its status as an Intergovernmental Organization
99
// or submit itself to any jurisdiction.
1010

11-
/// @file CATrackerSpec.cxx
11+
/// @file GPUWorkflowSpec.cxx
1212
/// @author Matthias Richter
1313
/// @since 2018-04-18
1414
/// @brief Processor spec for running TPC CA tracking
1515

16-
#include "TPCWorkflow/CATrackerSpec.h"
16+
#include "GPUWorkflow/GPUWorkflowSpec.h"
1717
#include "Headers/DataHeader.h"
1818
#include "Framework/WorkflowSpec.h" // o2::framework::mergeInputs
1919
#include "Framework/DataRefUtils.h"
@@ -79,14 +79,11 @@ using namespace o2::header;
7979
using namespace o2::gpu;
8080
using namespace o2::base;
8181
using namespace o2::dataformats;
82-
using namespace o2::tpc::reco_workflow;
82+
using namespace o2::tpc;
8383

84-
namespace o2
84+
namespace o2::gpu
8585
{
86-
namespace tpc
87-
{
88-
89-
DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config const& specconfig, std::vector<int> const& tpcsectors, unsigned long tpcSectorMask)
86+
DataProcessorSpec getGPURecoWorkflowSpec(GPUWorkflow::CompletionPolicyData* policyData, GPUWorkflow::Config const& specconfig, std::vector<int> const& tpcsectors, unsigned long tpcSectorMask)
9087
{
9188
if (specconfig.outputCAClusters && !specconfig.caClusterer && !specconfig.decompressTPC) {
9289
throw std::runtime_error("inconsistent configuration: cluster output is only possible if CA clusterer is activated");
@@ -157,7 +154,7 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
157154
}
158155

159156
if (config.configGRP.continuousMaxTimeBin == -1) {
160-
config.configGRP.continuousMaxTimeBin = (o2::raw::HBFUtils::Instance().getNOrbitsPerTF() * o2::constants::lhc::LHCMaxBunches + 2 * constants::LHCBCPERTIMEBIN - 2) / constants::LHCBCPERTIMEBIN;
157+
config.configGRP.continuousMaxTimeBin = (o2::raw::HBFUtils::Instance().getNOrbitsPerTF() * o2::constants::lhc::LHCMaxBunches + 2 * o2::tpc::constants::LHCBCPERTIMEBIN - 2) / o2::tpc::constants::LHCBCPERTIMEBIN;
161158
}
162159
if (config.configProcessing.deviceNum == -2) {
163160
int myId = ic.services().get<const o2::framework::DeviceSpec>().inputTimesliceId;
@@ -657,7 +654,7 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
657654
char* buffer = pc.outputs().make<char>({gDataOriginTPC, "CLUSTERNATIVE", subspec, Lifetime::Timeframe, {clusterOutputSectorHeader}}, accessIndex.nClustersSector[i] * sizeof(*accessIndex.clustersLinear) + sizeof(ClusterCountIndex)).data();
658655
ClusterCountIndex* outIndex = reinterpret_cast<ClusterCountIndex*>(buffer);
659656
memset(outIndex, 0, sizeof(*outIndex));
660-
for (int j = 0; j < constants::MAXGLOBALPADROW; j++) {
657+
for (int j = 0; j < o2::tpc::constants::MAXGLOBALPADROW; j++) {
661658
outIndex->nClusters[i][j] = accessIndex.nClusters[i][j];
662659
}
663660
memcpy(buffer + sizeof(*outIndex), accessIndex.clusters[i][0], accessIndex.nClustersSector[i] * sizeof(*accessIndex.clustersLinear));
@@ -709,7 +706,7 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
709706
auto createInputSpecs = [&tpcsectors, &specconfig, policyData]() {
710707
Inputs inputs;
711708
if (specconfig.decompressTPC) {
712-
inputs.emplace_back(InputSpec{"input", ConcreteDataTypeMatcher{gDataOriginTPC, specconfig.decompressTPCFromROOT ? header::DataDescription("COMPCLUSTERS") : header::DataDescription("COMPCLUSTERSFLAT")}, Lifetime::Timeframe});
709+
inputs.emplace_back(InputSpec{"input", ConcreteDataTypeMatcher{gDataOriginTPC, specconfig.decompressTPCFromROOT ? o2::header::DataDescription("COMPCLUSTERS") : o2::header::DataDescription("COMPCLUSTERSFLAT")}, Lifetime::Timeframe});
713710
} else if (specconfig.caClusterer) {
714711
// We accept digits and MC labels also if we run on ZS Raw data, since they are needed for MC label propagation
715712
if ((!specconfig.zsOnTheFly || specconfig.processMC) && !specconfig.zsDecoder) {
@@ -799,6 +796,4 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
799796
{createOutputSpecs()},
800797
AlgorithmSpec(initFunction)};
801798
}
802-
803-
} // namespace tpc
804-
} // namespace o2
799+
} // namespace o2::gpu

0 commit comments

Comments
 (0)