SST/macro
|
#include <operating_system.h>
Classes | |
struct | os_thread_context |
Public Member Functions | |
virtual | ~operating_system () |
virtual void | init_factory_params (sprockit::sim_parameters *params) |
virtual void | finalize_init () |
void | execute (ami::COMP_FUNC, event *data, key::category cat=key::general) |
execute Execute a compute function. More... | |
void | execute (ami::COMM_FUNC func, message *data) |
execute Execute a communication function. More... | |
void | execute_kernel (ami::COMM_FUNC func, message *data) |
execute Execute a compute function. More... | |
void | execute_kernel (ami::COMP_FUNC func, event *data, callback *cb) |
execute Execute a communication function. More... | |
void | async_kernel (ami::SERVICE_FUNC func, event *data) |
execute Enqueue an operation to perform This function takes place in "kernel" land and will never block and context switch. More... | |
timestamp | block (key *req) |
timestamp | unblock (key *req) |
void | start_thread (thread *t) |
void | join_thread (thread *t) |
void | complete_thread (bool succ) |
void | register_lib (void *owner, library *lib) |
void | unregister_all_libs (void *owner) |
library * | lib (const std::string &name) const |
void | set_ncores (int ncores, int nsocket) |
void | set_event_parent (event_scheduler *man) |
Set the eventmanager for this scheduler. More... | |
void | add_application (app *a) |
void | start_app (app *a) |
void | handle_event (event *ev) |
std::list< app * > | app_ptrs (app_id aid) |
app * | app_ptr (software_id sid) |
thread_data_t | current_context () const |
void | print_libs (std::ostream &os=std::cout) const |
long | current_threadid () const |
void | set_node (sstmac::hw::node *n) |
hw::node * | node () const |
node_id | addr () const |
void | set_addr (node_id addr) |
void | start_api_call () |
void | schedule_timeout (timestamp delay, key *k) |
void | free_thread_stack (void *stack) |
sprockit::sim_parameters * | params () const |
void | sleep (timestamp t) |
void | compute (timestamp t) |
void | kill_node () |
Public Member Functions inherited from sstmac::event_subscheduler | |
event_subscheduler () | |
timestamp | now () const |
get the current time More... | |
virtual std::string | to_string () const |
virtual void | handle (event *ev) |
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) |
event_scheduler * | parent () 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 () |
Static Public Member Functions | |
static operating_system * | construct (sprockit::sim_parameters *params) |
static os_thread_context & | static_os_thread_context () |
static void | delete_statics () |
static void | switch_to_context (int aid, int tid) |
static operating_system * | current_os () |
static app_id | current_aid () |
static task_id | current_tid () |
static library * | current_library (const std::string &name) |
static node_id | current_node_id () |
static node_id | remote_node (int tid) |
static void | stack_check () |
static void | shutdown () |
static size_t | stacksize () |
static thread * | current_thread () |
static void | simulation_done () |
Private Member Functions | |
operating_system () | |
void | add_thread (thread *t) |
void | switch_to_thread (thread_data_t tothread) |
void | init_threading () |
void | init_services () |
os_thread_context & | current_os_thread_context () |
void | register_lib (library *lib) |
void | unregister_lib (library *lib) |
void | local_shutdown () |
Private Attributes | |
hw::node * | node_ |
spkt_unordered_map< std::string, library * > | libs_ |
spkt_unordered_map< library *, int > | lib_refcounts_ |
spkt_unordered_map< void *, std::list< library * > > | libs_by_owner_ |
spkt_unordered_set< std::string > | deleted_libs_ |
node_id | my_addr_ |
std::list< thread * > | threads_ |
std::vector< std::string > | startup_libs_ |
std::list< api * > | services_ |
std::stack< thread_data_t > | threadstack_ |
int | current_thread_id_ |
int | next_msg_id_ |
spkt_unordered_map< task_id, long > | task_to_thread_ |
std::queue< thread * > | to_awake_ |
threading_interface * | des_context_ |
The caller context (main DES thread). More... | |
sprockit::sim_parameters * | params_ |
compute_scheduler * | compute_sched_ |
ftq_calendar * | ftq_trace_ |
event_trace * | event_trace_ |
Static Private Attributes | |
static graph_viz * | call_graph_ |
static operating_system::os_thread_context | os_thread_context_ |
static size_t | stacksize_ |
static bool | cxa_finalizing_ |
static os_thread_context | cxa_finalize_context_ |
Friends | |
class | service |
class | thread |
Additional Inherited Members | |
Static Public Attributes inherited from sstmac::event_handler | |
static const int | null_lpid = -1 |
static const int | null_threadid = -1 |
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 inherited from sstmac::event_subscheduler | |
event_scheduler * | parent_ |
Definition at line 48 of file operating_system.h.
|
virtual |
|
private |
Referenced by params().
|
inline |
app* sstmac::sw::operating_system::app_ptr | ( | software_id | sid | ) |
Referenced by execute().
void sstmac::sw::operating_system::async_kernel | ( | ami::SERVICE_FUNC | func, |
event * | data | ||
) |
execute Enqueue an operation to perform This function takes place in "kernel" land and will never block and context switch.
This function can therefore run on the main DES thread. The function must run asynchronously and immediately return with no virtual time advancing.
func | The function to perform |
data | Event carrying all the data describing the compute |
Referenced by execute().
void sstmac::sw::operating_system::complete_thread | ( | bool | succ | ) |
Referenced by execute().
|
static |
|
static |
|
inline |
Definition at line 229 of file operating_system.h.
References threadstack_.
|
static |
Referenced by static_os_thread_context().
|
static |
Referenced by static_os_thread_context().
|
static |
|
private |
Referenced by params().
|
static |
Referenced by Variable< T >::~Variable(), and VariablePtr< T >::~VariablePtr().
long sstmac::sw::operating_system::current_threadid | ( | ) | const |
Referenced by shutdown().
|
static |
|
static |
Referenced by static_os_thread_context().
void sstmac::sw::operating_system::execute | ( | ami::COMP_FUNC | , |
event * | data, | ||
key::category | cat = key::general |
||
) |
execute Execute a compute function.
This function MUST begin on a user-space thread since it may block and context switch until completion. To invoke compute operations for the main DES thread, use execute_kernel
func | The function to perform |
data | Event carrying all the data describing the compute |
cat | An optional category labeling the type of operation |
Referenced by static_os_thread_context().
|
inline |
execute Execute a communication function.
This function MUST begin on a user-space thread since it may block and context switch until completion. To invoke compute operations for the main DES thread, use execute_kernel
data | Event carrying all the data describing the compute |
Definition at line 136 of file operating_system.h.
References add_application(), app_ptr(), app_ptrs(), async_kernel(), block(), complete_thread(), execute_kernel(), handle_event(), join_thread(), lib(), register_lib(), set_event_parent(), set_ncores(), stack_check(), start_app(), start_thread(), unblock(), and unregister_all_libs().
void sstmac::sw::operating_system::execute_kernel | ( | ami::COMM_FUNC | func, |
message * | data | ||
) |
execute Execute a compute function.
This function takes place in "kernel" land and will never block and context switch. This function can therefore run on the main DES thread
func | The function to perform |
data | Event carrying all the data describing the compute |
Referenced by execute().
void sstmac::sw::operating_system::execute_kernel | ( | ami::COMP_FUNC | func, |
event * | data, | ||
callback * | cb | ||
) |
execute Execute a communication function.
This function takes place in "kernel" land and will never block and context switch. This function can therefore run on the main DES thread
func | The function to perform |
data | Event carrying all the data describing the compute |
cb | The callback to invoke when the kernel is complete |
|
virtual |
Referenced by static_os_thread_context().
void sstmac::sw::operating_system::free_thread_stack | ( | void * | stack | ) |
Referenced by set_addr().
|
virtual |
Referenced by static_os_thread_context().
|
private |
Referenced by params().
|
private |
Referenced by params().
void sstmac::sw::operating_system::kill_node | ( | ) |
Referenced by params().
library* sstmac::sw::operating_system::lib | ( | const std::string & | name | ) | const |
Referenced by execute().
|
private |
Referenced by params(), and shutdown().
|
inline |
Definition at line 250 of file operating_system.h.
References node_.
|
inline |
Definition at line 286 of file operating_system.h.
References add_thread(), compute(), current_os_thread_context(), init_services(), init_threading(), kill_node(), local_shutdown(), operating_system(), params_, register_lib(), sleep(), switch_to_thread(), and unregister_lib().
Referenced by static_os_thread_context().
void sstmac::sw::operating_system::print_libs | ( | std::ostream & | os = std::cout | ) | const |
Referenced by shutdown().
void sstmac::sw::operating_system::register_lib | ( | void * | owner, |
library * | lib | ||
) |
|
private |
|
static |
Referenced by static_os_thread_context().
Referenced by set_addr().
|
inline |
Definition at line 260 of file operating_system.h.
References addr(), free_thread_stack(), sstmac::event_handler::init_loc_id(), my_addr_, schedule_timeout(), and start_api_call().
|
virtual |
Set the eventmanager for this scheduler.
Unfortunately, this always has to be called after an event_scheduler is constructed.
m | the simulation eventmanager |
Reimplemented from sstmac::event_subscheduler.
Referenced by execute().
void sstmac::sw::operating_system::set_ncores | ( | int | ncores, |
int | nsocket | ||
) |
Referenced by execute().
|
inline |
Definition at line 245 of file operating_system.h.
References node_.
|
inlinestatic |
Definition at line 234 of file operating_system.h.
References sstmac::sw::operating_system::os_thread_context::current_os, current_threadid(), local_shutdown(), and print_libs().
|
static |
Referenced by stacksize().
|
static |
Referenced by execute().
|
inlinestatic |
Definition at line 275 of file operating_system.h.
References sstmac::sw::operating_system::os_thread_context::current_thread, simulation_done(), and stacksize_.
void sstmac::sw::operating_system::start_api_call | ( | ) |
Referenced by set_addr().
|
inlinestatic |
Definition at line 70 of file operating_system.h.
References sstmac::sw::operating_system::os_thread_context::current_aid, current_library(), current_node_id(), sstmac::sw::operating_system::os_thread_context::current_os, sstmac::thread_info::current_physical_thread_id(), sstmac::sw::operating_system::os_thread_context::current_tid, cxa_finalizing_, delete_statics(), execute(), finalize_init(), sstmac::sw::key::general, init_factory_params(), os_thread_context_, params(), remote_node(), and switch_to_context().
|
static |
Referenced by static_os_thread_context().
|
private |
Referenced by params().
void sstmac::sw::operating_system::unregister_all_libs | ( | void * | owner | ) |
Referenced by execute().
|
friend |
Definition at line 51 of file operating_system.h.
|
friend |
Definition at line 52 of file operating_system.h.
|
staticprivate |
Definition at line 358 of file operating_system.h.
|
private |
Definition at line 356 of file operating_system.h.
|
private |
Definition at line 342 of file operating_system.h.
|
staticprivate |
Definition at line 378 of file operating_system.h.
|
staticprivate |
Definition at line 377 of file operating_system.h.
Referenced by static_os_thread_context().
|
private |
Definition at line 330 of file operating_system.h.
|
private |
The caller context (main DES thread).
We go back to this context on every context switch.
Definition at line 352 of file operating_system.h.
|
private |
Definition at line 362 of file operating_system.h.
|
private |
Definition at line 360 of file operating_system.h.
|
private |
Definition at line 328 of file operating_system.h.
|
private |
Definition at line 327 of file operating_system.h.
|
private |
Definition at line 329 of file operating_system.h.
|
private |
Definition at line 332 of file operating_system.h.
Referenced by addr(), and set_addr().
|
private |
Definition at line 344 of file operating_system.h.
|
private |
Definition at line 326 of file operating_system.h.
Referenced by node(), and set_node().
|
staticprivate |
Definition at line 367 of file operating_system.h.
Referenced by static_os_thread_context().
|
private |
Definition at line 354 of file operating_system.h.
Referenced by params().
|
private |
Definition at line 338 of file operating_system.h.
|
staticprivate |
Definition at line 376 of file operating_system.h.
Referenced by stacksize().
|
private |
Definition at line 336 of file operating_system.h.
|
private |
Definition at line 346 of file operating_system.h.
|
private |
Definition at line 334 of file operating_system.h.
|
private |
Definition at line 340 of file operating_system.h.
Referenced by current_context().
|
private |
Definition at line 348 of file operating_system.h.