Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
ComputationalLoad Class Reference

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

Description

A calibratable CPU load to be invoked from a node job functor.

Two distinct methods for load generation are provided

  • tight loop with arithmetics in register
  • repeatedly accessing and adding memory marked as volatile The timeBase multiplied with the given scaleStep´ determines the actual run time. When using the _memory method_ (useAllocation), a heap block ofstaleStep*sizeBaseis used, and the number of repetitions is chosen such as to match the given timing goal. @note since performance depends on the platform, it is mandatory to invoke the [self calibration](\ref ComputationalLoad::calibrate) at least once prior to use. Performing the calibration with default base settings is acceptable, since mostly the overall expense is growing linearly; obviously the calibration is more precisely however when using the actualtimeBaseandsizeBaseof the intended usage. The calibration watches processing speed in a microbenchmark withLOAD_BENCHMARK_RUNS` repetitions; the result is stored in a static variable and can thus be reused.

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

Public Attributes

microseconds timeBase = LOAD_DEFAULT_TIME
 
size_t sizeBase = LOAD_DEFAULT_MEM_SIZE
 
bool useAllocation = false
 

Public Member Functions

double invoke (uint scaleStep=1)
 cause a delay by computational load
 
double benchmark (uint scaleStep=1)
 
void calibrate ()
 
void maybeCalibrate ()
 
bool isCalibrated () const
 

Private Types

using Sink = volatile size_t
 

Private Member Functions

uint64_t roundsNeeded (uint scaleStep)
 
auto allocNeeded (uint scaleStep)
 
void causeComputationLoad (uint scaleStep)
 
void causeMemProcessLoad (uint scaleStep)
 
double determineSpeed ()
 
void performIncrementalCalibration ()
 
- Private Member Functions inherited from MoveAssign
 ~MoveAssign ()=default
 
 MoveAssign ()=default
 
 MoveAssign (MoveAssign &&)=default
 
 MoveAssign (MoveAssign const &)=delete
 
MoveAssignoperator= (MoveAssign &&)=default
 
MoveAssignoperator= (MoveAssign const &)=delete
 

Static Private Member Functions

static double & computationSpeed (bool mem)
 

Member Typedef Documentation

◆ Sink

using Sink = volatile size_t
private

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

Member Function Documentation

◆ computationSpeed()

static double & computationSpeed ( bool  mem)
inlinestaticprivate
Parameters
memin iterations/µs

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

Referenced by ComputationalLoad::isCalibrated(), ComputationalLoad::performIncrementalCalibration(), and ComputationalLoad::roundsNeeded().

+ Here is the caller graph for this function:

◆ invoke()

double invoke ( uint  scaleStep = 1)
inline

cause a delay by computational load

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

References ComputationalLoad::causeComputationLoad(), ComputationalLoad::causeMemProcessLoad(), ComputationalLoad::timeBase, and ComputationalLoad::useAllocation.

Referenced by ComputationalLoad::benchmark(), RandomChainCalcFunctor< maxFan >::invokeJobOperation(), vault::gear::test::onetimeCrunch(), TestChainLoad< maxFan >::performGraphSynchronously(), SchedulerStress_test::setup_systematicSchedule(), and TestChainLoad_test::verify_computation_load().

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

◆ benchmark()

double benchmark ( uint  scaleStep = 1)
inline
Returns
averaged runtime in current configuration

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

References ComputationalLoad::invoke().

Referenced by ComputationalLoad::determineSpeed(), and TestChainLoad_test::verify_computation_load().

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

◆ calibrate()

void calibrate ( )
inline

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

References ComputationalLoad::performIncrementalCalibration(), TRANSIENTLY, and ComputationalLoad::useAllocation.

Referenced by ComputationalLoad::maybeCalibrate(), SchedulerStress_test::setup_systematicSchedule(), and TestChainLoad_test::verify_computation_load().

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

◆ maybeCalibrate()

void maybeCalibrate ( )
inline

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

References ComputationalLoad::calibrate(), and ComputationalLoad::isCalibrated().

Referenced by vault::gear::test::onetimeCrunch(), and TestChainLoad< maxFan >::performGraphSynchronously().

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

◆ isCalibrated()

bool isCalibrated ( ) const
inline

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

References ComputationalLoad::computationSpeed().

Referenced by ComputationalLoad::maybeCalibrate().

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

◆ roundsNeeded()

uint64_t roundsNeeded ( uint  scaleStep)
inlineprivate

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

References ComputationalLoad::computationSpeed(), ComputationalLoad::timeBase, and ComputationalLoad::useAllocation.

Referenced by ComputationalLoad::allocNeeded(), ComputationalLoad::causeComputationLoad(), and ComputationalLoad::determineSpeed().

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

◆ allocNeeded()

auto allocNeeded ( uint  scaleStep)
inlineprivate

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

References ComputationalLoad::roundsNeeded(), and ComputationalLoad::sizeBase.

Referenced by ComputationalLoad::causeMemProcessLoad().

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

◆ causeComputationLoad()

void causeComputationLoad ( uint  scaleStep)
inlineprivate

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

References lib::hash::combine(), and ComputationalLoad::roundsNeeded().

Referenced by ComputationalLoad::invoke().

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

◆ causeMemProcessLoad()

void causeMemProcessLoad ( uint  scaleStep)
inlineprivate

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

References ComputationalLoad::allocNeeded(), and UninitialisedDynBlock< T >::front().

Referenced by ComputationalLoad::invoke().

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

◆ determineSpeed()

double determineSpeed ( )
inlineprivate

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

References ComputationalLoad::benchmark(), and ComputationalLoad::roundsNeeded().

Referenced by ComputationalLoad::performIncrementalCalibration().

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

◆ performIncrementalCalibration()

void performIncrementalCalibration ( )
inlineprivate

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

References ComputationalLoad::computationSpeed(), ComputationalLoad::determineSpeed(), and ComputationalLoad::useAllocation.

Referenced by ComputationalLoad::calibrate().

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

Member Data Documentation

◆ timeBase

◆ sizeBase

◆ useAllocation

+ Inheritance diagram for ComputationalLoad:
+ Collaboration diagram for ComputationalLoad:

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