Parallel and Distributed Simulation Process Oriented Simulation.

Slides:



Advertisements
Similar presentations
Decision Structures - If / Else If / Else. Decisions Often we need to make decisions based on information that we receive. Often we need to make decisions.
Advertisements

Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Ch 7 B.
Parallel and Distributed Simulation
5.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 5: CPU Scheduling.
 1  Outline  performance measures for a single-server station  discrete-event simulation  hand simulation  process-oriented simulation approach.
Parallel and Distributed Simulation Time Warp: Other Mechanisms.
14-Jun-15 State Machines. 2 What is a state machine? A state machine is a different way of thinking about computation A state machine has some number.
Scheduler Activations Effective Kernel Support for the User-Level Management of Parallelism.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Discrete Event Simulation Event-Oriented Simulations By Syed S. Rizvi.
25-Jun-15 State Machines. 2 What is a state machine? A state machine is a different way of thinking about computation A state machine has some number.
Parallel and Distributed Simulation Object-Oriented Simulation.
1 Organization of Programming Languages-Cheng (Fall 2004) Concurrency u A PROCESS or THREAD:is a potentially-active execution context. Classic von Neumann.
CHAPTER 10 Recursion. 2 Recursive Thinking Recursion is a programming technique in which a method can call itself to solve a problem A recursive definition.
Chapter 11: Distributed Processing Variations of subprogram control
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Fundamentals of Python: From First Programs Through Data Structures
Slide - 1 Dr Terry Hinton 6/9/05UniS - Based on Slides by Micro Analysis & Design An example of a Simulation Simulation of a bank: Three tasks or processes:
Execution Control with If/Else and Boolean Functions
Programming With Alice. Alice Free Java based, 3D programming tool Enables the manipulation and interaction of 3D objects Can also.
Parallel and Distributed Simulation Hardware Platforms Simulation Fundamentals.
Chapter 5 Implementing UML Specification (Part II) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
The Mitre Meteor Robot Control Software “Simulate As You Operate” Presented by Darrell L Sims Richard M. Weatherly Frederick S. Kuhl Robert H. Bolling.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics Basics of register-transfer design: –data paths and controllers; –ASM charts. Pipelining.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
Internet Software Development Controlling Threads Paul J Krause.
Parallel and Distributed Simulation Process Oriented Simulation.
13-Nov-1513-Nov-1513-Nov-15 State Machines. What is a state machine? A state machine is a different way of thinking about computation A state machine.
Threaded Programming in Python Adapted from Fundamentals of Python: From First Programs Through Data Structures CPE 401 / 601 Computer Network Systems.
Chapter 5 Implementing UML Specification (Part II) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Parallel and Distributed Simulation Distributed Virtual Environments (DVE) & Software Introduction.
Discrete Event (time) Simulation. What is a simulation? “Simulation is the process of designing a model of a real system and conducting experiments with.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Advanced Concurrency Topics Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 24 Critical Regions.
Object Oriented Simulation with OOSimL Conditional Waiting.
CS533 – Spring Jeanie M. Schwenk Experiences and Processes and Monitors with Mesa What is Mesa? “Mesa is a strongly typed, block structured programming.
Fall 2008Programming Development Techniques 1 Topic 20 Concurrency Section 3.4.
Modern VLSI Design 3e: Chapter 8 Copyright  1998, 2002 Prentice Hall PTR Topics n Basics of register-transfer design: –data paths and controllers; –ASM.
Dr. Anis Koubâa CS433 Modeling and Simulation
CS433 Modeling and Simulation Lecture 09 – Part 02 Discrete Events Simulation Dr. Anis Koubâa 27 Dec 2008 Al-Imam.
Assembly Language Co-Routines
1 Advanced Operating Systems - Fall 2009 Lecture 7 – February 2, 2009 Dan C. Marinescu Office: HEC 439 B. Office hours:
Clock Synchronization (Time Management) Deadlock Avoidance Using Null Messages.
Simulation Modeling & Simulation 33.  Simulation: It is a numerical technique for conducting experiments with certain types of mathematical models.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Introduction to Simulation What is a simulation? A system that represents or emulates the behavior of another system over time; a computer simulation is.
PDES Introduction The Time Warp Mechanism
Threaded Programming in Python
HDL simulation and Synthesis (Marks16)
Parallel and Distributed Simulation
The Mach System Sri Ramkrishna.
COT 4600 Operating Systems Fall 2009
Operating Systems (CS 340 D)
Chapter 3: Decisions and Loops
OPERATING SYSTEMS CS3502 Fall 2017
ADVANTAGES OF SIMULATION
Intro to Processes CSSE 332 Operating Systems
Expressions and Control Flow in JavaScript
Parallel and Distributed Simulation
Semaphore Originally called P() and V() wait (S) { while S <= 0
Robotics and EV3 - Behavior-Based Robots -
Background and Motivation
State Machines 6-Apr-196-Apr-19.
CS510 Operating System Foundations
State Machines 8-May-19.
State Machines 16-May-19.
Presentation transcript:

Parallel and Distributed Simulation Process Oriented Simulation

Outline Event-Oriented Simulation (review) Process-oriented simulation –Fundamental concepts: Processes, resources –Simulation primitives –Example –Implementation

Event-Oriented Simulation Example Arrival Event: InTheAir := InTheAir+1; If (RunwayFree) RunwayFree:=FALSE; Schedule Landed Now + R; Now: current simulation time InTheAir: number of aircraft landing or waiting to land OnTheGround: number of landed aircraft RunwayFree: Boolean, true if runway available Landed Event: InTheAir:=InTheAir-1; OnTheGround:=OnTheGround+1; Schedule Departure Now + G; If (InTheAir>0) Schedule Landed Now + R; Else RunwayFree := TRUE; Departure Event: OnTheGround := OnTheGround - 1;

Event-Oriented World View state variables Integer: InTheAir; Integer: OnTheGround; Boolean: RunwayFree; Event handler procedures Simulation application Arrival Event { … } Landed Event { … } Departure Event { … } Event-oriented simulation programs may be difficult to understand, modify Program organized around state transitions Behavior of an aircraft distributed across multiple event handlers Flow of control among event handlers not obvious

Process Oriented Simulation Focus simulation program around behavior of entities –Aircraft: arrives, waits for runway, lands, departs Process-oriented simulation –Process: thread of execution describing entity behavior over time –Resources: shared resource used by entities (e.g., runway) Execution: alternate between simulation computations at a single instant of simulation time, and advanced in simulation time (no computation) Wallclock time Simulation time advances (no computation) Computation at a single Instant of simulation time

Simulation Primitives Primitives needed to advance simulation time AdvanceTime(T): advance T units of simulation time –Also called “hold” –ex: AdvanceTime(R) to model using runway R units of simulation time WaitUntil(p): simulation time advances until predicate p becomes true –Predicate based on simulation variables that can be modified by other simulation processes –Ex: WaitUntil(RunwayFree) to wait until runway becomes available for landing

/* simulate aircraft arrival, circling, and landing */ Integer: InTheAir; Integer: OnTheGround; Boolean: RunwayFree; 1InTheAir := InTheAir + 1; 2WaitUntil (RunwayFree);/* circle */ 3RunwayFree := FALSE;/* land */ 4AdvanceTime(R); 5RunwayFree := TRUE; /* simulate aircraft on the ground */ 6InTheAir := InTheAir - 1; 7OnTheGround := OnTheGround + 1; 8AdvanceTime(G); /* simulate aircraft departure */ 9OnTheGround := OnTheGround - 1; Aircraft Process A new aircraft process is created with each Arrival event

Implementation Process-oriented simulations are built over event oriented simulation mechanisms (event list, event processing loop) Event computation: computation occurring at an instant in simulation time –Execution of code section ending with calling a primitive to advance simulation time Computation threads –Typically implemented with co-routine (threading) mechanism Simulation primitives to advance time –Schedule events –Event handlers resume execution of processes

/* simulate aircraft arrival, circling, and landing */ 1InTheAir := InTheAir + 1; 2WaitUntil (RunwayFree);/* circle */ 3RunwayFree := FALSE;/* land */ 4AdvanceTime(R); 5RunwayFree := TRUE; /* simulate aircraft on the ground */ 6InTheAir := InTheAir - 1; 7OnTheGround := OnTheGround + 1; 8AdvanceTime(G); /* simulate aircraft departure */ 9OnTheGround := OnTheGround - 1; Aircraft Process Identify computation associated with each simulation event Aircraft Arrival Aircraft Landing Aircraft On The Ground Aircraft Departs

Implementation: AdvanceTime(T) Causes simulation time in the process to advance by T units Execute AdvanceTime(T): –Schedule Resume event at time Now+T –Suspend execution of thread –Return execution to event scheduler program Process Resume event: –Return control to thread Simulation process … RunwayFree := FALSE; AdvanceTime(R); RunwayFree := TRUE;... AdvanceTime(T) { Schedule Resume event at Now+T; Xfer to Schedule } Scheduler { While (sim not done) Remove event from PEL call event handler } Resume Event Handler { Xfer to sim process } later

Implementation: WaitUntil (p) Suspend until predicate p evaluates to true Execute WaitUntil (p): –Suspend execution of thread, record waiting for p to become true –Return execution to event scheduler program Main scheduler loop –For each suspended process, check if execution can resume –Prioritization rule if more than one can resume Simulation process … InTheAir:=InTheAir+1; WaitUntil(RunwayFree); RunwayFree:=FALSE;... WaitUntil(p) { Add to suspended list Xfer to Schedule } Scheduler { While (sim not done) Remove ev from PEL call event handler while (a process’s pred is true) Xfer sim process } later

Summary Process-oriented simulation typically simplified model development and modification Requires threading (e.g., co-routine) mechanism Additional complexity and computation overhead to suspend and resume simulation processes