Operating Systems Exercise 3

Similar documents
Biol. 356 Lab 8. Mortality, Recruitment, and Migration Rates

Random Walk with Anti-Correlated Steps

Solutions for Assignment 2

Comments on Window-Constrained Scheduling

Examples of Dynamic Programming Problems

Linear Cryptanalysis

Module 2 F c i k c s la l w a s o s f dif di fusi s o i n

1 Review of Zero-Sum Games

Scheduling of Crude Oil Movements at Refinery Front-end

t is a basis for the solution space to this system, then the matrix having these solutions as columns, t x 1 t, x 2 t,... x n t x 2 t...

Modal identification of structures from roving input data by means of maximum likelihood estimation of the state space model

MATHEMATICAL DESCRIPTION OF THEORETICAL METHODS OF RESERVE ECONOMY OF CONSIGNMENT STORES

Math 10B: Mock Mid II. April 13, 2016

Intermediate Macro In-Class Problems

3.1.3 INTRODUCTION TO DYNAMIC OPTIMIZATION: DISCRETE TIME PROBLEMS. A. The Hamiltonian and First-Order Conditions in a Finite Time Horizon

Problem Set 5. Graduate Macro II, Spring 2017 The University of Notre Dame Professor Sims

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still.

FINM 6900 Finance Theory

CHAPTER 12 DIRECT CURRENT CIRCUITS

A First Course on Kinetics and Reaction Engineering. Class 19 on Unit 18

04. Kinetics of a second order reaction

T L. t=1. Proof of Lemma 1. Using the marginal cost accounting in Equation(4) and standard arguments. t )+Π RB. t )+K 1(Q RB

Vehicle Arrival Models : Headway

Applying Genetic Algorithms for Inventory Lot-Sizing Problem with Supplier Selection under Storage Capacity Constraints

Comparing Means: t-tests for One Sample & Two Related Samples

Diebold, Chapter 7. Francis X. Diebold, Elements of Forecasting, 4th Edition (Mason, Ohio: Cengage Learning, 2006). Chapter 7. Characterizing Cycles

From Particles to Rigid Bodies

Distribution of Estimates

Problem Set #3: AK models

Econ107 Applied Econometrics Topic 7: Multicollinearity (Studenmund, Chapter 8)

Position, Velocity, and Acceleration

KINEMATICS IN ONE DIMENSION

Stochastic models and their distributions

Final Spring 2007

Challenge Problems. DIS 203 and 210. March 6, (e 2) k. k(k + 2). k=1. f(x) = k(k + 2) = 1 x k

72 Calculus and Structures

E β t log (C t ) + M t M t 1. = Y t + B t 1 P t. B t 0 (3) v t = P tc t M t Question 1. Find the FOC s for an optimum in the agent s problem.

Chapter 14 Chemical Kinetics

Innova Junior College H2 Mathematics JC2 Preliminary Examinations Paper 2 Solutions 0 (*)

Linear Response Theory: The connection between QFT and experiments

Machine Learning 4771

Inventory Analysis and Management. Multi-Period Stochastic Models: Optimality of (s, S) Policy for K-Convex Objective Functions

LabQuest 24. Capacitors

Homework sheet Exercises done during the lecture of March 12, 2014

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

Suggested Solutions to Assignment 4 (REQUIRED) Submisson Deadline and Location: March 27 in Class

Introduction to Probability and Statistics Slides 4 Chapter 4

Solutionbank Edexcel AS and A Level Modular Mathematics

Topic Astable Circuits. Recall that an astable circuit has two unstable states;

Chapter 7: Solving Trig Equations

Solutions Problem Set 3 Macro II (14.452)

Two Coupled Oscillators / Normal Modes

Nature Neuroscience: doi: /nn Supplementary Figure 1. Spike-count autocorrelations in time.

Maintenance Models. Prof. Robert C. Leachman IEOR 130, Methods of Manufacturing Improvement Spring, 2011

Viterbi Algorithm: Background

Two Popular Bayesian Estimators: Particle and Kalman Filters. McGill COMP 765 Sept 14 th, 2017

Spring Ammar Abu-Hudrouss Islamic University Gaza

20. Applications of the Genetic-Drift Model

22. Inbreeding. related measures: = coefficient of kinship, a measure of relatedness of individuals of a population; panmictic index, P = 1 F;

HOTELLING LOCATION MODEL

Global Optimization for Scheduling Refinery Crude Oil Operations

i L = VT L (16.34) 918a i D v OUT i L v C V - S 1 FIGURE A switched power supply circuit with diode and a switch.

Timed Circuits. Asynchronous Circuit Design. Timing Relationships. A Simple Example. Timed States. Timing Sequences. ({r 6 },t6 = 1.

The average rate of change between two points on a function is d t

Resource Allocation in Visible Light Communication Networks NOMA vs. OFDMA Transmission Techniques

STA 114: Statistics. Notes 2. Statistical Models and the Likelihood Function

Robust estimation based on the first- and third-moment restrictions of the power transformation model

Homework 4 (Stats 620, Winter 2017) Due Tuesday Feb 14, in class Questions are derived from problems in Stochastic Processes by S. Ross.

On Measuring Pro-Poor Growth. 1. On Various Ways of Measuring Pro-Poor Growth: A Short Review of the Literature

An Inventory Model for Time Dependent Weibull Deterioration with Partial Backlogging

EECS 2602 Winter Laboratory 3 Fourier series, Fourier transform and Bode Plots in MATLAB

Written Exercise Sheet 5

Let us start with a two dimensional case. We consider a vector ( x,

GMM - Generalized Method of Moments

Seminar 4: Hotelling 2

A Shooting Method for A Node Generation Algorithm

Linear Time-invariant systems, Convolution, and Cross-correlation

Online Learning, Regret Minimization, Minimax Optimality, and Correlated Equilibrium

Comparison between the Discrete and Continuous Time Models

Ensamble methods: Bagging and Boosting

Delivering Better Time-of-Day Using Synchronous Ethernet and Yaakov (J) Stein, Alon Geva, Gabriel Zigelboim RAD Data Communications

Lecture 2 October ε-approximation of 2-player zero-sum games

Chapter 14 Chemical Kinetics

EXERCISES FOR SECTION 1.5

Single-Pass-Based Heuristic Algorithms for Group Flexible Flow-shop Scheduling Problems

DATA DRIVEN DONOR MANAGEMENT: LEVERAGING RECENCY & FREQUENCY IN DONATION BEHAVIOR

Dynamic Programming 11/8/2009. Weighted Interval Scheduling. Weighted Interval Scheduling. Unweighted Interval Scheduling: Review

Stochastic Perishable Inventory Systems: Dual-Balancing and Look-Ahead Approaches

EE650R: Reliability Physics of Nanoelectronic Devices Lecture 9:

Zhihan Xu, Matt Proctor, Ilia Voloh

Lecture 4 Notes (Little s Theorem)

Solution: b All the terms must have the dimension of acceleration. We see that, indeed, each term has the units of acceleration

Policy regimes Theory

Echocardiography Project and Finite Fourier Series

Solutions to Odd Number Exercises in Chapter 6

Lecture 9: September 25

Mathcad Lecture #8 In-class Worksheet Curve Fitting and Interpolation

Cooperative Ph.D. Program in School of Economic Sciences and Finance QUALIFYING EXAMINATION IN MACROECONOMICS. August 8, :45 a.m. to 1:00 p.m.

ACE 562 Fall Lecture 5: The Simple Linear Regression Model: Sampling Properties of the Least Squares Estimators. by Professor Scott H.

An random variable is a quantity that assumes different values with certain probabilities.

Transcription:

Operaing Sysems SS 00 Universiy of Zurich Operaing Sysems Exercise 3 00-06-4 Dominique Emery, s97-60-056 Thomas Bocek, s99-706-39 Philip Iezzi, s99-74-354 Florian Caflisch, s96-90-55 Table page Table page 3 Exercise 3. /8 00 Group Hosebei

Operaing Sysems SS 00 Universiy of Zurich able : 0 3 4 5 6 7 8 9 0 3 4 5 6 7 8 9 FCFS firs-come-firs-served P P RR round-robin (q=) P P RR round-robin (q=4) P P SPN shores-process-nex P P SRT shores-remaining-ime P P HRRN highes-response-raio-nex P P Feedback (q=) P P Feedback (q= i- ) P P /8 00 Group Hosebei

Operaing Sysems SS 00 Universiy of Zurich able : Process 3 4 5 Arrival Time 0 3 4 6 Burs Time T S 6 3 5 4 3 4 5 Mean FCFS firs-come-firs-served F 6 8 6 0. T U 6 7 8 4 9.4 T U /T S 3.5.67.4 3.5.6 RR round-robin (q=) F 6 5 0 9 4.4 T U 6 4 9 6 3.6 T U /T S.67 3 3. 3.5.8 RR round-robin (q=4) F 9 6 9 0 7 4. T U 9 5 6 6.4 T U /T S 3.7.5 3..75.7 SPN shores-process-nex F 6 8 0 5 T U 6 7 8 6 9 9. T U /T S 3.5.67 3..5.5 SRT shores-remaining-ime F 5 3 6 0 0 0.8 T U 5 3 6 4 8 T U /T S.5 3..74 HRRN highes-response-raio-nex F 6 8 6 0. T U 6 7 8 4 9.4 T U /T S 3.5.67.4 3.5.6 Feedback (q=) F 0 6 9 7 4.8 T U 0 5 9 5 T U /T S 3.33.5 3 3.75.9 Feedback (q= i- ) F 7 8 0 9 0 4.8 T U 7 7 7 5 4 T U /T S.83 3.5.33 3 3.5 3.03 3/8 00 Group Hosebei

Operaing Sysems SS 00 Universiy of Zurich Exercise 3. I/O-bound processes end o use he CPU for shor burs a a ime and heir I/O-burs ime is much longer, so hey usually have used less CPU ime wihin he recen pas han oher processes. So his algorihm favors I/O-bound programs. However, he algorihm akes ino accoun only recen hisory. Like his, CPU-bound processes will no sarve permanenly. If a process does no receive ime quanum for a while, i becomes one of he processes ha had he leas CPU ime in he recen pas and i will ge a chance o use CPU. long CPU burs CPU-bound I/O-bound shor CPU burs recen pas Exercise 3.3 informal argumen: To ge he leas average response ime i is always he bes o le he shor processes run firs and he long ones a he end. The shor ones don need o wai for he long ones and he long ones don affec he average so much. The proporion for he long ones does no ake so much ino accoun. formal proof: Le s consider wo processes p (burs ime ) and p (burs ime ). Boh processes go he same arrival ime. assumpion: < p, p p, p average ime: average ime: avg = + + 4 + = avg = + + 4 + = assumpion: 4 avg + < avg 4 < + 4/8 00 Group Hosebei

Operaing Sysems SS 00 Universiy of Zurich 4 4 + proof: + 4 < < + < 4 + < his is also valid for a process sequence wih more han processes: ( x < x+ ) ( x+ < x+ ) x < x+ Exercise 3.4 There s a couple of reasons where he opimal choice is p=: All asks relae on each oher. Task n has o wai for ask n- ; ask n- has o wai for ask n-, They need o be processed in serial order. Wih p= he whole load will be on node and node will be relieved. Using node in his case makes no sense, as anyway he asks need o ge serialized and canno run parallel. Node is no reliable (e.g. i crashed) Node is jus a mirror of Node, so disribuing he asks ono boh nodes doesn give us any advanage in performance coss of Node are much higher han coss of Node (e.g. node has been ousourced) a) remoe accesses Exercise 3.5 Daa Resources R R R3 R4 R5 N 3 3 P P 3 oal: remoe accesses 5/8 00 Group Hosebei

Operaing Sysems SS 00 Universiy of Zurich b) opimal g / opimal f given: f = {(,), (,), (3,), (4,), (5,3) Daa Resources R R R3 R4 R5 N????? P P 3 given: g = {(,), (,), (3,3), (4,3), (5,) Daa Resources R R R3 R4 R5 N 3 3 P? P???? opimal g: g = {(,), (, 3), (3,), (4, 3), (5,) number of remoe accesses: R 0 R R3 R4 R5 Toal 6 For he given process-o-node allocaion (f) we chose he opimal node for each resource. We always ook he maximum used node from he f- funcion. A R and R4 i doesn maer which node we ake as we canno preven he oher wo remoe accesses. opimal f: f = {(,3), (,), (3, 3), (4, 3), (5,) number of remoe accesses: P P Toal 6 For he given resource-o-node allocaion (g) we chose he opimal node for each process. We always ook he maximum used node from he g- funcion. A, we should use node,, or 3. A we can chose beween node or 3 as boh of hem are allocaed in he resource-o-node funcion. Like his we re able o keep remoe accesses a he minimum. Like his we re able o keep remoe accesses a he minimum. commen: decisions wih alernaives: Any of he alernaives can be chosen wihou any impac on he number of remoe accesses. 6/8 00 Group Hosebei

Operaing Sysems SS 00 Universiy of Zurich c) f given, opimal g (Pseudo-Code): n := amoun(p); m := amoun(r); marix := mn-requiremens marix; // all requiremens are, else 0 // f(x) reurns he node allocaed o process x // g(x) reurns he node allocaed o daa resource x for (i =; i <= n; i++) { for (j = ; j <= m; j++) { if (marix[pi,rj]) { voe for [Rj,node f(pi)]; Daa Resources R R R3 R4 R5 N max_voe max_voe max_voe max_voe max_voe P P 3 3 3 3 for (j = ; j <= m; j++) { g(j) = max_voe([rj,node]); // chooses he node wih he highes voe c) g given, opimal f (Pseudo-Code): n := amoun(p); m := amoun(r); marix := mn-requiremens marix; // all requiremens are, else 0 // f(x) reurns he node allocaed o process x // g(x) reurns he node allocaed o daa resource x for (j =; j <= m; j++) { for (i = ; i <= n; i++) { if (marix[pi,rj]) { voe for [Pi,node g(rj)]; Daa Resources R R R3 R4 R5 N 3 3 P max_voe 3 3 P max_voe 3 max_voe 3 max_voe 3 max_voe 3 for (i = ; i <= n; i++) { f(i) = max_voe([pi,node]); // chooses he node wih he highes voe 7/8 00 Group Hosebei

Operaing Sysems SS 00 Universiy of Zurich d) opimal f and g wih minimal remoe accesses If we would allocae all he processes and all he daa resources o he same node, here would only be local accesses and, of course, ha would be opimal. :) Under he assumpion ha each node ges a leas one process, we need o look for anoher soluion ) creae he P-R-requiremens marix respecively creae a able and mark every field where process accesses a daa resource. ) o sar, all processes and all resources are allocaed o node (defaul value) 3) raverse hrough he whole marix/able and do he following for every marked cell: Calculae he number of marked cells ha would be affeced if we move he curren processresource-pair o anoher node. Choose he allocaion wih he smalles amoun of affeced cells 4) ierae hrough he whole marix/able and repea sep 3) Daa Resources R R R3 R4 R5 N 3 P P 3 oal: 5 remoe accesses f = { (,), (,), (3,), (4,3), (5,) g = { (,), (,), (3,3), (4,), (5,) e) opimal f and g for any given requiremens-marix and number of nodes Follow he insrucions in d) -4 Here we need o assure ha no node ges more han x processes (x: desired amoun of disribuion). Ierae hrough he whole marix/able unil he process coun of node equals x. Also, we do he allocaion wih he smalles amoun of affeced cells o a node whose process coun is less han x. 8/8 00 Group Hosebei