C++#

class Experiment : public lue::qa::Run#

The Experiment class represents the results of performing one or more experimental runs.

During a scalability experiment, software is being executed once or multiple times. Executing it multiple times allows for the calculation of statistics, like the mean duration a run took.

This class inherits from Run, so it is an experimental run itself. This allows the duration of the whole “experiment run” to be measured.

Typical usage pattern:

Experiment experiment(nr_workers);
experiment.start();

for(Count run_idx = 0; run_idx < nr_runs; ++run_idx)
{
    Run run{};

    // Do any preprocessing before this point. Also, be sure to wait
    // for any asynchronous work started to finish.
    // ...

    // Now start the run, measuring its duration
    run.start();

    // The actual work to measure the runtime of
    do_something();

    // Be sure to first wait for any asynchronous work started to finish
    // ...

    // Now stop this run and store the results. Do any post processing after this point.
    run.stop();
    experiment.add(run);
}

experiment.stop();
save_results(experiment, result_pathname);

Subclassed by lue::qa::ArrayExperiment

Public Functions

Experiment(Count nr_workers)#

Construct and instance for an experiment using nr_workers workers.

auto nr_workers() const -> Count#

Return the number of workers this experiment is for.

void add(Run const &run)#

Add (save) the results of an experimental run.

auto runs() const -> Runs const&#

Return the collection with the results of the experimental runs added.

class ArrayExperiment : public lue::qa::Experiment#

The ArrayExperiment class represents an experiment where (2D) partitioned arrays are used.

Public Functions

ArrayExperiment(Count nr_workers, Shape const &array_shape, Shape const &partition_shape)#

Construct and instance for experiment using nr_workers and with arrays of shape arrays_shape and partitioned using partition_shape.

auto array_shape() const -> Shape const&#

Return the array shape.

auto partition_shape() const -> Shape const&#

Return the partition shape.

class Run#

The Run class represents runs: information about how much time executing a piece of code takes.

Run instances can be started (start()) and stopped (stop()), after which the duration between the start and stop can be queried (duration()).

See also

Stopwatch

Subclassed by lue::qa::Experiment

Public Functions

void start()#

Start the run, which means storing the current point in time.

void stop()#

Stop the run, which means storing the current point in time.

auto start_time_point() const -> Stopwatch::SystemTimePoint const&#

Return the time point when start() was called.

template<typename ToDuration>
inline auto duration() const -> ToDuration#

Return the duration between the start and end time points.

Template Parameters:

ToDuration – Units to cast the underlying high resolution duration to, like seconds