Post your solutions to the Mar 13 In-Class Exercise to this thread.
Best,
Chris
A: According to theorem, in DMRC, a PRAM computation can run in O(t) time -> 2 rounds per round ->20*2 rounds = 40
No, in a given timestep t, different processors are doing the map and reduce steps separately.
(Edited: 2019-03-13)It would need to store processor, accumulator number, and value.
'''How many map reduce rounds are needed to simulate a 20 step PRAM computation?'''
``
'''Solution:''' ''Theorem.'' Any CREW PRAM algorithm using O(n^2−2\epsilon) total memory, O(n^2−2\epsilon) processors and t(n) time can be run in O(t) rounds in DMRC. Therefore when t(n) = 20 [steps], it will take O(t) = O(20) = O(1) [rounds]. Specifically, each round of map-reduce consists of 2 mappers and 2 reducers. Over 20 timesteps and 2 rounds per timestep, \approx 40 rounds are required.
'''Our description didn't say how accumulators should be handled. Propose a method to handle them.'''
``
'''Solution:''' Our global memory does not live in any reducer or mapper and is currently described in ordered pairs/tuples. The global memory is currently the collection of all those tuples. We can handle accumulators (i.e. local memory) by creating and passing around the following quadruple (i, acc, n, v) where i is the processor number, n is the number of the accumulator, and v is the value of the accumulator. We would need to update this quadraple after each write step.
'''What would simulating the command LoadProcid k look like?'''
``
'''Solution:''' In the case of LoadProcid k, we simulate using reducer \rho_1^t to call the accumulator quadruple (i, acc, k, v) \to (i, acc, k, i).
'''In a given timestep t are all PRAM processors doing the same instruction? If not, then what's happening in the simulation?'''
``
'''Solution:''' No, each processor might be doing different instructions. The simulation functions as normal as instructions are independent.
(Edited: 2019-03-13)How many map reduce rounds are needed to simulate a 20 step PRAM computation? 40
Our description didn't say how accumulators should be handle. Propose a method to handle them. Add another (i, acc, n, v) into the global memory to represent accumulators.
What would simulating the command LoadProcid k look like? Reducer p at time t: (i, acc, k, v) -> (i, acc, k, i)
In a given timestep t are all PRAM processors doing the same instruction? If not, then what's happening in the simulation? No. Simulations are independent.
'''* How many map reduce rounds are needed to simulate a 20 step PRAM computation?'''
It will take about 40 rounds. Each PRAM step takes 2 rounds of MR.
'''* Our description didn't say how accumulators should be handle. Propose a method to handle them.'''
Accumulators can be handled by passing them between processors as a tuple, updating it after every step involving writes. The tuple could hold processor id, accumulator location, number of that accumulator, and its value.
'''* What would simulating the command LoadProcid k look like?'''
The processor's reducer could be performing
(id, acc, k, v) -> (id, acc, k, id)
'''* In a given timestep t are all PRAM processors doing the same instruction? If not, then what's happening in the simulation?'''
No, at a given time step t the processors could be simulating a different independent instruction.
(Edited: 2019-03-13)4.For a given time all PRAMs may not be doing same instruction.