
Hi,
With my limited knowledge of OpenMP, I am attempting to give some hints.
On Thu, Sep 16, 2010 at 5:04 AM, Max S. Kaznady
Hello,
I wrote a simple parallel program which computes the sum of elements across a matrix using Boost. When I use OpenMP, the program runs give different sums. When I use just simple arrays like double array[N][N], instead of boost::numeric::ublas::matrix<double>, the code work just fine and as expected. Does anyone know what is going on? It looks like the score function is not being modified properly, because Boost array returns just fine.
[code]
double sc = 0.0; unsigned i, j; matrix<double> temp(N, N);
#pragma omp parallel \ shared(sc,temp) \
Not sure if you can share a user defined type which does not point to a contiguous block of memory. Could you please try using a normal array instead of boost array only for 'temp' and see what happens. I am doubting race conditions since OpenMP cannot guarantee synchronous write access to 'temp' IIRC using memory barriers. -dhruva