Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
CTF_int::LinModel< nparam > Class Template Reference

Linear performance models, which given measurements, provides new model guess. More...

#include <model.h>

Inheritance diagram for CTF_int::LinModel< nparam >:
Collaboration diagram for CTF_int::LinModel< nparam >:

Public Member Functions

 LinModel (double const *init_guess, char const *name, int hist_size=32768)
 constructor More...
 
 LinModel ()
 
 ~LinModel ()
 
void update (MPI_Comm cm)
 updates model based on observarions More...
 
void observe (double const *time_param)
 records observation consisting of execution time and nparam paramter values More...
 
bool should_observe (double const *time_param)
 decides whether the current instance should be observed More...
 
double est_time (double const *param)
 estimates model time based on observarions More...
 
void print ()
 prints current parameter estimates More...
 
void print_uo ()
 prints time estimate errors More...
 
double * get_coeff ()
 return the turned model coefficients More...
 
void load_coeff (std::string file_name)
 load model coefficients from file More...
 
void write_coeff (std::string file_name)
 write model coefficients to file More...
 
void dump_data (std::string path)
 dump model data to a file More...
 

Data Fields

int hist_size
 the number of latest observations we want to consider when updating the model More...
 
double * time_param_mat
 matrix containing parameter/time obervations, with hist_size columns and nmat_lda rows, stores the last hist_size paramstime obervations More...
 
double coeff_guess [nparam]
 current coefficients for each paramter that the linear model will use More...
 
char * name
 name of model More...
 

Detailed Description

template<int nparam>
class CTF_int::LinModel< nparam >

Linear performance models, which given measurements, provides new model guess.

Definition at line 32 of file model.h.

Constructor & Destructor Documentation

template<int nparam>
CTF_int::LinModel< nparam >::LinModel ( double const *  init_guess,
char const *  name,
int  hist_size = 32768 
)

constructor

Parameters
[in]init_guessarray of size nparam consisting of initial model parameter guesses
[in]nameidentifier
[in]hist_sizenumber of times to keep in history

Definition at line 122 of file model.cxx.

References CTF_int::alloc(), and CTF_int::get_all_models().

template<int nparam>
CTF_int::LinModel< nparam >::LinModel ( )

Definition at line 151 of file model.cxx.

template<int nparam>
CTF_int::LinModel< nparam >::~LinModel ( )

Definition at line 159 of file model.cxx.

References CTF_int::cdealloc().

Member Function Documentation

template<int nparam>
void CTF_int::LinModel< nparam >::dump_data ( std::string  path)
virtual

dump model data to a file

Reimplemented from CTF_int::Model.

Definition at line 686 of file model.cxx.

References ctf.core::np(), ctf.core::rank(), and ctf.core::string.

Referenced by CTF_int::CubicModel< nparam >::dump_data().

template<int nparam>
double CTF_int::LinModel< nparam >::est_time ( double const *  param)
template<int nparam>
double * CTF_int::LinModel< nparam >::get_coeff ( )

return the turned model coefficients

Definition at line 556 of file model.cxx.

Referenced by CTF_int::CubicModel< nparam >::get_coeff().

template<int nparam>
void CTF_int::LinModel< nparam >::load_coeff ( std::string  file_name)
virtual

load model coefficients from file

Parameters
[in]file_namethe file we wish to load model coefficients from

Reimplemented from CTF_int::Model.

Definition at line 622 of file model.cxx.

References ctf.core::string.

Referenced by CTF_int::CubicModel< nparam >::load_coeff().

template<int nparam>
void CTF_int::LinModel< nparam >::observe ( double const *  time_param)

records observation consisting of execution time and nparam paramter values

Parameters
[in]time_paramarray of size nparam+1 of form [exe_sec,val_1,val_2,...,val_nparam]

Definition at line 168 of file model.cxx.

Referenced by CTF_int::CommData::all_to_allv(), CTF_int::CommData::allred(), CTF_int::CommData::bcast(), CTF_int::block_reshuffle(), CTF_int::CubicModel< nparam >::observe(), CTF_int::CommData::red(), CTF_int::seq_tsr_spctr::run(), CTF_int::seq_tsr_ctr::run(), and CTF_int::spctr_pin_keys::run().

template<int nparam>
void CTF_int::LinModel< nparam >::print ( )
virtual

prints current parameter estimates

Reimplemented from CTF_int::Model.

Definition at line 539 of file model.cxx.

Referenced by CTF_int::CubicModel< nparam >::print().

template<int nparam>
void CTF_int::LinModel< nparam >::print_uo ( )
virtual

prints time estimate errors

Reimplemented from CTF_int::Model.

Definition at line 550 of file model.cxx.

Referenced by CTF_int::CubicModel< nparam >::print_uo().

template<int nparam>
bool CTF_int::LinModel< nparam >::should_observe ( double const *  time_param)

decides whether the current instance should be observed

Parameters
[in]time_paramarray of size nparam+1 of form [exe_sec,val_1,val_2,...,val_nparam]

Definition at line 215 of file model.cxx.

References ASSERT.

Referenced by CTF_int::CommData::all_to_allv(), CTF_int::CommData::allred(), CTF_int::CommData::bcast(), CTF_int::block_reshuffle(), CTF_int::CommData::red(), CTF_int::seq_tsr_spctr::run(), CTF_int::seq_tsr_ctr::run(), and CTF_int::CubicModel< nparam >::should_observe().

template<int nparam>
void CTF_int::LinModel< nparam >::update ( MPI_Comm  cm)
virtual

updates model based on observarions

Parameters
[in]cmcommunicator across which we should synchronize model (collect observations)

Reimplemented from CTF_int::Model.

Definition at line 227 of file model.cxx.

References CTF_int::alloc(), ctf.core::b, CTF_int::cdealloc(), CTF_int::cdgelsd(), CTF_int::cdgeqrf(), CTF_int::cdormqr(), CTF_int::lda_cpy(), ctf.core::np(), ctf.core::rank(), and REG_LAMBDA.

Referenced by CTF_int::CubicModel< nparam >::update().

template<int nparam>
void CTF_int::LinModel< nparam >::write_coeff ( std::string  file_name)
virtual

write model coefficients to file

Parameters
[in]file_namethe file we wish to write model coefficients to

Reimplemented from CTF_int::Model.

Definition at line 561 of file model.cxx.

References ctf.core::string.

Referenced by CTF_int::CubicModel< nparam >::write_coeff().

Field Documentation

template<int nparam>
double CTF_int::LinModel< nparam >::coeff_guess[nparam]

current coefficients for each paramter that the linear model will use

Definition at line 64 of file model.h.

template<int nparam>
int CTF_int::LinModel< nparam >::hist_size

the number of latest observations we want to consider when updating the model

Definition at line 58 of file model.h.

template<int nparam>
char* CTF_int::LinModel< nparam >::name

name of model

Definition at line 69 of file model.h.

template<int nparam>
double* CTF_int::LinModel< nparam >::time_param_mat

matrix containing parameter/time obervations, with hist_size columns and nmat_lda rows, stores the last hist_size paramstime obervations

Definition at line 62 of file model.h.


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