Question: Consider the following C program. Parallelize this code using OpenMP with four threads with the following requirements: The code should be written so that a
Consider the following C program. Parallelize this code using OpenMP with four threads with the following requirements:
The code should be written so that a chunk of 10 iterations is scheduled to each thread at a time until all the iterations are complete.
Include statements to print out how many threads are being used and which part of the result each thread is working on.
Compare the execution times of C-version versus OpenMP-version for N=100 (with CHUKSIZE=10) and N =10,000 (with CHUKSIZE=100). In addition, comment on what happens when the number of threads is increased to 8 threads.

Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
