Motivating some advanced problems
Download
Report
Transcript Motivating some advanced problems
Motivating some advanced
problems
(but first some statistics about lab 2)
Lecture 21
(89150) Messages to the server based
on hour of the day (0-1, 1-2, …, 23-24)
7000
6000
5000
4000
3000
2000
1000
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
What day of the week is busiest? (1: Mon, 7: Sun)
25000
20000
15000
10000
5000
0
1
2
3
4
5
6
7
Messages since 9/2/2014 (=day 1)
18000
23rd April
16000
14000
12000
10000
8000
4th March
6000
4000
2000
0
1
5
9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77
The problems
1.
2.
3.
4.
When is it best to execute two tasks on one machine as
opposed to one task on one machine + communication
(data transfer) and computation on another?
How to design random values, which are not uniform? E.g.,
two-digit integer where the probability is: 0-9 (90%) and 1099 (10%)
How to compute the average of streamed data? (related to
lab exercise 3, where you have to compute the average
over large values)
Split the following loop, so that each of 4 threads takes the
same amount of computation. Rewrite, in terms of t, where
t is between 0 and 3.
for(i=0;i<1000;i++)
{ some_computation_on_i; }
Marking sessions for the labs: May 6th & 9th
All your lab work should be marked by May 9!