Re: openMP gcc vs icc, erratic results with gcc

2008-05-21 Thread Jakub Jelinek
On Wed, May 21, 2008 at 11:21:27AM +0100, Ed Brambley wrote: > As I understand it (which is not necessarily correct), your code is slightly > incorrect, since variable are by default shared between parallel sections. > Therefore, the "int i" is shared between threads, and hence the erratic > result

Re: openMP gcc vs icc, erratic results with gcc

2008-05-21 Thread Ed Brambley
Dear Diego, As I understand it (which is not necessarily correct), your code is slightly incorrect, since variable are by default shared between parallel sections. Therefore, the "int i" is shared between threads, and hence the erratic results if both loops execute at the same time. To fix it, yo

Re: openMP gcc vs icc, erratic results with gcc

2008-05-21 Thread Theodore Papadopoulo
diego sandoval wrote: Hi everybody, I just started working with openMP, i installed first gcc-4.2.3 and then gcc-4.3.0, both of them having support for openMP. I tried a code to calculate the product \pi*\e. When i compile the code with gcc (both 4.2.3 and 4.3.0) withtout -fopenmp the resul

openMP gcc vs icc, erratic results with gcc

2008-05-21 Thread diego sandoval
Hi everybody, I just started working with openMP, i installed first gcc-4.2.3 and then gcc-4.3.0, both of them having support for openMP. I tried a code to calculate the product \pi*\e. When i compile the code with gcc (both 4.2.3 and 4.3.0) withtout -fopenmp the result is correct. When i try