230 likes | 336 Vues
SPEEDES (Synchronous Parallel Environment for Emulation and Discrete-Event Simulation) is a powerful framework that enables efficient simulation of complex systems, such as airspace operations and missile defense. It allows the modeling of simulation objects, which can change their states through events defined in C++ functions. SPEEDES operates under two main simulation modes: conservative and optimistic, enabling parallel computation with various nodes. The framework leverages an innovative event horizon model to manage events and supports dynamic object creation, although it has limitations related to state modification and language constraints.
E N D
SPEEDES Charles Lenk, James Timmerman
Outline • SPEEDES - What is it? • What has it been used for? • SPEEDES Object • SPEEDES Event • Example Code • Two Simulation Modes • Rollback • Parallel Computation • The Event Horizon • Advantages • Disadvantages • SPEEDES vs Time Warp • Contributions / Improvements
SPEEDES Synchronous Parallel Environment for Emulation and Discrete- Event Simulation
What has it been used for? • Airspace simulation • Missile defense
SPEEDES Object • Can be physical objects that change or move • The simulation object can be anything, as long as it can have events that change it • Objects inherit from SpSimObj
SPEEDES Event • An event is a C++ function that can modify the simulated object • You can schedule events to take place at a future time and SPEEDES takes care of applying the event Event: Butterfly flaps its wings Weather Object: State changed to hurricane
Example Code // S_HelloWorld.H #include "SpSimObj.H" #include "SpDefineSimObj.H" #include "SpDefineEvent.H" class S_HelloWorld : public SpSimObj { public: S_HelloWorld() {} virtual void Init(); void HelloWorldEvent(); }; DEFINE_SIMOBJ(S_HelloWorld, 1, SCATTER); DEFINE_SIMOBJ_EVENT_0_ARG(HelloWorldEvent, S_HelloWorld, HelloWorldEvent);
Example Code Continued // S_HelloWorld.C #include "S_HelloWorld.H" void S_HelloWorld::Init() { if (SpGetSimObjKindId() == 0) { SCHEDULE_HelloWorldEvent(0.0, SpGetObjHandle()); } } void S_HelloWorld::HelloWorldEvent() { cout << "Hello World" << endl; }
Two Simulation Modes • Conservative • Limits how simulation objects interact • Guarantees that no rollback is ever required • Optimistic • Nodes process events with the hope that an event with an earlier timestamp won’t arrive • Rollbacks may be required
Rollback SPEEDES provides special rollbackable data types • RB_int • RB_double • RB_SpString • RB_voidPtr • RB_ostream • RB_cout
Parallel Computation • One SPEEDES node is one thread of execution • Nodes can be distributed • Multiple CPUs • Multiple networked systems • You can specify the number of nodes as a parameter to the resulting (compiled) program
How does SPEEDES split the work? • Objects can be assigned to nodes (SPEEDES threads) • Nodes execute the events on their respective objects
The Event Horizon • What is it? • Black holes hold on to matter and energy • SPEEDES holds on to messages
Event Horizon in Action • Events in white have been executed this cycle • Events in grey are unreleased messages • Events in black are already scheduled future events
Event Horizon Example Events being executed Unreleased Messages O1 O2 O3
Event Horizon Example Events being executed Unreleased Messages O1 O2 O3
Event Horizon Example Events being executed Unreleased Messages O1 O2 O3
Event Horizon Example Events being executed Unreleased Messages O1 O2 O3
Advantages • SPEEDES is fast • Less computationally expensive than time-stepped simulations • Data structures informed by the event horizon • Reduced anti-messages, no cascading rollback • Supports dynamic simulation object creation • Multiple modes of execution • Conservative • Optimistic
Disadvantages / Limitations • An event can only modify the state of one object • Limited to C++ • Not truly risk-free • Anti-messages • Rollbacks
Research Discussion Contributions: • The event horizon model used by SPEEDES can be leveraged by other discrete-event simulators • Increases data structure performance • Greatly reduces anti-messages Suggested Improvements: • Notes on SPEEDES’s event horizon compromises • Comparisons between SPEEDES’s and other’s data structures