I am using openmp and my program is as follows:
\#pragma omp parallel for
for(x = 0, y = 0, x < 5, x++, y++)
function(x, y, fp);
void function(int x , int y, FILE* fp);
{
fprintf(fp, "(%d, %d)\n", x y);
}
I want the contents of the file as
(0, 0)
(2, 2)
(1, 1)
(3, 3)
(4, 4)
The order does not matter, but the x, y coordinates must be in order, that is, the program should not generate something like (2, 3). Is this behavior always guaranteed? I am using gcc compiler in linux.
source
share