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

2017-08-06 Thread Heinrich Schuchardt
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 =

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

2017-08-06 Thread Andrew Makhorin
> 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, >

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

2017-08-06 Thread Heinrich Schuchardt
On 08/06/2017 08:20 PM, Andrew Makhorin wrote: > >> In the first two cases evaluation of pt precedes evaluation of xt while >> in the last three cases xt is evaluated before pt. At the moment I >> cannot say why this happens... > > I'm sure that this happens, because in the first two cases

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

2017-08-06 Thread Andrew Makhorin
> In the first two cases evaluation of pt precedes evaluation of xt while > in the last three cases xt is evaluated before pt. At the moment I > cannot say why this happens... I'm sure that this happens, because in the first two cases arguments passed to a function (I mean C code, not MathProg)

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

2017-08-06 Thread Andrew Makhorin
Hi Heinrich, Thank you for your help. > The following model is sufficient to demonstrate it: > > param xt := Uniform01(); > param pt := Uniform01(); > > var y, >= 0; > minimize obj : y + pt + xt; > > solve; > > printf "%f ", pt; > printf "%f\n", xt; > end; > > > > x86: (32-bit LSB

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

2017-08-06 Thread Heinrich Schuchardt
On 08/06/2017 05:52 PM, Andrew Makhorin wrote: > >> The important thing is that I observed a difference for model parameters. >> >> ./glpsol --wlp test.lp -m test.mod --check >> >> yields totally different files test.lp and different objective values. >> So this is a problem in model generation.

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

2017-08-06 Thread Andrew Makhorin
Heinrich, To see which parameters members are evaluated and in which order please add a print stmt into the routine take_member_num, file src/mpl/mpl3.c, as follows (it is marked by #if 1/#endif): double take_member_num ( MPL *mpl, PARAMETER *par, /* not changed */ TUPLE

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

2017-08-06 Thread Andrew Makhorin
> The important thing is that I observed a difference for model parameters. > > ./glpsol --wlp test.lp -m test.mod --check > > yields totally different files test.lp and different objective values. > So this is a problem in model generation. > > If I take one of the lp files as input I get the

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

2017-08-06 Thread Heinrich Schuchardt
On 08/06/2017 01:51 PM, Andrew Makhorin wrote: > Hi Heinrich, > >> the appended file test.mod is examples/threads/clustering.mod with >> appended line >> >> printf {t in T} "%d -> %d\n", t, pt[t]; >> >> Essentially the line prints out part of the generated problem. >> >> The output on x86-64

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

2017-08-06 Thread Andrew Makhorin
Hi Heinrich, > the appended file test.mod is examples/threads/clustering.mod with > appended line > > printf {t in T} "%d -> %d\n", t, pt[t]; > > Essentially the line prints out part of the generated problem. > > The output on x86-64 ends with: > > 49 -> 608 > 50 -> 334 > Model has been