• No results found

Mastermath midterm examination Parallel Algorithms

N/A
N/A
Protected

Academic year: 2021

Share "Mastermath midterm examination Parallel Algorithms"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Mastermath midterm examination Parallel Algorithms

Teacher: Rob H. Bisseling, Utrecht University October 21, 2020

Each of the three questions is worth 10 points. Total time 120 minutes.

Motivate you answers!

1. Let A and B be square n × n matrices. Assume that we have p = M2 processors, and that n mod M = 0. Assume that A and B are both distributed by the square block distribution.

(a) [5 pt] Give an efficient BSP algorithm with 2 supersteps, in the notation we have learned for processor P (s, t), 0 ≤ s, t < M , for the computation of the matrix C = AB, where on output the matrix C is also in the square block distribution.

(b) [3 pt] Analyse the BSP cost of your algorithm.

(c) [2 pt] How much memory does your algorithm need per processor?

What would you do if less memory were available?

2. Assume that we have p processors. Processor P (s) has a vector xs of length k, for 0 ≤ s < p. Assume that k  p and that k mod p = 0.

We denote the components of the vector xs by xs[i], for 0 ≤ i < k.

The reduction of these vectors computes a vector x of length k with components x[i], defined by

x[i] =

p−1

X

t=0

xt[i], for 0 ≤ i < k.

On output, each processor P (s) should have a copy of x.

(a) [5 pt] Give an efficient BSP algorithm in the notation we have learned for processor P (s) for the reduction. Keep computation and communication cost to a minimum.

1

(2)

(b) [5 pt] Analyse the BSP cost of your algorithm.

3. Let r > 1 be an integer, called the radix. Let x be a vector of integers of length n, with 0 ≤ xi < r for 0 ≤ i < n. The vector can be identified with a very large integer x, defined by

x =

n−1

X

i=0

xiri.

An example would be the choice r = 10, where xi is the ith decimal digit, with x0 the least significant digit.

(a) [5 pt] Assume that we have two input vectors x, y, which are both distributed by the block distribution over p processors with n mod p = 0, and which represent very large integers x and y.

Assume that all processors know r.

Design an efficient BSP algorithm for the computation of the sum z = x + y, You can describe the algorithms in words (instead of the full notation we have learned). Here, z must be stored as a vector z in the same format as x and y. In particular, make sure that 0 ≤ zi < r by carrying a digit to zi+1 if needed. You may assume that x, y < rn/2 so that z will fit in the required format.

(b) [5 pt] Analyse the BSP cost of your algorithm. What is the worst case? What do you expect for a random case, where the input digits are randomly chosen integers in the range [0, r − 1]?

2

Referenties

GERELATEERDE DOCUMENTEN

b) -Use PREOS.xls to determine the atmospheric boiling point for isooctane by finding the temperature where the fugacity ratio is 1 using Solver.. -List the instructions you

2) Explain what the Vogel temperature is and, using a cartoon of circles in flow, explain to what ΔH and ΔS correspond. 3) The hydrodynamic radius corresponds to something like

Yet why should an oil-rich country like the UAE pursue a civilian nuclear power program, especially at a time when the future of nuclear-power around the world is uncertain..

Schrijf je naam op elke bladzijde en start een nieuwe pagina bij elke vraag.. Kladwerk dien je ook in,

Made available in electronic form by the T BC of A−Eskwadraat In 2005/2006, the course WISM459 was given by Rob

36 As long as a firm utilizes only lawful means, it is free to strive for competitive success and reap the benefits of whatever market position (including monopoly) that

Gedurende de termijn van zes weken kunt u naar keuze schriftelijk of mondeling uw zienswijze omtrent het plan naar voren brengen bij de gemeenteraad van Beuningen, Postbus 14, 6640 AA

Het model stelt onder meer dat extra ruimte voor wonen en werken zoveel mogelijk moet worden gezocht in of aansluitend aan bestaand bebouwd gebied en gebundeld rond de