Question
Given the OpenMP code below with different possible schedule options, the code is executed on a 4 core machine to initialize an upper triangle of
Given the OpenMP code below with different possible schedule options, the code is executed on a 4 core machine to initialize an upper triangle of 100x100 matrix size with zeros.
#pragma openmp parallel for private(j) schedule( ... )
for (i = 0; i < 99; i++)
for (j = i+1; j < 100; 34-1-) {
a[i][j] = 0.0;
}
Describe each option of the schedule in relation to speed. In particular. since each iterate of the inner loop above does just one assignment. we can estimate the execution time by counting how many assignments each thread does (notice that all together, there are exactly 4,950 assignments). So for each schedule clause, estimate how long the parallel zed loop will run. Explain how you arrived at your estimates.
schedule(static)
schedule(static, 10)
schedule(static, 1)
schedule(dynamic, 1)
schedule(dynamic, 10)
schedule(dynamic, 20)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started