Uploaded by Manpreet Singh Bhinder

CS5239 ASSIGNMENT 2

advertisement
Question 1
1.a How many states do we need? List the tuples for all the states. [2 marks]
Number of users = n = 4
Number of states
List of tuples
= ((n+1)(n+2))/2
= ((4+1)(4+2))/2
= (5*6)/2
= 30/2
= ​15
CPU
Fast Disk
Slow Disk
4
0
0
3
1
0
3
0
1
2
2
0
2
1
1
2
0
2
1
3
0
1
2
1
1
1
2
1
0
3
0
4
0
0
3
1
0
2
2
0
1
3
0
0
4
1.b How does the state-transition diagram looks like? [Since state-transition rates are not given,
use notations for the required rates.] [3 marks]
1.c Write down the set of balanced equations for solving this Markov model. [3 marks]
4 P_310 + 2 P_301 = 6P_400
4 P_220 + 2 P_211 + 3 P_400 = 10 P_310
3 P_400 + 4 P_211 + 2 P_202 = 8 P_301
3 P_310 + 4 P_130 + 2 P_121 = 10 P_220
3 P_310 + 3 P_301 + 4 P_121 + 2 P_112 = 12 P_211
3 P_301 + 4 P_112 + 2 P_103 = 8 P_202
3 P_220 + 4 P_040 + 2 P_031 = 10 P_130
3 P_220 + 3 P_211 + 4 P_031 + 2 P_022 = 12 P_121
3 P_112 + 3 P_202 + 4 P_022 + 2 P_013 = 12 P_112
3 P_202 + 4 P_013 + 2 P_004 = 8 P_103
3 P_130 = 4 P_040
3 P_130 + 3 P_121 = 6 P_031
3 P_121 + 3 P_112 = 6 P_022
3 P_112 + 3 P_103 = 6 P_013
3P_103 = 2 P_004
P_400 + P_310 + P_301 + P_220 + P_211 + P_202 + P_130 + P_121 + P_112 + P_103 +
P_040 + P_031 + P_022 + P_013 + P_004 = 1
Question 2
2.a Which system is better: M/M/1 or k M/M/1? Explain your answer. [3 marks]
Computing response time of the MM1 model
𝘱= λ / kμ
E[r]
= (1/kμ)/(1-𝘱)
= 1/kμ x 1/(1-𝘱)
= ​1/kμ(1 - p)
Computing response time of the kMM1 model
𝘱 = (λ/k) / μ
= (λ/k) x (1/μ)
= λ/kμ
E[r]
= (1/μ)/(1-𝘱)
= (1/μ) x (1/(1-𝘱))
= 1 / (μ - 𝘱μ)
= 1 / (μ - (λ/k))
= 1 / ((μk - λ)/k)
= k / (μk - λ)
= k / (μk - 𝘱kμ)
= k / (μk(1 - 𝘱))
= 1 / (μ(1 - 𝘱))
Given k > 1
We observe that the response time of MM1 model is better than kMM1 model.
2.b How does the M/M/1 system compare with the M/M/k system when the load is low and the
load is high? [3 marks]
Low load
M/M/1 Model
λ = 0.000000000001 , a very small number.
𝘱= λ / kμ ≅ 0
E[r]
= (1/kμ)/(1-𝘱)
= 1/kμ x 1/(1-𝘱)
= 1/kμ(1 - p)
= ​1/kμ
M/M/k
E[r] = E[s] + E[w]
E[s] = 1/μ
Ɛ = probability that an arriving job has to wait in the queue
E[w] = Ɛ / (kμ(1 - p))
Ɛ will be a very small number too because the model is under very little load. Hence the
probability of the job to wait in the queue is extremely low.
Ɛ ≅0
Therefore:
E[w] = Ɛ / (kμ(1 - p)) ≅ 0
E[r]
= E[s] + E[w]
= 1/μ + 0
= ​1/μ
High Load
M/M/1 model
E[r]
= (1/kμ)/(1-𝘱)
= ​Moving towards infinity
M/M/k model
E[r] = E[s] + E[w]
E[s] = 1/μ
Ɛ ≅ 1, Due to high load a lot of the jobs will have very probability to be in the waiting queue.
𝘱 ≅ 1, High load will result in high traffic intensity
(1 - 𝘱) ≅ 0
E[w] = Ɛ / (kμ(1 - p))
= 1 / (kμ(1 - p))
= ​Moving towards infinity
2.c What is your recommendation? Justify your answer. [2 marks]
Recommendation is M/M/1 model, because at low load M/M1 model performs better,
And at high load M/M/1 and M/M/k perfoamce the same.
Question 3
3.a Assume the program is run exclusively on this system. Derive an expression for the program
in terms of MIPS. [2 marks]
ρ = percentage of the program code that can be executed in parallel
n = Number of processors on system
1- ρ = percentage of the program code that can be executed in sequential
𝑿 MIPS = Execution rate.
n x ρ = Code executed by n processor
(1 - ρ) x 1 = Code executed by single processor
MIPS = ( (n x ρ) + (1 - ρ) x 1 ) x 𝑿
= (np + (1 - ρ)) 𝑿
3.b For a 16-processor system and each processor with capacity of 10 MIPS, how much
parallelism must the program have (ρ) to achieve an overall program performance of 50 and
100 MIPS? Compare and comments on the results obtained. [2 marks]
n = 16
𝑿 = 10 MIPS
Overall program performance of 50 MIPS
50 MIPS = (np + (1 - ρ)) 𝑿
= (16p + ( 1- p)) 10
= 160p + 10 - 10P
= 150p + 10
40 = 150p
p = 40/150
= 0.266667
Overall program performance of 100 MIPS
100 MIPS = (np + (1 - ρ)) 𝑿
= (16p + ( 1- p)) 10
= 160p + 10 - 10P
= 150p + 10
90 = 150p
p = 90/150
= 0.6
We can see the even though overall performance has been increased linearly but the
parallelism has not grown linearly
Download