I am new to Openmp, and my task is to improve the below code using two different possibilities:
// Size = 400, CHUNKSIZE = 100 and there are 4 threads
#pragma omp parallel for schedule(static, CHUNK_SIZE)
for(int i=0; i<SIZE; i++){
for(int k=0; k<i; k++){
A[i][k] = 42*foo
}
}
At first I would change the schedule from static to guided, because the work in the second loop is unbalanced and steadily growing.
So at first the chunk size starts off large and decreases to better handle load imbalance between iterations.
The larger ì becomes, the more work it is for the second loop.
At this point I am not sure, if dynamic may be better instead of guided?
For the second possibility I have no idea.