openmp dynamic scheduling

Use this forum to discuss the book: Using OpenMP - Portable Shared Memory Parallel Programming, by Barbara Chapman, Gabriele Jost and Ruud van der Pas Read the http://openmp.org/forum/viewtopic.php?f=8&t=465 for book info and to download the examples. Post your feedback about the book and examples to this forum
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help: https://stackoverflow.com/questions/tagged/openmp
Locked
JC1119
Posts: 1
Joined: Fri Mar 11, 2016 3:52 pm

openmp dynamic scheduling

Post by JC1119 »

I'm new to openMP and parallel programming.
Given a very simple program as following:
#pragma omp parallel for num_threads(2)
for(k = 1; k <= 16; ++k)
a[k] = f(k); // this line costs T(k).
And these are the cost functions:
T(1) = 1, T(5)=5, T(9) = 9, T(13)=13
T(2) = 1, T(6)=3, T(10)=5, T(14)=7
T(3) = 3, T(7)=7, T(11)=11, T(15)=15
T(4) = 1, T(8)=1, T(12)=3, T(16)=1
The question is to compute the parallel runtime for (dynamic,1) to (dynamic,4).
Need detailed explanation.

Locked