2022 Mid 1
2022 Mid 1
2022 Mid 1
i. Single Program with Multiple Data (SPMD) is a close variant of ___________ in Flynn taxonomy:
a. SIMD
b. MIMD *
c. MISD
d. SISD
iv. The number of tasks that can be executed in parallel is called _________.
a. dependency
b. degree of concurrency *
c. granularity
d. All of the above
ix. Mesh network provides better cost scalability but poor performance scalability than the bus network
a. True
b. False *
x. In case of Non-uniform Memory access, a processor cannot directly access the memory associated with
another processor
a. True *
b. False
Exploratory: Specially used to decompose the problems having underlying computation like search-space exploration.
Speculative: Usually used in the problems where different input values or output of the previous stage causes many
computationally intensive branches.
Possible steps:
(1) Speculate (guess) the output of previous stage
(2) Start performing computations in the next stage even before the completion of the previous stage.
(3) After the output of the previous stage is available, if the speculation was correct, then most of the
computation for the next step would have already been done.
Static: when the size and number of tasks are known apriori, we prefer static mapping. This mapping of tasks to
processes is done before program execution.
Dynamic: when the size and number of tasks are not known apriori, we prefer dynamic mapping. This mapping of
tasks to processes is done during program execution.
P 2 4 6 8
Execution Time
107 61.92 48.31 42.46
(seconds)
a) Calculate Speedups for each of the experimental configurations in the space provided below and
then write your answers in the table above.
200 / 107 = 1.869158 = 1.87
200 / 61.92 = 3.229974 = 3.23
200 / 48.31 = 4.1399296 = 4.14
200 / 42.46 =4.710315 = 4.71
b) Calculate the Karp-Flatt metric values in the space provided below and then write your answers
in the table above. You also have to Interpret the results of Karp-Flatt metric and write your
opinion below
((1/1.87) – (1/2)) / (1 – 1/2) = 0.06951871657 = 0.07
As ‘e’ is steadily increasing with p, it suggests that parallelization overhead is also contributing to poor
speedup. Therefore, we need to reduce this overhead to improve speedups.
a) Derive generalized expressions for arc-connectivity, diameter, bisection-width, and link cost of a 2D mesh
(without wraparound) having M rows and N columns.
OR
b) Write a multithreaded program either using Open MP or Pthreads to find the maximum value in a matrix of
size n x m. (Minimum number of threads should be 2 and maximum could be n)
(a)
Bisection width = Minimum (M, N) (i.e., the min. number of links that must be removed to partition in equal halves)
int main() {
int N, M; // values from user
matrix = new int*[N];
for(int i=0; i<N; i++) matrix[i] = new int[M];
// matrix is filled by user
pthread_t* threads;
threads = new pthread_t[N];