1 Creating Simulations with POSE Terry L. Wilmarth, Nilesh Choudhury, David Kunzman, Eric Bohm Parallel Programming Laboratory University of Illinois at.

Slides:



Advertisements
Similar presentations
Parallel Discrete Event Simulation Richard Fujimoto Communications of the ACM, Oct
Advertisements

Processes Management.
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
Parallel and Distributed Simulation Time Warp: Basic Algorithm.
Optimistic Parallel Discrete Event Simulation Based on Multi-core Platform and its Performance Analysis Nianle Su, Hongtao Hou, Feng Yang, Qun Li and Weiping.
Other Optimistic Mechanism, Memory Management. Outline Dynamic Memory Allocation Error Handling Event Retraction Lazy Cancellation Lazy Re-Evaluation.
Parallel and Distributed Simulation Time Warp: Other Mechanisms.
Inline Assembly Section 1: Recitation 7. In the early days of computing, most programs were written in assembly code. –Unmanageable because No type checking,
Processes CSCI 444/544 Operating Systems Fall 2008.
Improving Robustness in Distributed Systems Jeremy Russell Software Engineering Honours Project.
3.5 Interprocess Communication
Chapter 13 Embedded Systems
Common System Components
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Guide To UNIX Using Linux Third Edition
Chapter 6: An Introduction to System Software and Virtual Machines
1 Simulation Methodology H Plan: –Introduce basics of simulation modeling –Define terminology and methods used –Introduce simulation paradigms u Time-driven.
Backup and Recovery Part 1.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
BigSim: A Parallel Simulator for Performance Prediction of Extremely Large Parallel Machines Gengbin Zheng Gunavardhan Kakulapati Laxmikant V. Kale University.
Time Warp OS1 Time Warp Operating System Presenter: Munehiro Fukuda.
What is Concurrent Programming? Maram Bani Younes.
JS Arrays, Functions, Events Week 5 INFM 603. Agenda Arrays Functions Event-Driven Programming.
ParFUM Parallel Mesh Adaptivity Nilesh Choudhury, Terry Wilmarth Parallel Programming Lab Computer Science Department University of Illinois, Urbana Champaign.
Chapter 6: User-Defined Functions I Instructor: Mohammad Mojaddam
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
CHAPTER 2 OPERATING SYSTEM OVERVIEW 1. Operating System Operating System Definition A program that controls the execution of application programs and.
Parallel Programming Models Jihad El-Sana These slides are based on the book: Introduction to Parallel Computing, Blaise Barney, Lawrence Livermore National.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
Chapter 6: User-Defined Functions
Google’s MapReduce Connor Poske Florida State University.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Parallel and Distributed Simulation Memory Management & Other Optimistic Protocols.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
Modeling VHDL in POSE. Overview Motivation Motivation Quick Introduction to VHDL Quick Introduction to VHDL Mapping VHDL to POSE (the Translator) Mapping.
Workshop BigSim Large Parallel Machine Simulation Presented by Eric Bohm PPL Charm Workshop 2004.
1Charm++ Workshop 2010 The BigSim Parallel Simulation System Gengbin Zheng, Ryan Mokos Charm++ Workshop 2010 Parallel Programming Laboratory University.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Simics: A Full System Simulation Platform Synopsis by Jen Miller 19 March 2004.
By Jeff Dean & Sanjay Ghemawat Google Inc. OSDI 2004 Presented by : Mohit Deopujari.
Charm++ Data-driven Objects L. V. Kale. Parallel Programming Decomposition – what to do in parallel Mapping: –Which processor does each task Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Charm++ Data-driven Objects L. V. Kale. Parallel Programming Decomposition – what to do in parallel Mapping: –Which processor does each task Scheduling.
File Systems cs550 Operating Systems David Monismith.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Synchronous Process Cooperation Object Oriented Simulation with OOSimL Chapter 26 (C) J. M. Garrido1.
Transactions.
Performance analysis of a Pose application -- BigNetSim Nilesh Choudhury.
 Simulation enables the study of complex system.  Simulation is a good approach when analytic study of a system is not possible or very complex.  Informational,
Timewarp Rigid Body Simulation Brian Mirtich. Simulation Discontinuities “Events that change the dynamic states or the equations of motion of some subset.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Pitfalls: Time Dependent Behaviors CS433 Spring 2001 Laxmikant Kale.
PDES Introduction The Time Warp Mechanism
Advanced Computer Systems
Creating Simulations with POSE
OPERATING SYSTEMS CS 3502 Fall 2017
Chapter 3: Processes.
Process Management Process Concept Why only the global variables?
Chapter 3: Process Concept
Parallel and Distributed Simulation Techniques
CPSC 531: System Modeling and Simulation
Parallel and Distributed Simulation
Presented By: Darlene Banta
BigSim: Simulating PetaFLOPS Supercomputers
Uniprocessor scheduling
Parallel Exact Stochastic Simulation in Biochemical Systems
Chapter 3: Process Management
Presentation transcript:

1 Creating Simulations with POSE Terry L. Wilmarth, Nilesh Choudhury, David Kunzman, Eric Bohm Parallel Programming Laboratory University of Illinois at Urbana- Champaign

2 Inspiration Parallel Discrete Event Simulation of fine-grained tasks is notoriously difficult to parallelize and scale Classes of applications parallelize well with conservative synchronization, but most do not scale well Optimistic Synchronization coupled with Charm++'s virtualization, load balancing, communication optimization, etc. enable scalable general-purpose PDES (fine-grained or not)

3 POSE 0.5a Prerequisites Parallel Discrete Event Simulation C++, Charm++ Minimal understanding of parallel programming Some understanding of optimistic synchronization mechanism for PDES

4 Designing a POSE Simulation Decompose system to be modeled into its concurrent entities: posers Determine how the entities interact with discrete events: event methods Determine initial placement of entities Some parallel computing savvy required to maximize achievable parallelism

5 Example: POSE to Charm++

6 POSE to Charm++ Posers: special Charm++ chares that communicate via timestamped messages executed in order Event methods: Charm++ entry methods that receive timestamped event messages Strategy: method for synchronizing posers in parallel

7 Optimistic Synchronization Events received by posers are queued by timestamp in poser's event queue Events executed in timestamp order according to synchronization strategy The poser's state is periodically checkpointed A straggler arrives, events are rolled back, spawned events are cancelled, and the poser's state is recovered

8 Optimistic Synchronization in POSE After handling straggler, forward execution proceeds as before Fossil collection: checkpoint memory is recovered when no longer needed, i.e. when checkpoint is older than... GVT, global virtual time, the minimum virtual time in the entire simulation

9 Using POSE POSE code translated to Charm++ Same program structure:.ci,.h,.C Same program code can be used to run sequential or parallel simulations Highly configurable

10 Code Sample: Poser & Event Messages,.ci file message WorkerData; message WorkMsg; poser worker : sim adapt4 chpt { entry worker(WorkerData *); // Event methods entry [event] void work(WorkMsg *); };

11 The.ci File Declare event message types: message WorkerMsg; Declare posers with synchronization strategy and representation type: poser worker : sim adapt4 chpt {... Declare event methods for posers which take an event message as parameter: entry [event] void work(WorkMsg *);

12 Code Sample: Poser Declaration & Event Methods,.h file class worker { int someIntData; public: worker(); worker(WorkerData *m); ~worker(); worker& operator=(const worker& obj); void pup(PUP::er &p); // Event methods void work(WorkMsg *m); void work_anti(WorkMsg *m); void work_commit(WorkMsg *m); };

13 The.h File Define posers and their state (a portion of the global state): class worker { int someIntData;... Declare any local helper methods required Declare contructors and required methods: Basic constructor, destructor, assignment operator, pup method

14 The.h File, cont'd Declare event methods and corresponding anti-methods and commit methods: void work(WorkMsg *m); void work_anti(WorkMsg *m); void work_commit(WorkMsg *m); Anti-methods provide an alternative mechanism to checkpointing that allows the user to undo the state changes of an event method

15 The.h File, cont'd Commit methods are executed when fossil collection is about to free the memory of a check-pointed state and “commit” to the execution of an event i.e. committed event can't be rolled back Useful for statistics collection, I/O, or any other activity that should only happen once

16 Code Sample: Poser Constructor & Event Method Invocation,.C file worker::worker(WorkerData *m) { someIntData = m->someData; delete m; POSE_srand(myHandle); WorkMsg *wm; if (myHandle == 0) { wm = new WorkMsg; wm->someIntData = someIntData; POSE_invoke(work(wm), worker, POSE_rand()%42, POSE_rand()%10)); }

17 The.C File Constructor receives message, uses data, deletes message (not true for event methods!) Every poser has a handle: myHandle if (myHandle == 0) {... worker::worker(WorkerData *m) { someIntData = m->someData; delete m;...

18 The.C File, cont'd User decides what handle each poser has at construction time Any poser can invoke events on another poser as long as it knows the destination poser's handle Random number generation in POSE repeats same sequence in case of rollback and re-execution

19 The.C File, cont'd Event method invocation: POSE_invoke(event_method(event_msg), poser_type, dest_handle, transit_time); event_msg is timestamped with OVT + transit_time when it arrives on poser dest_handle wm = new WorkMsg; wm->someIntData = someIntData; POSE_invoke(work(wm), worker, POSE_rand()% 42, POSE_rand()%10)); Each poser has its own virtual time: OVT; posers' OVTs can be out-of-sync

20 Code Sample: Event Methods,.C file void worker::work(WorkMsg *m) { WorkMsg *wm; wm->someIntData = m->someIntData + someIntData; // fake computation POSE_busy_wait(1000); elapse(27); POSE_invoke(work(wm), worker, POSE_rand()%42, POSE_rand()%10); } void worker::work_anti(WorkMsg *m) { restore(this); } void worker::work_commit(WorkMsg *m) { }

21 Passing Virtual Time We've seen how to make an event happen in the future via the transit_time parameter to POSE_invoke Elapse time on a poser: elapse(27); Increments poser's OVT by 27 Auto-elapse: a poser receives an event at time t > OVT; advance poser's OVT to t

22 Passing Virtual Time, cont'd What if t < OVT? If the received event is inserted in the event queue before other executed events, it causes a rollback If not, the event is handled at time OVT, not at time t (events earlier than t kept the poser busy until time OVT)

23 Event Methods and Event Messages When an event message arrives, it is queued on the destination poser as an event to be executed The actual message is stored in the queue along with any additional information associated with the event Because the event may be rolled back and re-executed, the message must not be deleted in the event method

24 Anti-methods Typically, anti-methods only restore the checkpointed state: void worker::work_anti(WorkMsg *m) { restore(this); } But they can be used instead of checkpointing to undo simple state changes: void myClass::toggleFlag_anti(eventMsg *m) { flag ? flag=0 : flag=1; restore(this); }

25 Output Printing information about progress, statistics or debugging data in PDES can be confusing in the face of rollbacks CommitPrintf(...) : buffers event execution output until the event is committed CommitError(...) : buffers error statements and aborts if an event results in an error that is committed

26 A Main Program Programs that use posers are pure Charm they are not translated In main, just before creating posers, call POSE_init() to start simulation Then inject posers into the system: WorkerData *wd; for (int i=0; i<42; i++) { wd = new WorkerData; wd->Timestamp(0); int dest = rand() % CkNumPes(); (*(CProxy_worker *) &POSE_Objects)[i].insert (wd, dest); // i is this poser's handle }

27 A Main Program User must timestamp constructor message and create object with Charm++ syntax Under the hood, constructs a worker in a Chare Array at index i on processor dest WorkerData *wd; for (int i=0; i<42; i++) { wd = new WorkerData; wd->Timestamp(0); int dest = rand() % CkNumPes(); (*(CProxy_worker *) &POSE_Objects)[i].insert (wd, dest); // i is this poser's handle }

28 POSE_init() Initialization and Simulation start-up Can optionally specify endTime, a virtual time at which to halt the simulation Can optionally specify whether or not to use inactivity detection: terminates simulation if no events are handled for some period of time void POSE_init(); void POSE_init(int ET); void POSE_init(int IDflag, int ET);

29 Choosing a Synchronization Strategy poser worker : sim adapt4 chpt {... POSE offers a wide variety of synchronization strategies ranging from conservative to aggressively optimistic Each type of poser can use the strategy best suited to its behavior opt*, spec, adapt*

30 Choosing a Synchronization Strategy opt*: basic optimistic synchronization, throttled and unthrottled spec: throttled optimism, aggressive speculation adapt*: optimism and speculation adapt to recent behavior of poser

31 Getting and Using POSE Got Charm++? You've got POSE. build pose... etrans.pl [-s] Worker Translates Worker.* to Worker_sim.* charmc... -module pose -language charm++ charmc... -module seqpose -language charm++

32 Applications VHDL Simulation: David Kunzman Big Network Simulation: Nilesh Choudhury