Project
Loading...
Searching...
No Matches
GPUWorkflowInternal.h
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
15#ifndef O2_GPU_GPUWORKFLOWINTERNAL_H
16#define O2_GPU_GPUWORKFLOWINTERNAL_H
17
18#include "GPUDataTypes.h"
19#include <mutex>
20#include <thread>
21#include <condition_variable>
22#include <queue>
23#include <array>
24#include <fairmq/States.h>
25
26namespace o2::gpu
27{
28namespace gpurecoworkflow_internals
29{
30
37
59
61 std::mutex mutexDecodeInput;
62
64
65 volatile fair::mq::State fmqState = fair::mq::State::Undefined, fmqPreviousState = fair::mq::State::Undefined;
66 volatile bool endOfStreamAsyncReceived = false;
67 volatile bool endOfStreamDplReceived = false;
68 volatile bool runStarted = false;
69 volatile bool shouldTerminate = false;
70 std::mutex stateMutex;
71 std::condition_variable stateNotify;
72
73 std::thread receiveThread;
74
76 std::thread thread;
77 std::queue<GPURecoWorkflow_QueueObject*> inputQueue;
78 std::mutex inputQueueMutex;
79 std::condition_variable inputQueueNotify;
80 };
81 std::array<pipelineWorkerStruct, 2> workers;
82
83 std::queue<std::unique_ptr<GPURecoWorkflow_QueueObject>> pipelineQueue;
84 std::mutex queueMutex;
85 std::condition_variable queueNotify;
86
87 std::queue<o2::framework::DataProcessingHeader::StartTime> completionPolicyQueue;
88 volatile bool pipelineSenderTerminating = false;
90 std::condition_variable completionPolicyNotify;
91
92 uint64_t mNTFReceived = 0;
93
94 volatile bool mayInject = true;
95 volatile uint64_t mayInjectTFId = 0;
96 std::mutex mayInjectMutex;
97 std::condition_variable mayInjectCondition;
98};
99
100} // namespace gpurecoworkflow_internals
101} // namespace o2::gpu
102
103#endif
static constexpr uint32_t NSECTORS
static constexpr uint32_t NENDPOINTS
std::queue< o2::framework::DataProcessingHeader::StartTime > completionPolicyQueue
std::queue< std::unique_ptr< GPURecoWorkflow_QueueObject > > pipelineQueue
std::vector< const void * > Pointers[GPUTrackingInOutZS::NSECTORS][GPUTrackingInOutZS::NENDPOINTS]
const uint32_t * Sizes2[GPUTrackingInOutZS::NSECTORS][GPUTrackingInOutZS::NENDPOINTS]
const void ** Pointers2[GPUTrackingInOutZS::NSECTORS][GPUTrackingInOutZS::NENDPOINTS]
std::vector< uint32_t > Sizes[GPUTrackingInOutZS::NSECTORS][GPUTrackingInOutZS::NENDPOINTS]
std::unique_ptr< GPUInterfaceInputUpdate > jobInputUpdateCallback
o2::framework::DataProcessingHeader::StartTime timeSliceId