pmm  1.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
pmm_selector.h File Reference
#include "pmm_interval.h"
#include "pmm_model.h"
#include "pmm_load.h"

Go to the source code of this file.

Functions

int * multi_random_select_new_bench (struct pmm_routine *r)
int * naive_1d_bisect_select_new_bench (struct pmm_routine *r)
int naive_1d_bisect_insert_bench (struct pmm_routine *r, struct pmm_benchmark *b)
int * multi_naive_select_new_bench (struct pmm_routine *r)
int multi_naive_insert_bench (struct pmm_routine *r, struct pmm_benchmark *b)
int * multi_gbbp_naive_select_new_bench (struct pmm_routine *r)
int * multi_gbbp_diagonal_select_new_bench (struct pmm_routine *r)
int * multi_gbbp_select_new_bench (struct pmm_routine *r)
int multi_gbbp_insert_bench (struct pmm_loadhistory *h, struct pmm_routine *r, struct pmm_benchmark *b)

Function Documentation

int* multi_gbbp_diagonal_select_new_bench ( struct pmm_routine r)

Returns a new point to benchmark using the Multidimensional Diagonal GBBP method. Briefly, this method first constructs, using the GBBP algorithm, on an interval from the start point of all parameter definitions to the end point of those definitions. After construction along this interval is complete, all points that were measured along it are used to project new construction intervals. From each point N construction intervals are projected parallel to each of the N parameter axes. GBBP is then applied to these new construction intervals, completing the model.

Parameters
rpointer to the routine for which we will find a new benchmark point
Returns
pointer to an array describing the new benchmark point or NULL on failure

Definition at line 1155 of file pmm_selector.c.

int multi_gbbp_insert_bench ( struct pmm_loadhistory h,
struct pmm_routine r,
struct pmm_benchmark b 
)

Insert a benchmark into a multi-parameter model being constructed with the GBBP method.

The second half of the gbbp proceedure. After a benchmark has been made it must be added to the model and the state of the building proceedure must be adjusted according to the new shape of the model.

The rules that govern this adjustment and the specific adjustments are as follows:

if the model is empty, we add the benchmark to the model and set the state to be climbing.

if the model is climbing we test the new benchmark to see if the model is still climbing, or has levelled out, or has begun to decrease. If the model is not still climbing or levelled out, we change the state to bisection. The bisection state permits the optimal selection of new benchmarking points.

In this state, any new benchmark being inserted is comparted to the existing model. If the model already accurately approximates the benchmark the state is set to inflection.

The inflection state is a second level of bisection, in this state if a new benchmark is again accurately approximated by the existing model we deem the model to be complete in this region

Most of this functionality is actually implemented in a deeper function process_interval(), process_it_gbbp_climb(), process_it_gbbp_bisect(), etc.

Returns
0 on success, -1 on failure to process intervals, -2 on failure to insert benchmark
Parameters
hpointer to the load history
rpointer to the routine to which the benchmark is added
bpointer to the benchmark to be added
Returns
0 onsucces, -1 on failure to process intervals, -2 on complete failure to add benchmark to model

Definition at line 2555 of file pmm_selector.c.

int* multi_gbbp_naive_select_new_bench ( struct pmm_routine r)

Returns a new point to benchmark using the Multidimensional Naive GBBP method. Briefly, this method initialises construction intervals in a grid form, through all possible points as defined by the parameter definitions. Then GBBP is applied to all construction intervals to select benchmark points, until the model has been built along all lines in the grid.

Parameters
rpointer to the routine for which we will find a new benchmark point
Returns
pointer to an array describing the new benchmark point or NULL on failure

Definition at line 888 of file pmm_selector.c.

int* multi_gbbp_select_new_bench ( struct pmm_routine r)

builds multi-parameter piece-wise performance models using the GBBP optimisation

Alorithm description:

init

  • push boundary_complete onto empty interval stack
  • for each parameter of the model
    • push boundary model of that parameter onto interval stack

main

  • read interval from top of stack
  • if interval is of of a boundary type
    • apply GBBP to the construction of the boundary model
  • if interval is tagged boundary_complete
    • mesh points on each boundary model to create interior benchmark points. Push each of these points onto the interval stack with a point_inteval tag.
    • pop the top point_interval and execute a benchmark on it
  • if interval is of the point_interval type
    • execute a benchmark on the point and add to model
  • if stack is empty
    • mark model construction as complete
Parameters
rpointer to the routine to build for
Returns
pointer to a newly allocated array containing the parameters of the selected benchmark

Definition at line 2031 of file pmm_selector.c.

int multi_naive_insert_bench ( struct pmm_routine r,
struct pmm_benchmark b 
)

Process the insertion of a new benchmark into a model being constructed with a naive method.

Definition at line 329 of file pmm_selector.c.

int* multi_naive_select_new_bench ( struct pmm_routine r)

Select a new benchmark following a naive construction method where every possible point in the model is benchmarked.

This action is simply taking the top interval from the construction stack and returning the parameters it describes.

Parameters
rpointer to the routine who's model is under construction
Returns
pointer to newly allocated parameter array describing next bench point or NULL on error

Definition at line 192 of file pmm_selector.c.

int* multi_random_select_new_bench ( struct pmm_routine r)

builds a multi-parameter piece-wise performance model using a random selection of benchmark points

Alogirthm description:

if model is empty select start values for all parameters and return benchmark point else seed random generator

for each parameter select a random parameter size based on the paramdef limits and return

Parameters
rpointer to routine for which the model is being built
Returns
pointer to newly allocated array describing parameters for the benchmark

Definition at line 797 of file pmm_selector.c.

int naive_1d_bisect_insert_bench ( struct pmm_routine r,
struct pmm_benchmark b 
)

Insert a benchmark into a 1 parameter model being constructed with the naive bisection method.

Parameters
rpointer to the routine forwhich the model is being constructed
bbenchmark to insert
Returns
0 on success, -1 on failure to process intervals, -2 on failure to insert benchmark

Definition at line 2391 of file pmm_selector.c.

int* naive_1d_bisect_select_new_bench ( struct pmm_routine r)

Returns a new point to benchmark using the naive bisection in 1 dimension method. Briefly, this method initialises a bisection construction interval across the problem space (1-d only). Then recursively bisects this interval and benchmarks at bisection points, until it is no longer divisible.

Parameters
rpointer to the routine for which we will find a new benchmark point
Returns
pointer to an array describing the new benchmark point or NULL on failure

Definition at line 609 of file pmm_selector.c.