tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
anonymous_namespace{cbr.cpp} Namespace Reference

Classes

struct  Read
 
struct  Write
 
struct  Time
 
struct  RO
 
struct  RW
 
struct  R_RO
 
struct  R_Time
 
struct  W_RO
 
struct  W_Time
 
struct  Time_RO
 
struct  R_W_RO
 
struct  R_W_Time
 
struct  R_Time_RO
 
struct  W_Time_RO
 
struct  R_W_Time_RO
 
struct  TxnRatio
 
struct  TxnRatio_R
 
struct  TxnRatio_W
 
struct  TxnRatio_RO
 
struct  TxnRatio_Time
 
struct  TxnRatio_RW
 
struct  TxnRatio_R_RO
 
struct  TxnRatio_R_Time
 
struct  TxnRatio_W_RO
 
struct  TxnRatio_W_Time
 
struct  TxnRatio_RO_Time
 
struct  TxnRatio_RW_RO
 
struct  TxnRatio_RW_Time
 
struct  TxnRatio_R_RO_Time
 
struct  TxnRatio_W_RO_Time
 
struct  TxnRatio_RW_RO_Time
 

Functions

TM_INLINE unsigned long norm_dist (unsigned long a, unsigned long b)
 
TM_FASTCALL uint32_t profile_nochange ()
 
template<class C >
uint32_t cbr_tail (qtable_t &profile)
 
TM_FASTCALL uint32_t pol_CBR_RO ()
 
template<class C >
TM_FASTCALL uint32_t cbr_nn ()
 

Detailed Description

This file implements a few classifiers for trying to pick which algorithm to switch to, based on some existing information from a profile and a table of previous experiments.

Function Documentation

template<class C >
TM_FASTCALL uint32_t anonymous_namespace{cbr.cpp}::cbr_nn ( )

This template provides the functionality we need for doing a nearest-neighbor classification where we use as input the summary profile, and scan through the qtable to find the most representative row

Here is the call graph for this function:

template<class C >
uint32_t anonymous_namespace{cbr.cpp}::cbr_tail ( qtable_t profile)

Common part of CBR code

TM_INLINE unsigned long anonymous_namespace{cbr.cpp}::norm_dist ( unsigned long  a,
unsigned long  b 
)

The CBR policies can all be characterized as follows:

  • We have a qtable full of normalized profiles
  • We have a summary_profile, which is the average of N profiles, normalized
  • For each qtable row, for each column, compute the norm_dist between the row and the summary_profile. Take the weighted sum of the distances
  • Return the algorithm whose name appears in the qtable row with the minimum weighted sum norm_dist

    Implicit in this description is the fact that norm_dist must be defined relative to a normalization strategy. Using this norm_dist function implies that we tend to choose a qtable entry with larger number on some attribute when we have a tie in Manhattan distance. E.g., when we get a profiled read number of 4, we may only have 2 entries in the qtable, one with a read number of 3 and the other one with a read number of 5. In this case, we will choose the row with 5.

Here is the caller graph for this function:

TM_FASTCALL uint32_t anonymous_namespace{cbr.cpp}::pol_CBR_RO ( )

This policy compares the read-only ratio of the current workload to the read-only ratios of entries in our qtable, using a nearest neighbor distance. Note that it does not use profiles at all.

Here is the caller graph for this function:

TM_FASTCALL uint32_t anonymous_namespace{cbr.cpp}::profile_nochange ( )

A testing policy: we use this to return exactly the same algorithm as we had before a profile was run. The reason this is implemented here is just so that we have a hook in the standard place to ensure that profiles get printed.

Here is the call graph for this function:

Here is the caller graph for this function: