Hi Asad

I think the speed vs. accuracy tradeoff will always be there.
Getting both at the same time is kind of a holy grail,
everybody wants it!
Whoever asked you to get both gotta be kidding.

Somebody already suggested enforcing IEEE floating point standard,
if you want numerical accuracy and portability.
However, you loose performance with strict IEEE,
as you do if you don't use O2 or O3, or SSE/SSE2/etc instructions.
As far as I know, there is no way out of that.

Nevertheless, if your algorithm is carefully designed,
you may get very good results even if you optimize.

Here is a classic and simple article about IEEE arithmetic:
perso.ens-lyon.fr/jean-michel.muller/goldberg.pdf
www.math.umd.edu/~jkolesar/mait613/floating_point_math.pdf

Wikipedia on compiler optimization explains the basics:
http://en.wikipedia.org/wiki/Compiler_optimization

Wikipedia on numerical analysis (round-off error propagation and more):
http://en.wikipedia.org/wiki/Numerical_analysis

which is a huge scientific field:
http://history.siam.org/

IIRR, you are using gcc, so check this out for the gcc
compiler optimization options and what they do:
http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
http://www.network-theory.co.uk/docs/gccintro/gccintro_49.html
http://www.linuxjournal.com/article/7269

I am afraid there is no simple answer to your questions,
or solution to your frustration.
At least I don't know the answer/solution.
I wish I did.
Remember what Jeff Squyres said on this thread:
'As one of my teachers told me, many years ago, "10.0 divided by 1.0 is rarely 10.0."'

Now indeed we got off topic.
There may be other forums where you could get more help regarding
optimization and how to design your program to be, let's say,
"optimization-safe".
Hopefully one of the experts on this list could make a suggestion.

Gus Correa
---------------------------------------------------------------------
Gustavo Correa
Lamont-Doherty Earth Observatory - Columbia University
Palisades, NY, 10964-8000 - USA
---------------------------------------------------------------------

Asad Ali wrote:
Hi all,

Many many thanks to all of you for your time, sincere help, useful tips and advices. I have solved that problem. I just removed the gcc flag -O3 from my compile script and the error vanished. However the speed of my code is also reduced to 50 iterations/minute from 70 iterations/minute, still not bad.

Is there any alternative to -O3 flag?

I tried -O2 too but this also gives errors.
I know this is now a non-openmpi problem but I know this is the forum of experienced programmers so I hope you people would tolerate me and would help me.

Cheers,

Asad


On Wed, Apr 28, 2010 at 4:59 AM, Gus Correa <g...@ldeo.columbia.edu <mailto:g...@ldeo.columbia.edu>> wrote:

    Hi Dave


    Dave Love wrote:

        Gus Correa <g...@ldeo.columbia.edu
        <mailto:g...@ldeo.columbia.edu>> writes:

            Or run a serial version on the same set of machines,
            compiled in similar ways (compiler version, opt flags, etc)
            to the parallel versions, and compare results.
            If the results don't differ, then you can start blaming MPI.


        That wouldn't show that there's actually any OpenMPI-specific
        problem,
        though -- the parallelism potentially introduces indeterminacy.  [I
        don't mean to imply Guy thinks otherwise, or that anyone has enough
        information to guess what's actually happening.]  General
        discussion of
        numerical issues and scientific computing war stories must be way
        off-topic here...


    You are right.
    Actually, on a case of an ocean model that I tested this way,
    exactly the opposite happened.
    The optimization flags were the main cause of changes in the results,
    as expected.
    Whether the code was compiled and run serial or parallel with MPI
    made little difference (although it might).

    Well, IMHO, this is not totally off topic.
    I don't think it hurts the list protocol to have a relatively
    lax criterion for what is on or off.
    After all, the original question and the following
    discussion was about whether MPI (OpenMPI in particular)
    can affect or not numerical accuracy.

    Regards,
    Gus Correa

        _______________________________________________
        users mailing list
        us...@open-mpi.org <mailto:us...@open-mpi.org>
        http://www.open-mpi.org/mailman/listinfo.cgi/users


    _______________________________________________
    users mailing list
    us...@open-mpi.org <mailto:us...@open-mpi.org>
    http://www.open-mpi.org/mailman/listinfo.cgi/users




--
"Statistical thinking will one day be as necessary for efficient citizenship as the ability to read and write." - H.G. Wells


------------------------------------------------------------------------

_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users

Reply via email to