replicode
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
r_exec::_Mem Class Referenceabstract

#include <mem.h>

Inheritance diagram for r_exec::_Mem:
Inheritance graph
Collaboration diagram for r_exec::_Mem:
Collaboration graph

Classes

struct  JobQueue
 

Public Types

enum  State { NOT_STARTED = 0, RUNNING = 1, STOPPED = 2 }
 
enum  STDGroupID { STDIN = 0, STDOUT = 1 }
 
enum  TraceLevel {
  CST_IN = 0, CST_OUT = 1, MDL_IN = 2, MDL_OUT = 3,
  PRED_MON = 4, GOAL_MON = 5, MDL_REV = 6, HLP_INJ = 7
}
 

Public Member Functions

virtual ~_Mem ()
 
void init (uint64_t base_period, uint64_t reduction_core_count, uint64_t time_core_count, double mdl_inertia_sr_thr, uint64_t mdl_inertia_cnt_thr, double tpx_dsr_thr, uint64_t min_sim_time_horizon, uint64_t max_sim_time_horizon, double sim_time_horizon, uint64_t tpx_time_horizon, uint64_t perf_sampling_period, double float_tolerance, uint64_t time_tolerance, uint64_t primary_thz, uint64_t secondary_thz, bool debug, uint64_t ntf_mk_res, uint64_t goal_pred_success_res, uint64_t probe_level, uint64_t traces)
 
uint64_t get_probe_level () const
 
double get_mdl_inertia_sr_thr () const
 
uint64_t get_mdl_inertia_cnt_thr () const
 
double get_tpx_dsr_thr () const
 
uint64_t get_min_sim_time_horizon () const
 
uint64_t get_max_sim_time_horizon () const
 
uint64_t get_sim_time_horizon (uint64_t horizon) const
 
uint64_t get_tpx_time_horizon () const
 
uint64_t get_primary_thz () const
 
uint64_t get_secondary_thz () const
 
bool get_debug () const
 
uint64_t get_ntf_mk_res () const
 
uint64_t get_goal_pred_success_res (Group *host, uint64_t now, uint64_t time_to_live) const
 
Codeget_root () const
 
Codeget_stdin () const
 
Codeget_stdout () const
 
Codeget_self () const
 
State check_state ()
 
void start_core ()
 
void shutdown_core ()
 
bool load (std::vector< r_code::Code * > *objects, uint64_t stdin_oid, uint64_t stdout_oid, uint64_t self_oid)
 
uint64_t start ()
 
void stop ()
 
_ReductionJobpopReductionJob ()
 
void pushReductionJob (_ReductionJob *j)
 
TimeJobpopTimeJob ()
 
void pushTimeJob (TimeJob *j)
 
void inject (View *view)
 
void inject_async (View *view)
 
void inject_new_object (View *view)
 
void inject_existing_object (View *view, Code *object, Group *host)
 
void inject_null_program (Controller *c, Group *group, uint64_t time_to_live, bool take_past_inputs)
 
void inject_hlps (std::vector< View * > views, Group *destination)
 
void inject_notification (View *view, bool lock)
 
virtual Codecheck_existence (Code *object)=0
 
void propagate_sln (Code *object, double change, double source_sln_thr)
 
void inject_copy (View *view, Group *destination)
 
void register_reduction_job_latency (uint64_t latency)
 
void register_time_job_latency (uint64_t latency)
 
void inject_perf_stats ()
 
virtual void eject (View *view, uint16_t nodeID)
 
virtual void eject (Code *command)
 
virtual r_code::Code_build_object (Atom head) const =0
 
virtual r_code::Codebuild_object (Atom head) const =0
 
void unpack_hlp (Code *hlp) const
 
Codeunpack_fact (Code *hlp, uint16_t fact_index) const
 
Codeunpack_fact_object (Code *hlp, uint16_t fact_object_index) const
 
void pack_hlp (Code *hlp) const
 
void pack_fact (Code *fact, Code *hlp, uint16_t &write_index, std::vector< P< Code > > *references) const
 
void pack_fact_object (Code *fact_object, Code *hlp, uint16_t &write_index, std::vector< P< Code > > *references) const
 
Codeclone (Code *original) const
 
virtual r_comp::Imageget_objects ()=0
 
r_comp::Imageget_models ()
 
- Public Member Functions inherited from r_code::Mem
virtual Codebuild_object (SysObject *source) const =0
 
virtual void delete_object (Code *object)=0
 

Static Public Member Functions

static _MemGet ()
 
static std::ostream & Output (TraceLevel l)
 
- Static Public Member Functions inherited from r_code::Mem
static MemGet ()
 

Protected Member Functions

void init_timings (uint64_t now) const
 
void store (Code *object)
 
virtual void set_last_oid (int64_t oid)=0
 
virtual void bind (View *view)=0
 
 _Mem ()
 
void _unpack_code (Code *hlp, uint16_t fact_object_index, Code *fact_object, uint16_t read_index) const
 
- Protected Member Functions inherited from r_code::Mem
 Mem ()
 

Protected Attributes

uint64_t base_period
 
uint64_t reduction_core_count
 
uint64_t time_core_count
 
double mdl_inertia_sr_thr
 
uint64_t mdl_inertia_cnt_thr
 
double tpx_dsr_thr
 
uint64_t min_sim_time_horizon
 
uint64_t max_sim_time_horizon
 
double sim_time_horizon
 
uint64_t tpx_time_horizon
 
uint64_t perf_sampling_period
 
double float_tolerance
 
uint64_t time_tolerance
 
uint64_t primary_thz
 
uint64_t secondary_thz
 
bool debug
 
uint64_t ntf_mk_res
 
uint64_t goal_pred_success_res
 
uint64_t probe_level
 
JobQueue< _ReductionJobm_reductionJobQueue
 
JobQueue< TimeJobm_timeJobQueue
 
std::mutex m_timeJobMutex
 
std::mutex m_reductionJobMutex
 
std::vector< std::thread > m_coreThreads
 
uint64_t reduction_job_count
 
uint64_t reduction_job_avg_latency
 
uint64_t _reduction_job_avg_latency
 
uint64_t time_job_count
 
uint64_t time_job_avg_latency
 
uint64_t _time_job_avg_latency
 
std::atomic< uint64_tm_coreCount
 
std::condition_variable m_coresRunning
 
std::mutex m_coreCountMutex
 
State state
 
std::mutex m_stateMutex
 
r_code::list< P< Code > > objects
 
P< Group_root
 
Code_stdin
 
Code_stdout
 
Code_self
 
std::vector< Group * > initial_groups
 
bool deleted
 
ostream * debug_streams [8]
 

Static Protected Attributes

static const uint64_t DebugStreamCount = 8
 
- Static Protected Attributes inherited from r_code::Mem
static MemSingleton = NULL
 

Member Enumeration Documentation

Enumerator
NOT_STARTED 
RUNNING 
STOPPED 
Enumerator
STDIN 
STDOUT 
Enumerator
CST_IN 
CST_OUT 
MDL_IN 
MDL_OUT 
PRED_MON 
GOAL_MON 
MDL_REV 
HLP_INJ 

Constructor & Destructor Documentation

r_exec::_Mem::_Mem ( )
protected

Here is the call graph for this function:

r_exec::_Mem::~_Mem ( )
virtual

Member Function Documentation

virtual r_code::Code* r_exec::_Mem::_build_object ( Atom  head) const
pure virtual

Here is the caller graph for this function:

void r_exec::_Mem::_unpack_code ( Code hlp,
uint16_t  fact_object_index,
Code fact_object,
uint16_t  read_index 
) const
protected

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void r_exec::_Mem::bind ( View view)
protectedpure virtual

Implemented in r_exec::MemVolatile, and r_exec::MemStatic.

Here is the caller graph for this function:

virtual r_code::Code* r_exec::_Mem::build_object ( Atom  head) const
pure virtual

Here is the caller graph for this function:

virtual Code* r_exec::_Mem::check_existence ( Code object)
pure virtual
_Mem::State r_exec::_Mem::check_state ( )

Here is the caller graph for this function:

Code * r_exec::_Mem::clone ( Code original) const

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::eject ( View view,
uint16_t  nodeID 
)
virtual

Here is the caller graph for this function:

void r_exec::_Mem::eject ( Code command)
virtual
static _Mem* r_exec::_Mem::Get ( )
inlinestatic
bool r_exec::_Mem::get_debug ( ) const
inline

Here is the call graph for this function:

uint64_t r_exec::_Mem::get_goal_pred_success_res ( Group host,
uint64_t  now,
uint64_t  time_to_live 
) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t r_exec::_Mem::get_max_sim_time_horizon ( ) const
inline

Here is the caller graph for this function:

uint64_t r_exec::_Mem::get_mdl_inertia_cnt_thr ( ) const
inline

Here is the caller graph for this function:

double r_exec::_Mem::get_mdl_inertia_sr_thr ( ) const
inline
uint64_t r_exec::_Mem::get_min_sim_time_horizon ( ) const
inline

Here is the caller graph for this function:

r_comp::Image * r_exec::_Mem::get_models ( )

Here is the call graph for this function:

uint64_t r_exec::_Mem::get_ntf_mk_res ( ) const
inline
virtual r_comp::Image* r_exec::_Mem::get_objects ( )
pure virtual

Implemented in r_exec::MemVolatile, and r_exec::MemStatic.

uint64_t r_exec::_Mem::get_primary_thz ( ) const
inline
uint64_t r_exec::_Mem::get_probe_level ( ) const
inline

Here is the caller graph for this function:

Code * r_exec::_Mem::get_root ( ) const
uint64_t r_exec::_Mem::get_secondary_thz ( ) const
inline
Code * r_exec::_Mem::get_self ( ) const

Here is the caller graph for this function:

uint64_t r_exec::_Mem::get_sim_time_horizon ( uint64_t  horizon) const
inline

Here is the caller graph for this function:

Code * r_exec::_Mem::get_stdin ( ) const
Code * r_exec::_Mem::get_stdout ( ) const
double r_exec::_Mem::get_tpx_dsr_thr ( ) const
inline

Here is the caller graph for this function:

uint64_t r_exec::_Mem::get_tpx_time_horizon ( ) const
inline
void r_exec::_Mem::init ( uint64_t  base_period,
uint64_t  reduction_core_count,
uint64_t  time_core_count,
double  mdl_inertia_sr_thr,
uint64_t  mdl_inertia_cnt_thr,
double  tpx_dsr_thr,
uint64_t  min_sim_time_horizon,
uint64_t  max_sim_time_horizon,
double  sim_time_horizon,
uint64_t  tpx_time_horizon,
uint64_t  perf_sampling_period,
double  float_tolerance,
uint64_t  time_tolerance,
uint64_t  primary_thz,
uint64_t  secondary_thz,
bool  debug,
uint64_t  ntf_mk_res,
uint64_t  goal_pred_success_res,
uint64_t  probe_level,
uint64_t  traces 
)
void r_exec::_Mem::init_timings ( uint64_t  now) const
protected

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::inject ( View view)

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::inject_async ( View view)

Here is the call graph for this function:

void r_exec::_Mem::inject_copy ( View view,
Group destination 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::inject_existing_object ( View view,
Code object,
Group host 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::inject_hlps ( std::vector< View * >  views,
Group destination 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::inject_new_object ( View view)

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::inject_notification ( View view,
bool  lock 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::inject_null_program ( Controller c,
Group group,
uint64_t  time_to_live,
bool  take_past_inputs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::inject_perf_stats ( )

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_exec::_Mem::load ( std::vector< r_code::Code * > *  objects,
uint64_t  stdin_oid,
uint64_t  stdout_oid,
uint64_t  self_oid 
)

call before start; no mod/set/eje will be executed (only inj); no cov at init time.

Here is the call graph for this function:

std::ostream & r_exec::_Mem::Output ( TraceLevel  l)
static

Here is the call graph for this function:

void r_exec::_Mem::pack_fact ( Code fact,
Code hlp,
uint16_t &  write_index,
std::vector< P< Code > > *  references 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::pack_fact_object ( Code fact_object,
Code hlp,
uint16_t &  write_index,
std::vector< P< Code > > *  references 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::pack_hlp ( Code hlp) const

Here is the call graph for this function:

Here is the caller graph for this function:

_ReductionJob * r_exec::_Mem::popReductionJob ( )

Here is the caller graph for this function:

TimeJob * r_exec::_Mem::popTimeJob ( )

Here is the caller graph for this function:

void r_exec::_Mem::propagate_sln ( Code object,
double  change,
double  source_sln_thr 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::pushReductionJob ( _ReductionJob j)

Here is the caller graph for this function:

void r_exec::_Mem::pushTimeJob ( r_exec::TimeJob j)

Here is the caller graph for this function:

void r_exec::_Mem::register_reduction_job_latency ( uint64_t  latency)

Here is the caller graph for this function:

void r_exec::_Mem::register_time_job_latency ( uint64_t  latency)

Here is the caller graph for this function:

virtual void r_exec::_Mem::set_last_oid ( int64_t  oid)
protectedpure virtual

Implemented in r_exec::MemVolatile, and r_exec::MemStatic.

Here is the caller graph for this function:

void r_exec::_Mem::shutdown_core ( )

Here is the caller graph for this function:

uint64_t r_exec::_Mem::start ( )

Here is the call graph for this function:

void r_exec::_Mem::start_core ( )

Here is the caller graph for this function:

void r_exec::_Mem::stop ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::store ( Code object)
protected

Here is the call graph for this function:

Here is the caller graph for this function:

Code * r_exec::_Mem::unpack_fact ( Code hlp,
uint16_t  fact_index 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

Code * r_exec::_Mem::unpack_fact_object ( Code hlp,
uint16_t  fact_object_index 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::_Mem::unpack_hlp ( Code hlp) const

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

uint64_t r_exec::_Mem::_reduction_job_avg_latency
protected
P<Group> r_exec::_Mem::_root
protected
Code* r_exec::_Mem::_self
protected
Code* r_exec::_Mem::_stdin
protected
Code* r_exec::_Mem::_stdout
protected
uint64_t r_exec::_Mem::_time_job_avg_latency
protected
uint64_t r_exec::_Mem::base_period
protected
bool r_exec::_Mem::debug
protected
ostream* r_exec::_Mem::debug_streams[8]
protected
const uint64_t r_exec::_Mem::DebugStreamCount = 8
staticprotected
bool r_exec::_Mem::deleted
protected
double r_exec::_Mem::float_tolerance
protected
uint64_t r_exec::_Mem::goal_pred_success_res
protected
std::vector<Group *> r_exec::_Mem::initial_groups
protected
std::atomic<uint64_t> r_exec::_Mem::m_coreCount
protected
std::mutex r_exec::_Mem::m_coreCountMutex
protected
std::condition_variable r_exec::_Mem::m_coresRunning
protected
std::vector<std::thread> r_exec::_Mem::m_coreThreads
protected
std::mutex r_exec::_Mem::m_reductionJobMutex
protected
JobQueue<_ReductionJob> r_exec::_Mem::m_reductionJobQueue
protected
std::mutex r_exec::_Mem::m_stateMutex
protected
std::mutex r_exec::_Mem::m_timeJobMutex
protected
JobQueue<TimeJob> r_exec::_Mem::m_timeJobQueue
protected
uint64_t r_exec::_Mem::max_sim_time_horizon
protected
uint64_t r_exec::_Mem::mdl_inertia_cnt_thr
protected
double r_exec::_Mem::mdl_inertia_sr_thr
protected
uint64_t r_exec::_Mem::min_sim_time_horizon
protected
uint64_t r_exec::_Mem::ntf_mk_res
protected
r_code::list<P<Code> > r_exec::_Mem::objects
protected
uint64_t r_exec::_Mem::perf_sampling_period
protected
uint64_t r_exec::_Mem::primary_thz
protected
uint64_t r_exec::_Mem::probe_level
protected
uint64_t r_exec::_Mem::reduction_core_count
protected
uint64_t r_exec::_Mem::reduction_job_avg_latency
protected
uint64_t r_exec::_Mem::reduction_job_count
protected
uint64_t r_exec::_Mem::secondary_thz
protected
double r_exec::_Mem::sim_time_horizon
protected
State r_exec::_Mem::state
protected
uint64_t r_exec::_Mem::time_core_count
protected
uint64_t r_exec::_Mem::time_job_avg_latency
protected
uint64_t r_exec::_Mem::time_job_count
protected
uint64_t r_exec::_Mem::time_tolerance
protected
double r_exec::_Mem::tpx_dsr_thr
protected
uint64_t r_exec::_Mem::tpx_time_horizon
protected

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