200 likes | 332 Views
Building Parallel Time-Constrained HLA Federates: A Case Study with the Parsec Parallel Simulation Language. C. D. Pham R. L. Bagrodia Department of Computer Science University of California, Los Angeles. Winter Simulation Conference (WSC’98), Washington D.C. Tuesday, December 15th, 1998.
E N D
Building Parallel Time-Constrained HLA Federates: A Case Study with the Parsec Parallel Simulation Language C. D. Pham R. L. Bagrodia Department of Computer Science University of California, Los Angeles Winter Simulation Conference (WSC’98), Washington D.C. Tuesday, December 15th, 1998
Outline Overview of HLA and Parallel simulation The rational behind this work The Parsec Language Architecture of a parallel federate with Parsec Conclusions
Federation Logical simulations real-time players tools simulator Runtime Infrastructure (RTI) Display, statistics... Federation Management Declaration Management Object Management Ownership Management Time Management Data Distribution Management Hardware, human-in-the loop real-time simulators The HLA framework • Without HLA, simulations are mostly independents and interoperability is not easy. • The High Level Architecture calls for a federation of simulations to achieve interoperability and reuse of software. 10 Rules for the federation and the federates behavior An Interface Specification An Object Model Template to describe the simulation objects
Real system HLA: How to interoperate? communication node throughput, position Interoperability is achieved by subscription and publication of object’s attributes between the federates in the federation execution. Objects can have attributes radio transmitter power, frequency wired node # links
subscribeObjectClass Attribute publishObjectClass reflectAttributesValues startUpdates HLA: Publication and Subscription • Publication of an attribute means a federate can produce values for that attribute. • Subscription to an attribute means a federate wishes to receive values for that attribute. I can provide the position for F14 planes I want to know the position of all F14 planes. Federate Federate Ambassador Federate Federate Ambassador RTI Ambassador RTI Ambassador updateAttributeValues RTI
Time-constrained Time-regulated NO! FEDERATE FEDERATE 21 25 25 27 RO Lookahead = 2 29 RO Ask for time advance grant RO 23 RO 25 RTI RTI Compute a Lower Bound Time Stamp (LBTS) 27 29 HLA: Time management HLA includes advanced time management services with receive order and time stamped messages
Parallel Simulation Concepts • Amodel consists of simulation objects (logical processes) and events. • LPs are distributed on several processors. • Only time stamped events are exchanged between LPs. • Synchronization and causality constraints are handled by a conservative or optimistic simulation algorithm.
Federation real-time players parallel sequential The rational behind this work • Parallel simulation can potentially reduce the simulation time of large scale systems. • HLA can benefit from parallel federates in a federation execution to achieve speed-up for the entire federation. parallel computer NOWs...
Parallel simulation and HLA HLA PADS • As fast as possible execution. • Conservative or optimistic synchronization among LPs. Time management • Mainly real time simulation. • Conservative among all the federates. Interactions • Event paradigm. • In most cases, only time stamped events. • Subscription/publication. • Received Order and Time Stamped Order.
Parallel federates... • are time-constrained and time-regulated. • must take into account TSO messages from the RTI, • have to report a simulation time, • have to ask for time advance grants. • contain several logical processes. • have to compute a global simulation time, • provide non-blocking scheduling regarding time advance grants.
One or several federates? Having several federates sometimes facilitates the design of the model but introduces extra dependencies in a conservative federates It is better to have one federate for the entire set of Logical Processes
Need for an accurate GST • Even a conservative federate has to implement a GST computation. • The GST is the only simulation time value the RTI knows about the parallel federate. • The GST must be computed frequently for the other federate to advance in time.
When and how to advance the time • LPs cannot request time advance grants directly from the RTI. • Messages from the RTI gain to be directly handled by the synchronization algorithm. • It is possible to use the LBTS from the RTI
ENVIRONMENT Parallel conservative federates Shared memory architecture RTI v1.0 for Solaris 2.5 The PARSEC language Message-based, process-interaction approach • LP are programmed as an actor or entity • all activities of an entity are initiated on message receipts • An LP cannot directly modify the state of another LP • Event are represented by message communications • e(t,p,a): send message m(e) at time t to LP p • On receiving m(e), p executes actions a • change its state represented by local variables • schedule events (messages) at time >=t • LPs are scheduled with a large variety of algorithms • Conservative with null-messages, conditional events, • synchronous, optimistic and adaptive algorithms.
HLA_registerEntity( self, reflect | discover); c1.a1 c1.a1 h Receive (HLACallback m) { switch (m.type) { case reflect: Update(m.C, m.A); break; case discover: … } reflectAttributeValues Translation of notifications • Notifications from the RTI are translated into a PARSEC message and sent back to the entities. • Entities can register to receive a given set of notification types. Ensure that both TSO and RO messages can be mixed into PARSEC Ensure that the entities receive the messages at the correct time 1 3 callback RTI 2 has subscribed to c1.a1 has registered to reflect and discover
ENTITY Time management support Sequential federates Entities interact directly with the RTI HLA_timeAdvanceGrantRequest() Request and wait for a time advance grant using nextEventRequest. RTI
HLA_addEntitySimclock() HLA_provideEntitySimclock() ENTITY ENTITY ENTITY Parallel federates Entities interact with the RTI via a time manager entity Provides a simulation time value to the time manager. Performs the GST computation and asks for the time advance request from the RTI. Indicates to the PARSEC runtime that an entity wishes to participate in the GST computation. Allocates data structures for the calling entity. RTI
Overview of time management Parallel federates
The wireless model example • 1 sequential federate: a weather federate that publishes a weather_condition attribute. • 1 parallel federate: a wireless communication network that subscribes to the weather_condition attribute. • The transmission quality depends on the weather_condition attribute. Can the parallel federate provide speedup for the entire federation execution?