11#ifndef O2_FRAMEWORK_WORKFLOWHELPERS_H_
12#define O2_FRAMEWORK_WORKFLOWHELPERS_H_
26inline static std::string debugWorkflow(std::vector<DataProcessorSpec>
const& specs)
28 std::ostringstream out;
29 for (
auto& spec : specs) {
30 out << spec.name <<
"\n";
32 for (
auto& ii : spec.inputs) {
102 std::tie(rhs.producer, rhs.consumer, rhs.timeIndex, rhs.producerTimeIndex);
116 std::tie(rhs.processorIndex, rhs.timeslice);
131 return index < rhs.index;
135 return index == rhs.index;
189 std::vector<DeviceConnectionEdge>& logicalEdges,
190 std::vector<OutputSpec>& outputs,
191 std::vector<LogicalForwardInfo>& availableForwardsInfo);
195 static void sortEdges(std::vector<size_t>& inEdgeIndex,
196 std::vector<size_t>& outEdgeIndex,
197 const std::vector<DeviceConnectionEdge>& edges);
200 const std::vector<DeviceConnectionEdge>& edges,
201 const std::vector<size_t>&
index);
204 const std::vector<DeviceConnectionEdge>& edges,
205 const std::vector<size_t>&
index);
222 std::vector<DataProcessorPoliciesInfo>
const& policiesInfos,
223 std::vector<DeviceConnectionEdge>
const& edges,
224 std::vector<OutputSpec>
const& outputs);
GLenum GLenum GLsizei const GLuint GLboolean enabled
Defining PrimaryVertex explicitly as messageable.
std::vector< DataProcessorSpec > WorkflowSpec
std::string completionPolicyName
static std::string describe(InputSpec const &spec)
size_t consumerInputIndex
bool operator<(const DeviceConnectionId &rhs) const
bool operator<(const DeviceId &rhs) const
Helper struct to keep track of the results of the topological sort.
bool operator<(TopoIndexInfo const &rhs) const
int layer
the associated layer in the sorting procedure
int index
the index in the actual storage of the nodes to be sorted topologically
bool operator==(TopoIndexInfo const &rhs) const
friend std::ostream & operator<<(std::ostream &out, TopoIndexInfo const &info)
A set of internal helper classes to manipulate a Workflow.
static void validateEdges(WorkflowSpec const &workflow, std::vector< DataProcessorPoliciesInfo > const &policiesInfos, std::vector< DeviceConnectionEdge > const &edges, std::vector< OutputSpec > const &outputs)
static void adjustTopology(WorkflowSpec &workflow, ConfigContext const &ctx)
static void constructGraph(const WorkflowSpec &workflow, std::vector< DeviceConnectionEdge > &logicalEdges, std::vector< OutputSpec > &outputs, std::vector< LogicalForwardInfo > &availableForwardsInfo)
static void injectServiceDevices(WorkflowSpec &workflow, ConfigContext &ctx)
static WorkflowParsingState verifyWorkflow(const WorkflowSpec &workflow)
static std::vector< InputSpec > computeDanglingOutputs(WorkflowSpec const &workflow)
returns only dangling outputs
static std::vector< EdgeAction > computeOutEdgeActions(const std::vector< DeviceConnectionEdge > &edges, const std::vector< size_t > &index)
static std::tuple< std::vector< InputSpec >, std::vector< bool > > analyzeOutputs(WorkflowSpec const &workflow)
static void sortEdges(std::vector< size_t > &inEdgeIndex, std::vector< size_t > &outEdgeIndex, const std::vector< DeviceConnectionEdge > &edges)
static std::vector< EdgeAction > computeInEdgeActions(const std::vector< DeviceConnectionEdge > &edges, const std::vector< size_t > &index)
static std::vector< TopoIndexInfo > topologicalSort(size_t nodeCount, int const *edgeIn, int const *edgeOut, size_t byteStride, size_t edgesCount)