[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] weird problem and patches (glpsol&limits)

From: Brady Hunsaker
Subject: Re: [Help-glpk] weird problem and patches (glpsol&limits)
Date: Tue, 25 May 2004 10:15:00 -0400

On Mon, 2004-05-24 at 03:30, Livio Bertacco wrote:
> Hello,
> I've attached a couple of patches and an lp problem on which glpk seems to
> have some difficulties.
> The "difficulties" on strano.lp are that I get inconsistent results
> depending on compiler and options. I'm running glpsol on a Windows XP
> machine with intel Pentium-M cpu. I'm using two versions of glpsol, one
> (glpsolg) compiled with gcc 3.3.1 and the other (glpsolm) compiled with
> VisualC++v7.1.
> I get the following results:
> glpsolg --nomip enters endless loop.
> glpsolg --nomip --nopresol says infeasible
> glpsolm --nomip finds OPTIMAL solution
> glpsolm --nomip --nopresol says infeasible
> So these are very inconsistent...(BTW cplex finds optimal solution)
> Therefore it seems that GCC and MSVC handle floating point operations
> slightly differently. Does anyone have any insight on this?
> (I used just option -O2 for gcc)

The way that x86 chips (Intel, AMD, etc.) handle floating point
operations allows for some odd behavior.  If you're not familiar with
this, you may want to read "What Every Computer Scientist Should Know
About Floating-Point Arithmetic" by David Goldberg, as well as some
follow-up commentary that correct parts of the article.  

Compiler options play a role in this behavior, since some options are
designed to speed up floating-point operations at the risk of additional
instability.  That probably explains the difference between the
compilers.  I'm not that familiar with the various gcc options, but you
could try -O0 (no optimization) and -O1 (less optimization) to see if
there are different results.  I for one would be interested in anything
you discover.

If you want to experiment with the detailed options, you could check out
gcc's manual at

> The patches are:
> c) -p or --param: set any other GLPK parameter (not already covered by
> specific options)

I really like this option.  I haven't tried using it, but if it works as
I would expect, then I hope that Andrew will include it in glpsol in the
next release.


Brady Hunsaker
Assistant Professor
Industrial Engineering
University of Pittsburgh

reply via email to

[Prev in Thread] Current Thread [Next in Thread]