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

#include <DeviceSpecHelpers.h>

Static Public Member Functions

static void dataProcessorSpecs2DeviceSpecs (const WorkflowSpec &workflow, std::vector< ChannelConfigurationPolicy > const &channelPolicies, std::vector< CompletionPolicy > const &completionPolicies, std::vector< DispatchPolicy > const &dispatchPolicies, std::vector< ResourcePolicy > const &resourcePolicies, std::vector< CallbacksPolicy > const &callbacksPolicies, std::vector< SendingPolicy > const &sendingPolicy, std::vector< ForwardingPolicy > const &forwardingPolicies, std::vector< DeviceSpec > &devices, ResourceManager &resourceManager, std::string const &uniqueWorkflowId, ConfigContext const &configContext, bool optimizeTopology=false, unsigned short resourcesMonitoringInterval=0, std::string const &channelPrefix="", OverrideServiceSpecs const &overrideServices={})
 
static void validate (WorkflowSpec const &workflow)
 
static void dataProcessorSpecs2DeviceSpecs (const WorkflowSpec &workflow, std::vector< ChannelConfigurationPolicy > const &channelPolicies, std::vector< CompletionPolicy > const &completionPolicies, std::vector< CallbacksPolicy > const &callbacksPolicies, std::vector< DeviceSpec > &devices, ResourceManager &resourceManager, std::string const &uniqueWorkflowId, ConfigContext const &configContext, bool optimizeTopology=false, unsigned short resourcesMonitoringInterval=0, std::string const &channelPrefix="", OverrideServiceSpecs const &overrideServices={})
 
static std::string inputChannel2String (const InputChannelSpec &channel)
 Helper to provide the channel configuration string for an input channel.
 
static std::string outputChannel2String (const OutputChannelSpec &channel)
 Helper to provide the channel configuration string for an output channel.
 
static void reworkHomogeneousOption (std::vector< DataProcessorInfo > &infos, char const *name, char const *defaultValue)
 
static void reworkIntegerOption (std::vector< DataProcessorInfo > &infos, char const *name, std::function< long long()> defaultValueCallback, long long startValue, std::function< long long(long long, long long)> bestValue)
 
static void reworkShmSegmentSize (std::vector< DataProcessorInfo > &infos)
 
static void prepareArguments (bool defaultQuiet, bool defaultStopped, bool intereactive, unsigned short driverPort, DriverConfig const &driverConfig, std::vector< DataProcessorInfo > const &processorInfos, std::vector< DeviceSpec > const &deviceSpecs, std::vector< DeviceExecution > &deviceExecutions, std::vector< DeviceControl > &deviceControls, std::vector< ConfigParamSpec > const &detectedOptions, std::string const &uniqueWorkflowId)
 
static std::string reworkTimeslicePlaceholder (std::string const &str, DeviceSpec const &spec)
 
static void processOutEdgeActions (ConfigContext const &configContext, std::vector< DeviceSpec > &devices, std::vector< DeviceId > &deviceIndex, std::vector< DeviceConnectionId > &connections, ResourceManager &resourceManager, const std::vector< size_t > &outEdgeIndex, const std::vector< DeviceConnectionEdge > &logicalEdges, const std::vector< EdgeAction > &actions, const WorkflowSpec &workflow, const std::vector< OutputSpec > &outputs, std::vector< ChannelConfigurationPolicy > const &channelPolicies, std::vector< SendingPolicy > const &sendingPolicies, std::vector< ForwardingPolicy > const &forwardingPolicies, std::string const &channelPrefix, ComputingOffer const &defaultOffer, OverrideServiceSpecs const &overrideServices={})
 
static void processInEdgeActions (std::vector< DeviceSpec > &devices, std::vector< DeviceId > &deviceIndex, const std::vector< DeviceConnectionId > &connections, ResourceManager &resourceManager, const std::vector< size_t > &inEdgeIndex, const std::vector< DeviceConnectionEdge > &logicalEdges, const std::vector< EdgeAction > &actions, const WorkflowSpec &workflow, const std::vector< LogicalForwardInfo > &availableForwardsInfo, std::vector< ChannelConfigurationPolicy > const &channelPolicies, std::string const &channelPrefix, ComputingOffer const &defaultOffer, OverrideServiceSpecs const &overrideServices={})
 
static boost::program_options::options_description getForwardedDeviceOptions ()
 define the options which are forwarded to every child
 
static bool hasLabel (DeviceSpec const &spec, char const *label)
 

Detailed Description

Definition at line 45 of file DeviceSpecHelpers.h.

Member Function Documentation

◆ dataProcessorSpecs2DeviceSpecs() [1/2]

static void o2::framework::DeviceSpecHelpers::dataProcessorSpecs2DeviceSpecs ( const WorkflowSpec workflow,
std::vector< ChannelConfigurationPolicy > const &  channelPolicies,
std::vector< CompletionPolicy > const &  completionPolicies,
std::vector< CallbacksPolicy > const &  callbacksPolicies,
std::vector< DeviceSpec > &  devices,
ResourceManager resourceManager,
std::string const &  uniqueWorkflowId,
ConfigContext const &  configContext,
bool  optimizeTopology = false,
unsigned short  resourcesMonitoringInterval = 0,
std::string const &  channelPrefix = "",
OverrideServiceSpecs const &  overrideServices = {} 
)
inlinestatic

Definition at line 67 of file DeviceSpecHelpers.h.

◆ dataProcessorSpecs2DeviceSpecs() [2/2]

void o2::framework::DeviceSpecHelpers::dataProcessorSpecs2DeviceSpecs ( const WorkflowSpec workflow,
std::vector< ChannelConfigurationPolicy > const &  channelPolicies,
std::vector< CompletionPolicy > const &  completionPolicies,
std::vector< DispatchPolicy > const &  dispatchPolicies,
std::vector< ResourcePolicy > const &  resourcePolicies,
std::vector< CallbacksPolicy > const &  callbacksPolicies,
std::vector< SendingPolicy > const &  sendingPolicy,
std::vector< ForwardingPolicy > const &  forwardingPolicies,
std::vector< DeviceSpec > &  devices,
ResourceManager resourceManager,
std::string const &  uniqueWorkflowId,
ConfigContext const &  configContext,
bool  optimizeTopology = false,
unsigned short  resourcesMonitoringInterval = 0,
std::string const &  channelPrefix = "",
OverrideServiceSpecs const &  overrideServices = {} 
)
static

Helper to convert from an abstract dataflow specification, workflow, to an actual set of devices which will have to run.

For the moment lets play it safe and underestimate default needed resources.

Definition at line 1102 of file DeviceSpecHelpers.cxx.

◆ getForwardedDeviceOptions()

boost::program_options::options_description o2::framework::DeviceSpecHelpers::getForwardedDeviceOptions ( )
static

define the options which are forwarded to every child

return a description of all options to be forwarded to the device by default

Definition at line 1718 of file DeviceSpecHelpers.cxx.

◆ hasLabel()

bool o2::framework::DeviceSpecHelpers::hasLabel ( DeviceSpec const &  spec,
char const *  label 
)
static
Returns
whether a give DeviceSpec spec has a label label

Definition at line 1771 of file DeviceSpecHelpers.cxx.

◆ inputChannel2String()

std::string o2::framework::DeviceSpecHelpers::inputChannel2String ( const InputChannelSpec channel)
static

Helper to provide the channel configuration string for an input channel.

This creates a string to configure channels of a fair::mq::Device FIXME: support shared memory

Definition at line 415 of file DeviceSpecHelpers.cxx.

◆ outputChannel2String()

std::string o2::framework::DeviceSpecHelpers::outputChannel2String ( const OutputChannelSpec channel)
static

Helper to provide the channel configuration string for an output channel.

Definition at line 427 of file DeviceSpecHelpers.cxx.

◆ prepareArguments()

void o2::framework::DeviceSpecHelpers::prepareArguments ( bool  defaultQuiet,
bool  defaultStopped,
bool  intereactive,
unsigned short  driverPort,
DriverConfig const &  driverConfig,
std::vector< DataProcessorInfo > const &  processorInfos,
std::vector< DeviceSpec > const &  deviceSpecs,
std::vector< DeviceExecution > &  deviceExecutions,
std::vector< DeviceControl > &  deviceControls,
std::vector< ConfigParamSpec > const &  detectedOptions,
std::string const &  uniqueWorkflowId 
)
static

Helper to prepare the arguments which will be used to start the various devices.

Lookup the executable name in the metadata associated with the workflow. If we find it, we rewrite the command line arguments to be processed so that they look like the ones passed to the merged workflow.

Add to foDesc the options which are not already there

Add libSegFault to the stack if provided.

Definition at line 1382 of file DeviceSpecHelpers.cxx.

◆ processInEdgeActions()

void o2::framework::DeviceSpecHelpers::processInEdgeActions ( std::vector< DeviceSpec > &  devices,
std::vector< DeviceId > &  deviceIndex,
const std::vector< DeviceConnectionId > &  connections,
ResourceManager resourceManager,
const std::vector< size_t > &  inEdgeIndex,
const std::vector< DeviceConnectionEdge > &  logicalEdges,
const std::vector< EdgeAction > &  actions,
const WorkflowSpec workflow,
const std::vector< LogicalForwardInfo > &  availableForwardsInfo,
std::vector< ChannelConfigurationPolicy > const &  channelPolicies,
std::string const &  channelPrefix,
ComputingOffer const &  defaultOffer,
OverrideServiceSpecs const &  overrideServices = {} 
)
static

This takes the list of preprocessed edges of a graph and creates Devices and Channels which are related to the incoming edges i.e. those which refer to the act of consuming data.

Definition at line 776 of file DeviceSpecHelpers.cxx.

◆ processOutEdgeActions()

void o2::framework::DeviceSpecHelpers::processOutEdgeActions ( ConfigContext const &  configContext,
std::vector< DeviceSpec > &  devices,
std::vector< DeviceId > &  deviceIndex,
std::vector< DeviceConnectionId > &  connections,
ResourceManager resourceManager,
const std::vector< size_t > &  outEdgeIndex,
const std::vector< DeviceConnectionEdge > &  logicalEdges,
const std::vector< EdgeAction > &  actions,
const WorkflowSpec workflow,
const std::vector< OutputSpec > &  outputs,
std::vector< ChannelConfigurationPolicy > const &  channelPolicies,
std::vector< SendingPolicy > const &  sendingPolicies,
std::vector< ForwardingPolicy > const &  forwardingPolicies,
std::string const &  channelPrefix,
ComputingOffer const &  defaultOffer,
OverrideServiceSpecs const &  overrideServices = {} 
)
static

This takes the list of preprocessed edges of a graph and creates Devices and Channels which are related to the outgoing edges i.e. those which refer to the act of producing data.

If any of the inputs or outputs are "Lifetime::OutOfBand" create the associated channels.

Definition at line 486 of file DeviceSpecHelpers.cxx.

◆ reworkHomogeneousOption()

void o2::framework::DeviceSpecHelpers::reworkHomogeneousOption ( std::vector< DataProcessorInfo > &  infos,
char const *  name,
char const *  defaultValue 
)
static

Rework a given command line option so that all the sub workflows either have the same value, or they leave it unspecified. infos the DataProcessorInfos to modify name of the option to modify, including – defaultValue the default value for the option. If default is nullptr, not finding the option will not not add a default value.

Definition at line 1273 of file DeviceSpecHelpers.cxx.

◆ reworkIntegerOption()

void o2::framework::DeviceSpecHelpers::reworkIntegerOption ( std::vector< DataProcessorInfo > &  infos,
char const *  name,
std::function< long long()>  defaultValueCallback,
long long  startValue,
std::function< long long(long long, long long)>  bestValue 
)
static

Rework a given command line option so that we pick the largest value which has been specified or a default one. defaultValueCallback a callback which returns the default value, if nullptr, the option will not be added. bestValue given to possible values of the option, return the one which should be used.

Definition at line 1303 of file DeviceSpecHelpers.cxx.

◆ reworkShmSegmentSize()

void o2::framework::DeviceSpecHelpers::reworkShmSegmentSize ( std::vector< DataProcessorInfo > &  infos)
static

Rework the infos so that they have a consistent –shm-section-size which is the maximum of the specified value.

If no segment size is set, make it max VSIZE - 1GB or 90% max VSIZE.

Definition at line 1334 of file DeviceSpecHelpers.cxx.

◆ reworkTimeslicePlaceholder()

std::string o2::framework::DeviceSpecHelpers::reworkTimeslicePlaceholder ( std::string const &  str,
DeviceSpec const &  spec 
)
static

Rework the environment string

  • Substitute {timeslice<N>} with the actual value of the timeslice.

Definition at line 1777 of file DeviceSpecHelpers.cxx.

◆ validate()

void o2::framework::DeviceSpecHelpers::validate ( WorkflowSpec const &  workflow)
static

Definition at line 439 of file DeviceSpecHelpers.cxx.


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