Project
Loading...
Searching...
No Matches
o2::framework::CompletionPolicy Struct Reference

#include <CompletionPolicy.h>

Public Types

enum struct  CompletionOp {
  Consume , Process , Wait , Discard ,
  ConsumeExisting , ConsumeAndRescan , Retry
}
 Action to take with the InputRecord: More...
 
enum struct  CompletionOrder { Any , Timeslice , Slot }
 Order in which the completed slots must be consumed. More...
 
using Matcher = std::function< bool(DeviceSpec const &device)>
 
using InputSetElement = DataRef
 
using CallbackFull = std::function< CompletionOp(InputSpan const &, std::vector< InputSpec > const &, ServiceRegistryRef &)>
 
using CallbackConfigureRelayer = std::function< void(DataRelayer &)>
 

Public Member Functions

 CompletionPolicy ()
 Constructor.
 
 CompletionPolicy (std::string _name, Matcher _matcher, CallbackFull _callback, bool _balanceChannels=true)
 Constructor for emplace_back.
 

Static Public Member Functions

static std::vector< CompletionPolicycreateDefaultPolicies ()
 Helper to create the default configuration.
 

Public Attributes

std::string name = ""
 Name of the policy itself.
 
Matcher matcher = nullptr
 
CallbackFull callbackFull = nullptr
 Actual policy which decides what to do with a partial InputRecord, extended version.
 
CallbackConfigureRelayer configureRelayer = nullptr
 
bool balanceChannels = true
 
CompletionOrder order = CompletionOrder::Any
 

Detailed Description

Policy to describe what to do for a matching DeviceSpec whenever a new message arrives. The InputRecord being passed to Callback is the partial input record received that far.

Definition at line 34 of file CompletionPolicy.h.

Member Typedef Documentation

◆ CallbackConfigureRelayer

◆ CallbackFull

Definition at line 74 of file CompletionPolicy.h.

◆ InputSetElement

◆ Matcher

using o2::framework::CompletionPolicy::Matcher = std::function<bool(DeviceSpec const& device)>

Definition at line 72 of file CompletionPolicy.h.

Member Enumeration Documentation

◆ CompletionOp

Action to take with the InputRecord:

Enumerator
Consume 

Run the ProcessCallback on the InputRecord, consuming its contents. Messages which have to be forwarded downstream will be forwarded.

Process 

Process: run the ProcessCallback on the InputRecord. Its contents / will be kept but they will not be forwarded downstream.

Wait 

Do not run the ProcessCallback. Its contents will be kept and they will be proposed again when a new message for the same record arrives. They will not be forwarded downstream.

Discard 

Do not run the ProcessCallback. Contents of the record will be forwarded to the next consumer, if any.

ConsumeExisting 

ConsumeExisting: run the ProcessCallback on the InputRecord. After we are done, the processed payloads will be deallocated (but not the headers) while we wait for the record to be actually fully Consumed.

ConsumeAndRescan 

ConsumeAndRescan: run the ProcessCallback on the InputRecord. Messages which have to be forwarded downstream will be forwarded. Invalidate the TimesliceIndex so that all the entries are checked again.

Retry 

Like Wait but mark the cacheline as dirty.

Definition at line 36 of file CompletionPolicy.h.

◆ CompletionOrder

Order in which the completed slots must be consumed.

Enumerator
Any 
Timeslice 
Slot 

Definition at line 66 of file CompletionPolicy.h.

Constructor & Destructor Documentation

◆ CompletionPolicy() [1/2]

o2::framework::CompletionPolicy::CompletionPolicy ( )
inline

Constructor.

Definition at line 78 of file CompletionPolicy.h.

◆ CompletionPolicy() [2/2]

o2::framework::CompletionPolicy::CompletionPolicy ( std::string  _name,
Matcher  _matcher,
CallbackFull  _callback,
bool  _balanceChannels = true 
)
inline

Constructor for emplace_back.

Definition at line 81 of file CompletionPolicy.h.

Member Function Documentation

◆ createDefaultPolicies()

std::vector< CompletionPolicy > o2::framework::CompletionPolicy::createDefaultPolicies ( )
static

Helper to create the default configuration.

By default the CompletionPolicy matches any Device and only runs a computation when all the inputs are there.

Definition at line 25 of file CompletionPolicy.cxx.

Member Data Documentation

◆ balanceChannels

bool o2::framework::CompletionPolicy::balanceChannels = true

Wether or not the policy requires queues to be balanced Set to false if the policy does not require that the upstream producers are more or less balanced. Most notably, this is not needed if the policy always happens to consume / discard data.

Definition at line 99 of file CompletionPolicy.h.

◆ callbackFull

CallbackFull o2::framework::CompletionPolicy::callbackFull = nullptr

Actual policy which decides what to do with a partial InputRecord, extended version.

Definition at line 90 of file CompletionPolicy.h.

◆ configureRelayer

CallbackConfigureRelayer o2::framework::CompletionPolicy::configureRelayer = nullptr

A callback which allows you to configure the behavior of the data relayer associated to the matching device.

Definition at line 93 of file CompletionPolicy.h.

◆ matcher

Matcher o2::framework::CompletionPolicy::matcher = nullptr

Callback to be used to understand if the policy should apply to the given device.

Definition at line 88 of file CompletionPolicy.h.

◆ name

std::string o2::framework::CompletionPolicy::name = ""

Name of the policy itself.

Definition at line 85 of file CompletionPolicy.h.

◆ order

CompletionOrder o2::framework::CompletionPolicy::order = CompletionOrder::Any

Definition at line 101 of file CompletionPolicy.h.


The documentation for this struct was generated from the following files: