Lumiera  0.pre.03
»edit your freedom«
TestChainLoad< maxFan > Class Template Reference

#include "/Werk/devel/lumi/tests/vault/gear/test-chain-load.hpp"

Description

template<size_t maxFan = DEFAULT_FAN>
class vault::gear::test::TestChainLoad< maxFan >

A Generator for synthetic Render Jobs for Scheduler load testing.

Allocates a fixed set of #numNodes and generates connecting topology.

Template Parameters
maxFanmaximal fan-in/out from a node, also limits maximal parallel strands.
See also
TestChainLoad_test

Definition at line 249 of file test-chain-load.hpp.

Public Types

using Param = lib::Limited< size_t, maxFan >
 Parameter values limited [0 . More...
 
using Rule = lib::RandomDraw< NodeControlBinding >
 Topology is governed by rules for random params.
 

Public Member Functions

 TestChainLoad (size_t nodeCnt=DEFAULT_SIZ)
 
auto allExitHashes () const
 
auto allExitNodes ()
 
auto allLevelWeights ()
 calculate node weights aggregated per level
 
auto allNodePtr ()
 
auto allNodes ()
 
TestChainLoad && buildTopology ()
 Use current configuration and seed to (re)build Node connectivity. More...
 
double calcExpectedCompoundedWeight (uint concurrency=1)
 calculate the simplified/theoretic reduction of compounded weight through concurrency
 
double calcRuntimeReference (microseconds timeBase=LOAD_DEFAULT_TIME, size_t sizeBase=0, size_t repeatCnt=GRAPH_BENCHMARK_RUNS)
 Conduct a number of benchmark runs over processing the Graph synchronously. More...
 
size_t calcWeightSum ()
 overall sum of configured node weights
 
TestChainLoad && clearNodeHashes ()
 Clear node hashes and propagate seed value.
 
Statistic computeGraphStatistics ()
 Operator on TestChainLoad to evaluate current graph connectivity. More...
 
TestChainLoad && configure_isolated_nodes ()
 preconfigured topology: only unconnected seed/exit nodes
 
TestChainLoad && configureShape_chain_loadBursts ()
 preconfigured topology: single graph with massive »load bursts« More...
 
TestChainLoad && configureShape_short_chains2 ()
 preconfigured topology: isolated simple 2-step chains
 
TestChainLoad && configureShape_short_chains3_interleaved ()
 preconfigured topology: simple 3-step chains, starting interleaved
 
TestChainLoad && configureShape_short_segments3_interleaved ()
 preconfigured topology: simple interwoven 3-step graph segments
 
TestChainLoad && expansionRule (Rule r)
 
std::string generateTopologyDOT ()
 
size_t getHash () const
 global hash is the combination of all exit node hashes != 0
 
size_t getSeed () const
 
auto levelScheduleSequence (uint concurrency=1)
 sequence of the summed compounded weight factors after each level
 
size_t nodeID (Node const *n)
 
size_t nodeID (Node const &n)
 
TestChainLoad && performGraphSynchronously (microseconds timeBase=LOAD_DEFAULT_TIME, size_t sizeBase=0)
 Emulate complete graph processing in a single threaded loop. More...
 
TestChainLoad && printRuntimeReference (microseconds timeBase=LOAD_DEFAULT_TIME, size_t sizeBase=0, size_t repeatCnt=GRAPH_BENCHMARK_RUNS)
 
TestChainLoad && printTopologyDOT ()
 
TestChainLoad && printTopologyStatistics ()
 Print a tabular summary of graph characteristics. More...
 
TestChainLoad && pruningRule (Rule r)
 
TestChainLoad && recalculate ()
 Recalculate all node hashes and propagate seed value.
 
TestChainLoad && reductionRule (Rule r)
 
TestChainLoad && seedingRule (Rule r)
 
TestChainLoad && setSeed (size_t seed=rani())
 Set the overall seed value. More...
 
ScheduleCtx setupSchedule (Scheduler &scheduler)
 establish and configure the context used for scheduling computations. More...
 
TestChainLoad && setWeight (size_t fixedNodeWeight=1)
 Set a fixed weight for all nodes. More...
 
size_t size () const
 
size_t topLevel () const
 
TestChainLoad && weightRule (Rule r)
 

Static Public Member Functions

static Rule rule ()
 Abbreviation for starting rules.
 
static Rule rule_atJoin (uint v)
 
static Rule rule_atJoin_else (double p1, double p2, uint v=1)
 
static Rule rule_atLink (uint v)
 
static Rule rule_atStart (uint v)
 
static Rule value (size_t v)
 

Classes

struct  Node
 Graph Data structure. More...
 
class  NodeControlBinding
 Policy/Binding for generation of random parameters by »drawing« based on the node-hash. More...
 
class  ScheduleCtx
 Setup and wiring for a test run to schedule a computation structure as defined by this TestChainLoad instance. More...
 

Friends

class ScheduleCtx
 

Private Types

using NodeIT = lib::RangeIter< Node * >
 
using NodeTab = typename Node::Tab
 

Private Member Functions

NodeafterNode ()
 
NodebackNode ()
 
NodefrontNode ()
 
- Private Member Functions inherited from MoveOnly
 MoveOnly (MoveOnly &&)=default
 
 MoveOnly (MoveOnly const &)=delete
 
MoveOnlyoperator= (MoveOnly &&)=delete
 
MoveOnlyoperator= (MoveOnly const &)=delete
 

Private Attributes

Rule expansionRule_ {}
 
std::unique_ptr< Node[]> nodes_
 
size_t numNodes_
 
Rule pruningRule_ {}
 
Rule reductionRule_ {}
 
Rule seedingRule_ {}
 
Rule weightRule_ {}
 

Member Typedef Documentation

◆ Param

using Param = lib::Limited<size_t, maxFan>

Parameter values limited [0 .

. maxFan]

Definition at line 361 of file test-chain-load.hpp.

Member Function Documentation

◆ nodeID()

size_t nodeID ( Node const *  n)
inline
Returns
the node's index number, based on its storage location

Definition at line 434 of file test-chain-load.hpp.

◆ configureShape_chain_loadBursts()

TestChainLoad&& configureShape_chain_loadBursts ( )
inline

preconfigured topology: single graph with massive »load bursts«

See also
TestChainLoad_test::showcase_StablePattern()

Definition at line 566 of file test-chain-load.hpp.

Referenced by SchedulerService_test::processSchedule(), SchedulerStress_test::setup_systematicSchedule(), SchedulerStress_test::smokeTest(), and TestChainLoad_test::verify_adjusted_schedule().

+ Here is the caller graph for this function:

◆ buildTopology()

TestChainLoad&& buildTopology ( )
inline

Use current configuration and seed to (re)build Node connectivity.

While working in-place, the wiring and thus the resulting hash values are completely rewritten, progressing from start and controlled by evaluating the drawing rules on the current node, computing its hash.

Definition at line 584 of file test-chain-load.hpp.

Referenced by SchedulerStress_test::investigateWorkProcessing(), SchedulerService_test::processSchedule(), SchedulerStress_test::setup_systematicSchedule(), SchedulerStress_test::smokeTest(), TestChainLoad_test::usageExample(), TestChainLoad_test::verify_adjusted_schedule(), and TestChainLoad_test::verify_runtime_reference().

+ Here is the caller graph for this function:

◆ setSeed()

TestChainLoad&& setSeed ( size_t  seed = rani())
inline

Set the overall seed value.

Note
does not propagate seed to consecutive start nodes

Definition at line 683 of file test-chain-load.hpp.

◆ setWeight()

TestChainLoad&& setWeight ( size_t  fixedNodeWeight = 1)
inline

Set a fixed weight for all nodes.

Note
no change to topology (works even without any topology)

Definition at line 695 of file test-chain-load.hpp.

◆ calcRuntimeReference()

double calcRuntimeReference ( microseconds  timeBase = LOAD_DEFAULT_TIME,
size_t  sizeBase = 0,
size_t  repeatCnt = GRAPH_BENCHMARK_RUNS 
)
inline

Conduct a number of benchmark runs over processing the Graph synchronously.

Returns
runtime time in microseconds
Remarks
can be used as reference point to judge Scheduler performance;
  • additional parallelisation could be exploited: ∅w / floor(∅w/concurrency)
  • but the Scheduler also adds overhead and dispatch leeway

Definition at line 801 of file test-chain-load.hpp.

References vault::gear::test::anonymous_namespace{test-chain-load.hpp}::GRAPH_BENCHMARK_RUNS, and vault::gear::test::anonymous_namespace{test-chain-load.hpp}::LOAD_DEFAULT_TIME.

Referenced by TestChainLoad_test::verify_runtime_reference().

+ Here is the caller graph for this function:

◆ performGraphSynchronously()

TestChainLoad< maxFan > && performGraphSynchronously ( microseconds  timeBase = LOAD_DEFAULT_TIME,
size_t  sizeBase = 0 
)

Emulate complete graph processing in a single threaded loop.

Parameters
timeBasetime delay produced by ComputationalLoad at Node.weight==1; can be set to zero to disable the synthetic processing load on nodes
sizeBaseallocation base size used; also causes switch to memory-access based load
See also
TestChainLoad::calcRuntimeReference() for a benchmark based on this processing

Definition at line 1464 of file test-chain-load.hpp.

References ComputationalLoad::invoke(), and vault::gear::test::anonymous_namespace{test-chain-load.hpp}::LOAD_DEFAULT_MEM_SIZE.

Referenced by TestChainLoad_test::verify_runtime_reference().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeGraphStatistics()

Statistic computeGraphStatistics ( )
inline

Operator on TestChainLoad to evaluate current graph connectivity.

In a pass over the internal storage, all nodes are classified and accounted into a set of categories, thereby evaluating

  • the overall number of nodes and levels generated
  • the number of nodes in each level (termed level width)
  • the fraction of overall nodes falling into each category
  • the average number of category members over the levels
  • the density of members, normalised over level width
  • the weight centre of this category members
  • the weight centre of according to density

Definition at line 1171 of file test-chain-load.hpp.

Referenced by SchedulerService_test::processSchedule(), TestChainLoad_test::showcase_Expansion(), and SchedulerStress_test::smokeTest().

+ Here is the caller graph for this function:

◆ printTopologyStatistics()

TestChainLoad< maxFan > && printTopologyStatistics ( )
inline

Print a tabular summary of graph characteristics.

Remarks
explanation of indicators
  • »node« : accounting for all nodes
  • »seed« : seed nodes start a new subgraph or side chain
  • »exit« : exit nodes produce output and have no successor
  • »innr« : inner nodes have both predecessors and successors
  • »fork« : a node linked to more than one successor
  • »join« : a node consuming data from more than one predecessor
  • »link« : a node in a linear processing chain; one input, one output
  • »LEVL« : the overall number of distinct time levels in the graph
  • »SEGS« : the number of completely disjoint partial subgraphs
  • »knot« : a node which both joins data and forks out to multiple successors
  • frac : the percentage of overall nodes falling into this category
  • ∅pS : averaged per Segment (warning: see below)
  • ∅pL : averaged per Level
  • ∅pLW : count normalised to the width at that level and then averaged per Level
  • γL◆ : weight centre of this kind of node, relative to the overall graph
  • γLW◆ : the same, but using the level-width-normalised value
  • γL⬙ : weight centre, but relative to the current subgraph or segment
  • γLW⬙ : same but using level-width-normalised value Together, these values indicates how the simulated processing load is structured over time, assuming that the »Levels« are processed consecutively in temporal order. The graph can unfold or contract over time, and thus nodes can be clustered irregularly, which can be seen from the weight centres; for that reason, the width-normalised variants of the indicators are also accounted for, since a wider graph also implies that there are more nodes of each kind per level, even while the actual density of this kind did not increase.
Warning
no comprehensive connectivity analysis is performed, and thus there is no reliable indication of subgraphs. The SEGS statistics may be misleading, since these count only completely severed and restarted graphs.

Definition at line 1254 of file test-chain-load.hpp.

◆ setupSchedule()

TestChainLoad< maxFan >::ScheduleCtx setupSchedule ( Scheduler scheduler)

establish and configure the context used for scheduling computations.

Note
clears hashes and re-propagates seed in the node graph beforehand.

Definition at line 2183 of file test-chain-load.hpp.

Referenced by StressTestRig< maxFan >::testSetup().

+ Here is the caller graph for this function:
+ Inheritance diagram for TestChainLoad< maxFan >:
+ Collaboration diagram for TestChainLoad< maxFan >:

The documentation for this class was generated from the following file: