Project
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
k
l
m
o
p
q
r
s
t
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
z
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Symbols
a
b
c
f
g
m
o
q
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
a
b
c
d
k
m
n
s
v
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
test_CompletionPolicies.cxx
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
12
#include "
Framework/CompletionPolicy.h
"
13
#include "
Framework/CompletionPolicyHelpers.h
"
14
#include "
Framework/DeviceSpec.h
"
15
16
#include <cassert>
17
#include <chrono>
18
#include <thread>
19
#include <vector>
20
21
using namespace
o2::framework
;
22
23
void
customize
(std::vector<CompletionPolicy>& policies)
24
{
25
std::vector<CompletionPolicy>
result
{
26
CompletionPolicyHelpers::defineByName
(
"discard"
, CompletionPolicy::CompletionOp::Discard),
27
CompletionPolicyHelpers::defineByName
(
"process"
, CompletionPolicy::CompletionOp::Process),
28
CompletionPolicyHelpers::defineByName
(
"wait"
, CompletionPolicy::CompletionOp::Wait),
29
CompletionPolicyHelpers::defineByName
(
"consume"
, CompletionPolicy::CompletionOp::Consume)};
30
policies.swap(
result
);
31
}
23
void
customize
(std::vector<CompletionPolicy>& policies) {
…
}
32
33
#include "
Framework/runDataProcessing.h
"
34
#include "
Framework/DataProcessorSpec.h
"
35
#include "
Framework/Logger.h
"
36
#include "
Framework/ParallelContext.h
"
37
#include "
Framework/ControlService.h
"
38
#include <vector>
39
40
// This is a simple consumer / producer workflow where both are
41
// stateful, i.e. they have context which comes from their initialization.
42
WorkflowSpec
defineDataProcessing
(
ConfigContext
const
& config)
43
{
44
return
WorkflowSpec
{
45
DataProcessorSpec
{
46
"hearthbeat"
,
47
{},
48
{
OutputSpec
{{
"out1"
},
"TST"
,
"TST"
, 0},
49
OutputSpec
{{
"out2"
},
"TST"
,
"TST"
, 1}},
50
AlgorithmSpec
{
51
[](
ProcessingContext
& ctx) {
52
// We deliberately make only out1 to test that
53
// the policies for the following dataprocessors are
54
// actually respected.
55
ctx.outputs().make<
int
>(
OutputRef
{
"out1"
}, 1);
56
std::this_thread::sleep_for(std::chrono::seconds(1));
57
}}},
58
DataProcessorSpec
{
59
"discard"
,
60
{
61
InputSpec
{
"in1"
,
"TST"
,
"TST"
, 0},
62
InputSpec
{
"in2"
,
"TST"
,
"TST"
, 1},
63
},
64
{},
65
AlgorithmSpec
{
66
[](
ProcessingContext
& ctx) {
67
LOG
(error) <<
"Should have not been invoked"
;
68
// We deliberately make only out1 to test that
69
// the policies for the following dataprocessors are
70
// actually respected.
71
}}},
72
DataProcessorSpec
{
73
"does-use"
,
74
{
InputSpec
{
"in1"
,
"TST"
,
"TST"
, 0}},
75
{},
76
AlgorithmSpec
{
77
[](
ProcessingContext
& ctx) {
78
// Since this shares a dependency with "discard",
79
// it should be forwarded the messages as soon as the former
80
// discards them.
81
}}},
82
};
83
}
42
WorkflowSpec
defineDataProcessing
(
ConfigContext
const
& config) {
…
}
CompletionPolicyHelpers.h
CompletionPolicy.h
ControlService.h
DataProcessorSpec.h
DeviceSpec.h
Logger.h
ParallelContext.h
o2::framework::ConfigContext
Definition
ConfigContext.h:24
o2::framework::ProcessingContext
Definition
ProcessingContext.h:27
result
GLuint64EXT * result
Definition
glcorearb.h:5662
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
runDataProcessing.h
o2::framework::AlgorithmSpec
Definition
AlgorithmSpec.h:43
o2::framework::CompletionPolicyHelpers::defineByName
static CompletionPolicy defineByName(std::string const &name, CompletionPolicy::CompletionOp op)
Definition
CompletionPolicyHelpers.cxx:79
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
o2::framework::InputSpec
Definition
InputSpec.h:31
o2::framework::OutputRef
Definition
OutputRef.h:29
o2::framework::OutputSpec
Definition
OutputSpec.h:33
customize
void customize(std::vector< CompletionPolicy > &policies)
Definition
test_CompletionPolicies.cxx:23
defineDataProcessing
WorkflowSpec defineDataProcessing(ConfigContext const &config)
This function hooks up the the workflow specifications into the DPL driver.
Definition
test_CompletionPolicies.cxx:42
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
Framework
TestWorkflows
src
test_CompletionPolicies.cxx
Generated on Thu Apr 17 2025 09:01:15 for Project by
1.9.8