k4bench.analysis.plots.dataflow¶
k4bench.analysis.plots.dataflow ¶
The data-flow graph of a k4run job (:mod:k4bench.analysis.dataflow).
:func:dataflow_view collapses the algorithms that share a class (the six
tracker digitisers, say) into one group node unless the group is expanded,
:func:layered_positions lays the nodes out left to right in data-flow order,
and :func:plot_dataflow draws them.
Node
dataclass
¶
Node(id: str, label: str, members: tuple[str, ...], impl: str, framework: str, seconds: float | None)
An algorithm, or a collapsed group of algorithms sharing a class.
FlowView
dataclass
¶
FlowView(nodes: tuple[Node, ...], edges: Mapping[tuple[str, str], tuple[Link, ...]], sink: str | None, groups: Mapping[str, tuple[str, ...]] = dict(), linked: frozenset[str] = frozenset())
The graph as drawn: nodes in execution order and the edges between them.
connected
property
¶
The nodes an edge touches, drawn or among the Writer's left-out reads.
dataflow_view ¶
dataflow_view(flow: DataFlow, seconds: Mapping[str, float] | None = None, expanded: Collection[str] = (), *, writer_edges: bool = True, isolated: bool = True) -> FlowView
Nodes and edges of flow: algorithms sharing a class collapsed into one node unless the class is in expanded or one instance reads from another, each node carrying the event-loop seconds per event of its algorithms (from seconds), the Writer's reads dropped unless writer_edges, and the nodes no edge touches, the Writer's reads included, dropped (but the Writer) unless isolated.
Source code in k4bench/analysis/plots/dataflow.py
neighbourhood ¶
view cut down to node and the nodes it reads from or writes to
directly, with the edges between node and them: one algorithm's place
in the job's data flow, which :func:layered_positions lays out as what
it reads, it, and what reads it.
Source code in k4bench/analysis/plots/dataflow.py
layered_positions ¶
layered_positions(view: FlowView) -> dict[str, tuple[float, float]]
{node id: (x, y)}: each node one layer right of the furthest node
it reads from, the Writer last, and the nodes no edge touches in a row
underneath. Within a layer, nodes are ordered by the mean height of what
they read from, which keeps edges short and uncrossed.
Source code in k4bench/analysis/plots/dataflow.py
plot_dataflow ¶
plot_dataflow(view: FlowView, positions: Mapping[str, tuple[float, float]] | None = None, *, selected: str | None = None, height: int | None = None, ring: str = _SELECTED_RING) -> Figure
Draw view: a dot per node, its area the node's time per event, the
selected one ringed in ring, a curve per edge, its width the number
of collections it carries, hovering anywhere along it to list them. A
group node is a square. The last trace is the nodes, its
customdata[i][0] the id of the node at index i.
Source code in k4bench/analysis/plots/dataflow.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |