SST/macro
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
sstmac::event_scheduler Class Reference

The interface for something that can schedule messages. More...

#include <event_scheduler.h>

Inheritance diagram for sstmac::event_scheduler:
Inheritance graph
Collaboration diagram for sstmac::event_scheduler:
Collaboration graph

Public Member Functions

virtual ~event_scheduler ()
 
virtual std::string to_string () const
 
virtual void handle (event *ev)
 
void cancel_all_messages ()
 
void ipc_schedule (timestamp t, event_handler *handler, event *ev)
 ipc_schedule Should only be called on stub handlers for which handler->ipc_handler() returns true More...
 
void schedule (timestamp t, event_handler *handler, event *ev)
 Add an event to the event queue, where msg will get delivered to handler at time t. More...
 
void schedule (timestamp t, event_queue_entry *ev)
 
void schedule_now (event_queue_entry *ev)
 
void schedule_now (event_handler *handler, event *ev)
 
void schedule_delay (timestamp delay, event_handler *handler, event *ev)
 
void schedule_delay (timestamp delay, event_queue_entry *ev)
 
void send_self_event (timestamp arrival, event *ev)
 
void send_delayed_self_event (timestamp delay, event *ev)
 
void send_now_self_event (event *ev)
 
void send_self_event_queue (timestamp arrival, event_queue_entry *ev)
 
void send_delayed_self_event_queue (timestamp delay, event_queue_entry *ev)
 
void send_now_self_event_queue (event_queue_entry *ev)
 
void register_stat (stat_collector *coll)
 
virtual void set_event_manager (event_manager *m)
 Set the eventmanager for this scheduler. More...
 
event_managerevent_mgr () const
 
timestamp now () const
 get the current time More...
 
int nthread () const
 
- Public Member Functions inherited from sstmac::event_handler
virtual ~event_handler ()
 
event_loc_id event_location () const
 
virtual bool ipc_handler () const
 Whether an event handler is a "fake" handler that represents logical process boundary. More...
 
int thread_id () const
 
virtual void deadlock_check (event *ev)
 
virtual void deadlock_check ()
 

Protected Member Functions

 event_scheduler ()
 
- Protected Member Functions inherited from sstmac::event_handler
 event_handler ()
 
void init_loc_id (event_loc_id id)
 
void init_thread_id (int id)
 

Protected Attributes

uint32_t seqnum_
 

Private Member Functions

void sanity_check (timestamp t)
 
void multithread_schedule (int src_thread, int dst_thread, timestamp t, event_queue_entry *ev)
 

Private Attributes

event_managereventman_
 

Additional Inherited Members

- Static Public Attributes inherited from sstmac::event_handler
static const int null_lpid = -1
 
static const int null_threadid = -1
 

Detailed Description

The interface for something that can schedule messages.

Definition at line 52 of file event_scheduler.h.

Constructor & Destructor Documentation

virtual sstmac::event_scheduler::~event_scheduler ( )
inlinevirtual

Definition at line 61 of file event_scheduler.h.

sstmac::event_scheduler::event_scheduler ( )
protected

Referenced by nthread(), and to_string().

Member Function Documentation

void sstmac::event_scheduler::cancel_all_messages ( )

Referenced by to_string().

event_manager* sstmac::event_scheduler::event_mgr ( ) const
inline

Definition at line 180 of file event_scheduler.h.

References eventman_.

virtual void sstmac::event_scheduler::handle ( event ev)
virtual
void sstmac::event_scheduler::ipc_schedule ( timestamp  t,
event_handler handler,
event ev 
)

ipc_schedule Should only be called on stub handlers for which handler->ipc_handler() returns true

Parameters
tThe time the event will run at
handlerThe handler to receive the event. This should always be a stub for a real handler on a remote process.
evThe event to deliver

Referenced by to_string().

void sstmac::event_scheduler::multithread_schedule ( int  src_thread,
int  dst_thread,
timestamp  t,
event_queue_entry ev 
)
private
timestamp sstmac::event_scheduler::now ( ) const
inline

get the current time

Returns
a timestamp

Definition at line 189 of file event_scheduler.h.

References eventman_, and sstmac::event_manager::now().

Referenced by to_string().

Here is the call graph for this function:

int sstmac::event_scheduler::nthread ( ) const
inline

Definition at line 194 of file event_scheduler.h.

References event_scheduler(), eventman_, and sstmac::event_manager::nthread().

Here is the call graph for this function:

void sstmac::event_scheduler::register_stat ( stat_collector coll)

Referenced by to_string().

void sstmac::event_scheduler::sanity_check ( timestamp  t)
private
void sstmac::event_scheduler::schedule ( timestamp  t,
event_handler handler,
event ev 
)

Add an event to the event queue, where msg will get delivered to handler at time t.

Parameters
tTime at which the event should happen
handlerThe handler for the event
msgThe message to deliver to the handler

Referenced by to_string(), and sstmac::event_subscheduler::to_string().

void sstmac::event_scheduler::schedule ( timestamp  t,
event_queue_entry ev 
)
void sstmac::event_scheduler::schedule_delay ( timestamp  delay,
event_handler handler,
event ev 
)
void sstmac::event_scheduler::schedule_delay ( timestamp  delay,
event_queue_entry ev 
)
void sstmac::event_scheduler::schedule_now ( event_queue_entry ev)
void sstmac::event_scheduler::schedule_now ( event_handler handler,
event ev 
)
void sstmac::event_scheduler::send_delayed_self_event ( timestamp  delay,
event ev 
)
void sstmac::event_scheduler::send_delayed_self_event_queue ( timestamp  delay,
event_queue_entry ev 
)
void sstmac::event_scheduler::send_now_self_event ( event ev)
void sstmac::event_scheduler::send_now_self_event_queue ( event_queue_entry ev)
void sstmac::event_scheduler::send_self_event ( timestamp  arrival,
event ev 
)
void sstmac::event_scheduler::send_self_event_queue ( timestamp  arrival,
event_queue_entry ev 
)
virtual void sstmac::event_scheduler::set_event_manager ( event_manager m)
virtual

Set the eventmanager for this scheduler.

Unfortunately, this always has to be called after an event_scheduler is constructed.

Parameters
mthe simulation eventmanager

Reimplemented in sstmac::hw::node, and sstmac::hw::simple_node.

Referenced by to_string().

virtual std::string sstmac::event_scheduler::to_string ( ) const
inlinevirtual

Member Data Documentation

event_manager* sstmac::event_scheduler::eventman_
private

Definition at line 211 of file event_scheduler.h.

Referenced by event_mgr(), now(), and nthread().

uint32_t sstmac::event_scheduler::seqnum_
protected

Definition at line 201 of file event_scheduler.h.


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