Skip to content

Commit 5456372

Browse files
committed
GPU: Pass firstOrbitOfTF from DataHeader to TPC reco workflow
1 parent 6fa1c30 commit 5456372

File tree

7 files changed

+26
-4
lines changed

7 files changed

+26
-4
lines changed

Detectors/TPC/reconstruction/src/GPUCATracking.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ int GPUCATracking::runTracking(GPUO2InterfaceIOPtrs* data, GPUInterfaceOutputs*
6464
GPUTPCDigitsMCInput gpuDigitsMapMC;
6565
GPUTrackingInOutPointers ptrs;
6666

67+
ptrs.settingsTF = data->settingsTF;
6768
ptrs.tpcCompressedClusters = data->compressedClusters;
6869
ptrs.tpcZS = data->tpcZS;
6970
if (data->o2Digits) {

Detectors/TPC/workflow/src/CATrackerSpec.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
328328
const unsigned int* tpcZSmetaSizes2[GPUTrackingInOutZS::NSLICES][GPUTrackingInOutZS::NENDPOINTS];
329329
std::array<unsigned int, NEndpoints * NSectors> tpcZSonTheFlySizes;
330330
gsl::span<const ZeroSuppressedContainer8kb> inputZS;
331+
o2::gpu::GPUSettingsTF tfSettings;
331332

332333
bool getWorkflowTPCInput_clusters = false, getWorkflowTPCInput_mc = false, getWorkflowTPCInput_digits = false;
333334

@@ -577,6 +578,11 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
577578
outputRegions.clusterLabels.allocator = [&clustersMCBuffer](size_t size) -> void* { return &clustersMCBuffer; };
578579
}
579580

581+
const auto* dh = o2::header::get<o2::header::DataHeader*>(pc.inputs().getByPos(0).header);
582+
tfSettings.tfStartOrbit = dh->firstTForbit;
583+
tfSettings.hasTfStartOrbit = 1;
584+
ptrs.settingsTF = &tfSettings;
585+
580586
int retVal = tracker->runTracking(&ptrs, &outputRegions);
581587
if (processAttributes->suppressOutput) {
582588
return;

GPU/GPUTracking/DataTypes/GPUDataTypes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ struct GPUTPCMCInfo;
104104
struct GPUTPCClusterData;
105105
struct GPUTRDTrackletLabels;
106106
struct GPUTPCDigitsMCInput;
107+
struct GPUSettingsTF;
107108

108109
class GPUDataTypes
109110
{
@@ -248,6 +249,7 @@ struct GPUTrackingInOutPointers {
248249
unsigned int nTRDTrackletsMC = 0;
249250
const GPUTRDTrackGPU* trdTracks = nullptr;
250251
unsigned int nTRDTracks = 0;
252+
const GPUSettingsTF* settingsTF = nullptr;
251253
};
252254
#else
253255
struct GPUTrackingInOutPointers {

GPU/GPUTracking/DataTypes/GPUSettings.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ struct GPUSettingsGRP {
6060
int needsClusterer = 0; // Set to true if the data requires the clusterizer
6161
};
6262

63+
// Parameters of the current time frame
64+
struct GPUSettingsTF {
65+
int hasTfStartOrbit = 0;
66+
int tfStartOrbit = 0;
67+
int hasRunStartOrbit = 0;
68+
int runStartOrbit = 0;
69+
int hasSimStartOrbit = 0;
70+
int simStartOrbit = 0;
71+
};
72+
6373
// Settings defining the setup of the GPUReconstruction processing (basically selecting the device / class instance)
6474
struct GPUSettingsDeviceBackend {
6575
unsigned int deviceType = GPUDataTypes::DeviceType::CPU; // Device type, shall use GPUDataTypes::DEVICE_TYPE constants, e.g. CPU / CUDA

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ EndConfig()
218218

219219
#ifdef BeginConfig
220220
// Settings concerning the standlone timeframe from run 2 events assembly tool
221-
BeginSubConfig(GPUSettingsTF, TF, configStandalone, "TF", 't', "Timeframe settings")
221+
BeginSubConfig(GPUSettingsTFSim, TF, configStandalone, "TF", 't', "Timeframe settings")
222222
AddOption(nMerge, int, 0, "", 0, "Merge n events in a timeframe", min(0))
223223
AddOption(averageDistance, float, 50., "", 0, "Average distance in cm of events merged into timeframe", min(0.f))
224224
AddOption(randomizeDistance, bool, true, "", 0, "Randomize distance around average distance of merged events")
@@ -309,7 +309,7 @@ AddHelp("help", 'h')
309309
AddHelpAll("helpall", 'H')
310310
AddSubConfig(GPUSettingsRec, rec)
311311
AddSubConfig(GPUSettingsProcessing, proc)
312-
AddSubConfig(GPUSettingsTF, TF)
312+
AddSubConfig(GPUSettingsTFSim, TF)
313313
AddSubConfig(GPUSettingsQA, QA)
314314
AddSubConfig(GPUSettingsDisplay, GL)
315315
AddSubConfig(GPUSettingsDisplayLight, GLlight)

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ std::pair<unsigned int, unsigned int> GPUChainTracking::TPCClusterizerDecodeZSCo
9191
unsigned int nDigits = 0;
9292
unsigned int nPages = 0;
9393
bool doGPU = mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCClusterFinding;
94-
int firstHBF = o2::raw::RDHUtils::getHeartBeatOrbit(*(const RAWDataHeaderGPU*)mIOPtrs.tpcZS->slice[iSlice].zsPtr[0][0]);
94+
int firstHBF = (mIOPtrs.settingsTF && mIOPtrs.settingsTF->hasTfStartOrbit) ? mIOPtrs.settingsTF->tfStartOrbit : o2::raw::RDHUtils::getHeartBeatOrbit(*(const RAWDataHeaderGPU*)mIOPtrs.tpcZS->slice[iSlice].zsPtr[0][0]);
9595

9696
for (unsigned short j = 0; j < GPUTrackingInOutZS::NENDPOINTS; j++) {
9797
#ifndef GPUCA_NO_VC
@@ -506,7 +506,7 @@ int GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
506506
}
507507

508508
if (mIOPtrs.tpcZS) {
509-
int firstHBF = o2::raw::RDHUtils::getHeartBeatOrbit(*(const RAWDataHeaderGPU*)mIOPtrs.tpcZS->slice[iSlice].zsPtr[0][0]);
509+
int firstHBF = (mIOPtrs.settingsTF && mIOPtrs.settingsTF->hasTfStartOrbit) ? mIOPtrs.settingsTF->tfStartOrbit : o2::raw::RDHUtils::getHeartBeatOrbit(*(const RAWDataHeaderGPU*)mIOPtrs.tpcZS->slice[iSlice].zsPtr[0][0]);
510510
runKernel<GPUTPCCFDecodeZS, GPUTPCCFDecodeZS::decodeZS>(GetGridBlk(doGPU ? clusterer.mPmemory->counters.nPagesSubslice : GPUTrackingInOutZS::NENDPOINTS, lane), {iSlice}, {}, firstHBF);
511511
TransferMemoryResourceLinkToHost(RecoStep::TPCClusterFinding, clusterer.mMemoryId, lane);
512512
}

GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ struct GPUO2InterfaceIOPtrs {
125125
#endif
126126
// Output for entropy-reduced clusters of TPC compression
127127
const o2::tpc::CompressedClustersFlat* compressedClusters = nullptr;
128+
129+
// Ptr to parameters for current TF
130+
const GPUSettingsTF* settingsTF = nullptr;
128131
};
129132
} // namespace gpu
130133
} // namespace o2

0 commit comments

Comments
 (0)