Closed quazirafi closed 2 years ago
Hello,
AutoParBench evaluates automatically parallelizers, in this case, the compiler is Autopar. As the compiler is not considering profitability, it parallelizes the first loop of the code snippet.
Ps: The paralelized loop is:
#pragma omp parallel for private (i)
for (i = 0; i <= 9; i += 1) {
ten[i][1] = 0.0;
j1[i][1] = 0;
j2[i][1] = 0;
j3[i][1] = 0;
ten[i][0] = 1.0;
j1[i][0] = 0;
j2[i][0] = 0;
j3[i][0] = 0;
}
Notice that it is not the full code snippet selected.
5, the loop just initializes variables and does not have race conditions.
Regards
Thank you so much for the reply. I am closing the issue.
Hello Sir/ Madam We are from a research group at Iowa State University, USA. We want to do a survey on Github developers on the methods they used for paralleling their code. To do the survey, We want to ask three questions about this for loop:
Can you briefly explain the purpose of using pragma for this case? If the pragma contained reduction and private clauses, can you briefly mention the purposes of variables in those clauses?
How much confidence do you have about the correctness of this implementation? You can choose from 1-5 with 1 as the lowest confidence score and 5 as the highest confidence score.
(Optional) Do you actually run (interpret the code with compilation and pass input/get output) the code and see the optimization of parallelization? Yes/No
If yes, can you provide the information of what are the input and expected output of this program (the input that caused the program to run through this for-loop). The for loop is from line 865 of file https:/github.com/LLNL/AutoParBench/blob/master/benchmarks/Autopar/NPB3.0-omp-c/MG/mg.c Here is a part of the code:
pragma omp parallel for private (i)
for (i = 0; i <= 9; i += 1) { ten[i][1] = 0.0; j1[i][1] = 0; j2[i][1] = 0; j3[i][1] = 0; ten[i][0] = 1.0; j1[i][0] = 0; j2[i][0] = 0; j3[i][0] = 0; } for (i3 = 1; i3 <= n3 - 1 - 1; i3 += 1) { for (i2 = 1; i2 <= n2 - 1 - 1; i2 += 1) { for (i1 = 1; i1 <= n1 - 1 - 1; i1 += 1) { if (z[i3][i2][i1] > ten[0][1]) { ten[0][1] = z[i3][i2][i1]; j1[0][1] = i1; j2[0][1] = i2; j3[0][1] = i3; bubble(ten,j1,j2,j3,10,1); } if (z[i3][i2][i1] < ten[0][0]) { ten[0][0] = z[i3][i2][i1]; j1[0][0] = i1; j2[0][0] = i2; j3[0][0] = i3; bubble(ten,j1,j2,j3,10,0); } } } }