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 result is
correct. When i try with the -fopenmp option the result is erroneous.
I also tried with the intel compiler icc  (with -openmp) in order to
verify the code correctness . There was no problem. I dont know what
is wrong with gcc and this particular code but the results are
erratic. If anyone of you can help me ... thanks in advance.
I do not know where the problem lies.... but the good news seems to be that
it is either corrected in the development version (gcc version 4.4.0 20080414 (experimental)), and/or it works fine on x86-64 (both 32 and 64 bit)... and I would not have expected such a speedup in the 64bit version (the timings are in milliseconds not in seconds)!!

/usr/local/gcc/bin/gcc -fopenmp -O3 taylor.c
./a.out
Reached result 8.539734 in 5650.000 seconds

/usr/local/gcc/bin/gcc -fopenmp -O3 -m32 taylor.c
./a.out
Reached result 8.539734 in 10410.000 seconds

Reply via email to