SST/macro
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
sstmac::native::event_container Class Referenceabstract

An event manager base class using standard containers. More...

#include <event_container.h>

Inheritance diagram for sstmac::native::event_container:
Inheritance graph
Collaboration diagram for sstmac::native::event_container:
Collaboration graph

Public Member Functions

virtual ~event_container () throw ()
 Goodbye. More...
 
virtual void run ()
 Run the eventmanager. More...
 
virtual void init_factory_params (sprockit::sim_parameters *params)
 
- Public Member Functions inherited from sstmac::event_manager
virtual std::string to_string () const
 
bool is_complete ()
 
virtual ~event_manager ()
 Goodbye. More...
 
virtual void clear (timestamp zero_time=timestamp(0))=0
 Clear all events and set time back to a zero of your choice. More...
 
timestamp now () const
 
void register_stat (stat_collector *stat, bool reduce_all=true, bool dump_all=false, bool dump_main=true)
 
stat_collectorregister_thread_unique_stat (stat_collector *stat, bool reduce_all=true, bool dump_all=false, bool dump_main=true)
 
virtual void cancel_all_messages (event_loc_id canceled_loc)=0
 
partitiontopology_partition () const
 
parallel_runtimeruntime () const
 
void finish_stats ()
 
virtual void finish_stats (stat_collector *main, const std::string &name, timestamp end)
 
void stop ()
 
int me () const
 
int worker_id () const
 
int nproc () const
 
int nworker () const
 
virtual void ipc_schedule (timestamp t, event_loc_id dst, event_loc_id src, uint32_t seqnum, event *ev)
 
virtual void multithread_schedule (int srcthread, int dstthread, uint32_t seqnum, event_queue_entry *ev)
 
virtual int lpid () const
 
int thread_id () const
 
int nthread () const
 
virtual event_managerev_man_for_thread (int thread_id) const
 
virtual void set_interconnect (hw::interconnect *interconn)
 
virtual void schedule_stop (timestamp until)
 
- Public Member Functions inherited from sprockit::factory_type
virtual void init_factory_params (sim_parameters *params)
 
virtual void finalize_init ()
 

Protected Member Functions

 event_container (parallel_runtime *rt)
 
virtual void do_next_event ()
 
virtual event_queue_entrypop_next_event ()=0
 
virtual bool empty () const =0
 
virtual void add_event (event_queue_entry *ev)=0
 Called by schedule. Child class must implement. More...
 
virtual bool vote_to_terminate ()
 
void schedule (timestamp start_time, uint32_t seqnum, event_queue_entry *ev)
 Set off the given eventhandler at the given time. More...
 
void finish ()
 Called at end of run(). More...
 
- Protected Member Functions inherited from sstmac::event_manager
 event_manager (parallel_runtime *rt)
 
void set_now (const timestamp &ts)
 

Protected Attributes

bool running_
 Sentinel to track whether the event handler is running or not. More...
 
timestamp last_update_sim_
 Time of last event executed. More...
 
- Protected Attributes inherited from sstmac::event_manager
bool complete_
 
bool stopped_
 
bool finish_on_stop_
 
parallel_runtimert_
 
int thread_id_
 
int me_
 
int nproc_
 
int nthread_
 

Private Attributes

bool event_rate_reporting_
 
int event_rate_window_
 

Additional Inherited Members

- Static Public Member Functions inherited from sstmac::event_manager
static int current_thread_id ()
 
- Static Public Attributes inherited from sstmac::event_manager
static event_managerglobal
 
- Static Protected Attributes inherited from sstmac::event_manager
static std::vector< pthread_tpthreads_
 
static std::vector< pthread_attr_tpthread_attrs_
 

Detailed Description

An event manager base class using standard containers.

The template parameter queue_t is only required to implement the empty() and size() operations. Methods which need to access or modify elements, such as do_one_event() and add_event(), are virtual and must be implemented by a child class, providing flexibility to the interface that queue_t must provide. In this way, eventmanagers using both standard containers and container adaptors can share much of their implementation despite differing access and modification interfaces.

Definition at line 33 of file event_container.h.

Constructor & Destructor Documentation

virtual sstmac::native::event_container::~event_container ( )
throw (
)
inlinevirtual

Goodbye.

Definition at line 42 of file event_container.h.

References add_event(), do_next_event(), empty(), event_container(), init_factory_params(), pop_next_event(), and run().

Here is the call graph for this function:

sstmac::native::event_container::event_container ( parallel_runtime rt)
protected

Referenced by ~event_container().

Member Function Documentation

virtual void sstmac::native::event_container::add_event ( event_queue_entry ev)
protectedpure virtual

Called by schedule. Child class must implement.

Implemented in sstmac::native::event_heap, and sstmac::native::event_map.

Referenced by ~event_container().

virtual void sstmac::native::event_container::do_next_event ( )
protectedvirtual
virtual bool sstmac::native::event_container::empty ( ) const
protectedpure virtual
void sstmac::native::event_container::finish ( )
protected

Called at end of run().

Calls finish() on finishers_ and calls finish_stats().

virtual void sstmac::native::event_container::init_factory_params ( sprockit::sim_parameters *  params)
virtual
virtual event_queue_entry* sstmac::native::event_container::pop_next_event ( )
protectedpure virtual
virtual void sstmac::native::event_container::run ( )
virtual

Run the eventmanager.

The eventmanager shall return control when no more messages remain.

Implements sstmac::event_manager.

Reimplemented in sstmac::native::multithreaded_event_container, sstmac::native::clock_cycle_event_map, and sstmac::native::multithreaded_subcontainer.

Referenced by ~event_container().

void sstmac::native::event_container::schedule ( timestamp  start_time,
uint32_t  seqnum,
event_queue_entry ev 
)
protectedvirtual

Set off the given eventhandler at the given time.

Implements sstmac::event_manager.

virtual bool sstmac::native::event_container::vote_to_terminate ( )
inlineprotectedvirtual

Reimplemented in sstmac::native::clock_cycle_event_map.

Definition at line 69 of file event_container.h.

Member Data Documentation

bool sstmac::native::event_container::event_rate_reporting_
private

Definition at line 36 of file event_container.h.

int sstmac::native::event_container::event_rate_window_
private

Definition at line 37 of file event_container.h.

timestamp sstmac::native::event_container::last_update_sim_
protected

Time of last event executed.

Definition at line 77 of file event_container.h.

bool sstmac::native::event_container::running_
protected

Sentinel to track whether the event handler is running or not.

Definition at line 74 of file event_container.h.


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