Question: I need help in solving these questions for algorithm and datastructure.... no need of coding only explanation is required with pseudo code. I have following
I need help in solving these questions for algorithm and datastructure.... no need of coding only explanation is required with pseudo code.
I have following algorithm that should be parallelized:
for i = 1 to n:
quickly_do_some_prep_work(i)
for j = 1 to m:
compute_something_expensive_and_non_parallelizable(i,j)
Let us assume that n = 100, m = 1000, and that the number of processor at my disposal p = 100. Let us also assume that the time needed to execute compute_something_expensive_and_non_parallelizable(1,j) is constant and is independed of the values of i and j:
question: what is the easiest (yet effieicint) way to paralleliza the code?
Question: let us now assume that value of n, m and p stay the same(n = 100, m = 1000, and p = 100). However, the time needed to execute compute_simething_expensive_and_non_parallelizable(i,j) varies at randome between 1 second and 20 hours. How would you now map the tasks to processor to make the computation efficient?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
