[Top][All Lists]

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

Re: [Bug-glpk] Different generated model on ARMv7 and x86-64

From: Heinrich Schuchardt
Subject: Re: [Bug-glpk] Different generated model on ARMv7 and x86-64
Date: Sun, 6 Aug 2017 22:12:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 08/06/2017 09:40 PM, Andrew Makhorin wrote:
>>       FORMULA *op1;
>>       FORMULA *op2;
>> ...
>>          case O_ADD:
>>             /* addition */
>>             op1 = eval_formula(mpl, code->arg.arg.x);
>>             op2 = eval_formula(mpl, code->arg.arg.y);
>>             value = linear_comb(mpl,
>>                +1.0, op1,
>>                +1.0, op2);
>>             break;
>> gives same result on both arm64 and x86-64.
>> I suggest you change all binary operands.
> This is a normal behavior. Besides, in general case this wouldn't help
> (for example, round-off errors may affect the model generation process).
> If you need to avoid the difference in your case, just don't use random
> numbers as well as other functions having side effects.

You decided to use a constant starting value for initializing the random
function to have reproduceable runs where we use random functions.

I think in the coding we should avoid situations where the result
depends on the choice of the compiler. This may result in different
results on the same architecture when compiling with different compiler

It would better to prescribe the evaluation sequence in the coding.

I must admit that this would imply some work for you.

Best regards

Heinrich Schuchardt

reply via email to

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