Skip to content

Commit 218209f

Browse files
committed
GPU: pass pointer of services to doublePipieline run function
1 parent 538bd61 commit 218209f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ class GPURecoWorkflowSpec : public o2::framework::Task
186186
template <class D, class E, class F, class G, class H, class I, class J, class K>
187187
void processInputs(o2::framework::ProcessingContext&, D&, E&, F&, G&, bool&, H&, I&, J&, K&);
188188

189-
int32_t runMain(o2::framework::ProcessingContext* pc, GPUTrackingInOutPointers* ptrs, GPUInterfaceOutputs* outputRegions, int32_t threadIndex = 0, GPUInterfaceInputUpdate* inputUpdateCallback = nullptr);
189+
int32_t runMain(o2::framework::ProcessingContext* pc, ServiceRegistryRef* services, GPUTrackingInOutPointers* ptrs, GPUInterfaceOutputs* outputRegions, int32_t threadIndex = 0, GPUInterfaceInputUpdate* inputUpdateCallback = nullptr);
190190
int32_t runITSTracking(o2::framework::ProcessingContext& pc);
191191

192192
int32_t handlePipeline(o2::framework::ProcessingContext& pc, GPUTrackingInOutPointers& ptrs, gpurecoworkflow_internals::GPURecoWorkflowSpec_TPCZSBuffers& tpcZSmeta, o2::gpu::GPUTrackingInOutZS& tpcZS, std::unique_ptr<gpurecoworkflow_internals::GPURecoWorkflow_QueueObject>& context);
193193
void RunReceiveThread();
194-
void RunWorkerThread(int32_t id);
194+
void RunWorkerThread(int32_t id, o2::framework::ServiceRegistryRef* services);
195195
void ExitPipeline();
196196
void handlePipelineEndOfStream(o2::framework::EndOfStreamContext& ec);
197197
void handlePipelineStop();

GPU/Workflow/src/GPUWorkflowPipeline.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ void GPURecoWorkflowSpec::initPipeline(o2::framework::InitContext& ic)
7070
};
7171
mPipeline->receiveThread = std::thread([this]() { RunReceiveThread(); });
7272
for (uint32_t i = 0; i < mPipeline->workers.size(); i++) {
73-
mPipeline->workers[i].thread = std::thread([this, i]() { RunWorkerThread(i); });
73+
mPipeline->workers[i].thread = std::thread([this, i]() { RunWorkerThread(i, &ic.services()); });
7474
}
7575
}
7676
}
7777

78-
void GPURecoWorkflowSpec::RunWorkerThread(int32_t id)
78+
void GPURecoWorkflowSpec::RunWorkerThread(int32_t id, o2::framework::ServiceRegistryRef* services)
7979
{
8080
LOG(debug) << "Running pipeline worker " << id;
8181
auto& workerContext = mPipeline->workers[id];
@@ -91,7 +91,7 @@ void GPURecoWorkflowSpec::RunWorkerThread(int32_t id)
9191
workerContext.inputQueue.pop();
9292
}
9393
context->jobThreadIndex = id;
94-
context->jobReturnValue = runMain(nullptr, context->jobPtrs, context->jobOutputRegions, id, context->jobInputUpdateCallback.get());
94+
context->jobReturnValue = runMain(nullptr, services, context->jobPtrs, context->jobOutputRegions, id, context->jobInputUpdateCallback.get());
9595
{
9696
std::lock_guard lk(context->jobFinishedMutex);
9797
context->jobFinished = true;

GPU/Workflow/src/GPUWorkflowSpec.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ void GPURecoWorkflowSpec::processInputs(ProcessingContext& pc, D& tpcZSmeta, E&
508508
}
509509
}
510510

511-
int32_t GPURecoWorkflowSpec::runMain(o2::framework::ProcessingContext* pc, GPUTrackingInOutPointers* ptrs, GPUInterfaceOutputs* outputRegions, int32_t threadIndex, GPUInterfaceInputUpdate* inputUpdateCallback)
511+
int32_t GPURecoWorkflowSpec::runMain(o2::framework::ProcessingContext* pc, o2::framework::ServiceRegistryRef* services, GPUTrackingInOutPointers* ptrs, GPUInterfaceOutputs* outputRegions, int32_t threadIndex, GPUInterfaceInputUpdate* inputUpdateCallback)
512512
{
513513
int32_t retVal = 0;
514514
if (mConfParam->dump < 2) {
@@ -520,8 +520,8 @@ int32_t GPURecoWorkflowSpec::runMain(o2::framework::ProcessingContext* pc, GPUTr
520520
static bool first = true;
521521
if (first) {
522522
first = false;
523-
if (pc->services().get<const o2::framework::DeviceSpec>().inputTimesliceId == 0) { // TPC ConfigurableCarams are somewhat special, need to construct by hand
524-
o2::conf::ConfigurableParam::write(o2::base::NameConf::getConfigOutputFileName(pc->services().get<const o2::framework::DeviceSpec>().name, "rec_tpc"), "GPU_rec_tpc,GPU_rec,GPU_proc_param,GPU_proc,GPU_global,trackTuneParams");
523+
if (services()->get<const o2::framework::DeviceSpec>().inputTimesliceId == 0) { // TPC ConfigurableCarams are somewhat special, need to construct by hand
524+
o2::conf::ConfigurableParam::write(o2::base::NameConf::getConfigOutputFileName(services()->get<const o2::framework::DeviceSpec>().name, "rec_tpc"), "GPU_rec_tpc,GPU_rec,GPU_proc_param,GPU_proc,GPU_global,trackTuneParams");
525525
}
526526
}
527527
}
@@ -843,7 +843,7 @@ void GPURecoWorkflowSpec::run(ProcessingContext& pc)
843843
mNextThreadIndex = (mNextThreadIndex + 1) % 2;
844844
}
845845

846-
retVal = runMain(&pc, &ptrs, &outputRegions, threadIndex);
846+
retVal = runMain(&pc, nullptr, &ptrs, &outputRegions, threadIndex);
847847
}
848848
if (retVal != 0) {
849849
debugTFDump = true;

0 commit comments

Comments
 (0)