|
From: | Domingo Alvarez Duarte |
Subject: | Re: GLPK compiled with -march=native produces different results |
Date: | Fri, 17 Jul 2020 19:44:59 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hello Peter !
Every day is a day to learn something new !
Thank you for reply !
Indeed using this option I'm getting identical outputs.
With the modifications I did to GLPK 4.65 (one of then to allow eliminate "xassert" defining "-DNDEBUG") https://github.com/mingodad/GLPK
====
CFLAGS="-g -O3 -march=native -ffp-contract=off -DWITH_SPLAYTREE
-DNDEBUG -flto" ./configure
====
Cheers !
Perhaps you are looking for -ffp-contract=off. With the default -ffp-contract=fast, GCC will make use of FMA instructions if the -march architecture supports them. FMA instructions are usually more accurate than separate multiply then add, but do not give bitwise identical results to a multiply followed by an add (because FMA has no rounding step between the multiply and the add).
On Fri, Jul 17, 2020 at 4:34 PM Domingo Alvarez Duarte <mingodad@gmail.com> wrote:
Hello !
Doing tests with GLPK I noticed that if I compile it with "-march=native
-g -O2" on a computer with an "i7" processor the solution for several
files change, the objective function result remain the same but other
values varies from model to model.
Example dist.mod:
====
6 rlim[w96] NU 3 0 3 -11283.2 #
only -O2
====
6 rlim[w96] NU 3 0 3 -11283.1 #
-O2 -march=native
====
Example mfasp.mod:
====
1 r[1,2] 9 1 # only -O2
2 r[2,3] 2 1
====
1 r[1,2] 1 1 # -O2 -march=native
2 r[2,3] 10 1
====
Cheers !
[Prev in Thread] | Current Thread | [Next in Thread] |