Open morris821028 opened 8 years ago
https://github.com/basepi/redblue/blob/master/redblue_omp.cpp#L91
I thinks that OpenMP default setting for sharing variable, so int rightpos, botpos; will be shared between different thread.
int rightpos, botpos;
#pragma omp parallel for num_threads(NUMTHREADS)
Another confuse problem in function int converges (int** grid, int rows, int cols, double conv, int tiles):
int converges (int** grid, int rows, int cols, double conv, int tiles)
O(tiles^2 * rowpart * colpart)
O(tiles^2)
Thanks a lot.
I haven't looked at this code in years, it was a university project. If you think there are ways to improve it, you're welcome to submit a pull request. I don't think I have time to improve it myself right now.
https://github.com/basepi/redblue/blob/master/redblue_omp.cpp#L91
I thinks that OpenMP default setting for sharing variable, so
int rightpos, botpos;
will be shared between different thread.Another confuse problem in function
int converges (int** grid, int rows, int cols, double conv, int tiles)
:O(tiles^2 * rowpart * colpart)
O(tiles^2)
?Thanks a lot.