Question: Parallel Computing using C, OpenMP and MPI Question: a) Write a sequential C program to compare two integer N x N arrays and report how
Parallel Computing using C, OpenMP and MPI Question:
a) Write a sequential C program to compare two integer N x N arrays and report how many elements are bigger( i.e if A[i][j] is Bigger than B[i][j], for all i and j) with a print statement. N is a defined constant set to 1000. Assume the arrays are initialized.
b) Modify the code(the answer for part a) using OpenMP directives to parallelize the code using P threads, where P is also a defined constant and N is a multiple of P.
c) Finally re-write the code(the answer for part a) to be an MPI program with P processes.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
