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
60
62 std::mutex mutexDecodeInput;
63
65
66 volatile fair::mq::State fmqState = fair::mq::State::Undefined, fmqPreviousState = fair::mq::State::Undefined;
67 volatile bool endOfStreamAsyncReceived = false;
68 volatile bool endOfStreamDplReceived = false;
69 volatile bool runStarted = false;
70 volatile bool shouldTerminate = false;
71 std::mutex stateMutex;
72 std::condition_variable stateNotify;
73
74 std::thread receiveThread;
75
77 std::thread thread;
78 std::queue<GPURecoWorkflow_QueueObject*> inputQueue;
79 std::mutex inputQueueMutex;
80 std::condition_variable inputQueueNotify;
81 };
82 std::array<pipelineWorkerStruct, 2> workers;
83
84 std::queue<std::unique_ptr<GPURecoWorkflow_QueueObject>> pipelineQueue;
85 std::mutex queueMutex;
86 std::condition_variable queueNotify;
87
88 std::queue<o2::framework::DataProcessingHeader::StartTime> completionPolicyQueue;
89 volatile bool pipelineSenderTerminating = false;
91 std::condition_variable completionPolicyNotify;
92
93 uint64_t mNTFReceived = 0;
94
95 volatile bool mayInject = true;
96 volatile uint64_t mayInjectTFId = 0;
97 std::mutex mayInjectMutex;
98 std::condition_variable mayInjectCondition;
99};
100
101} // namespace gpurecoworkflow_internals
102} // namespace o2::gpu
103
104#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