Discrete Event System Modeling and Simulation in Metropolis Guang Yang 12/10/2004
Outline Separation of Capability and Cost Quantity Manager and Quantity Annotation Discrete Event Systems in Metropolis Discrete Event Systems Simulation Challenges Conclusion and Future Work
Capability v.s. Cost One of the pairs of concerns whose orthogonalization increases model reusability Capability: a sequence of events Cost: captured by various quantities Instruction Set Pentium4Atholon ……
Capability v.s. Cost in TSM Capability: Cost: (v1, ) (v2, ) … (vn, ) Interface function: write_fifo(w){ (v1, ) (v2, ) … (vn, ) } m-event : tag = (v1, 0) (v2, ) … (vn, 10) Interface function: write_fifo(w){ (v1, 0) (v2, ) … (vn, 10) } 10 time units costs correspond to tags
Quantity Annotation & Quantity Manager Quantity Annotation (v1, ) (v1, 0) Time Quantity Manager requestannotate resolve Quantity Manager Data type Functions Axioms
Discrete Event Systems in Metropolis Tag is the key Process 1 (v11, 0) (v12, ) … (v1n, 10) Process 2 (v21, ) (v22, 4) … (v2n, 8) Process 3 (v31, 2) (v32, 5) … (v3n, ) Time Quantity Manager
Discrete Event Systems Simulation Formally, N processes p1, p2, …, pN N m-event sequences me 1, me 2, …, me N Annotated tag for the i’th m-event in me j,T[me j (i)] The most recent but prior to the i’th annotated m-event in me j The next annotated m-event in me j after the i’th m-event
DES Simulation (cont) is the segment of m-events that could be interleaved with other m-events from other processes In order for and to be arbitrarily interleaved, the following condition must be satisfied The end point e.g. can join the interleaving if it falls into the other segment
DES Simulation (cont) Simulation proceeds round by round. At each round, each process issues one m- event or event. Based on time tags information and other constraints (e.g. mutual exclusion, simultaneity), disable some of (m-)events and let the rest run.
DES Simulation (cont) An example Process 1 (v11, 0) (v12, ) … (v1n, 10) Process 2 (v21, ) (v22, 4) … (v2n, 8) Process 3 (v31, 2) (v32, 5) … (v3n, ) Time Quantity Manager
Challenges No history information No rollback No future information Cannot avoid rollback if do blind interleaving
Solution Postpone interleaving until there is enough information Whenever there is a m-event, let it run. Resolve time quantity only if all processes come to events or m-events get stuck
Example Process 1 (v11, 0) (v12, ) … (v1n, 10) Process 2 (v21, ) (v22, 4) … (v2n, 8) Process 3 (v31, 2) (v32, 5) … (v3n, ) Time Quantity Manager
Solution Postpone interleaving until there is enough information Whenever there is a m-event, let it run. Resolve time quantity only if all processes come to events or events get stuck Works but not so efficient Waste on constraint resolution Increase the number of simulation rounds
Get hints from designers Identify regularities in the tags Periodical tasks Tasks with latency/rate constraints … Introduce built-in logic of constraints (LOC) to be able to predict future period(event, p) maxrate/minrate(event1, event2, r) maxlatency/minlatency(event1, event2, r)
Quantity Annotation & Quantity Manager Quantity Annotation (v1, ) (v1, 0) Time Quantity Manager requestannotate resolve Quantity Manager Data type Functions Axioms Built-in LOC
Experiments P0 write(w) (10) P1 write(w) (10) C read() (15) M Time Quantity Manager
Simulation Statistics Postpone interleaving Number of Scheduling Rounds Done by Simulation Manager: 2120 Average Number of RUN Processes Scheduled per Scheduling Round: Total Simulation Time: us Built-in loc Number of Scheduling Rounds Done by Simulation Manager: 1168 Average Number of RUN Processes Scheduled per Scheduling Round: Total Simulation Time: us
Conclusion and Future Work Formally analyze the simulation strategy Identify problems in terms of simulation efficiency Discuss the possible solutions Future work: Are there better solutions to the efficiency problem? How to co-simulate Metropolis DES with external CT/Hybrid system simulators?
Thank you!!! Questions?