|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
lp_solve finds solution on linux but "is infeasible" on aixHere is the work on linux
[grobbins@induction1 lpprobs]$ cat bales8.lp /* bales8.lp */ /* bale sizes 2 8 10 12, that is bale_qty */ /* number of bales of each size 40 70 110 20 */ /* order quantity 1953 */ /* number of bales of each size w x y z */ max: 2 w + 8 x + 10 y + 12 z; w <= 40; x <= 70; y <= 110; z <= 20; 2 w + 8 x + 10 y + 12 z <= 1953; int w; int x; int y; int z; [grobbins@induction1 lpprobs]$ lp_solve bales8.lp Value of objective function: 1952.00000000 Actual values of the variables: w 38 x 70 y 110 z 18 [grobbins@induction1 lpprobs]$ uname -a Linux induction1 2.6.18-92.el5 #1 SMP Fri May 23 22:17:30 EDT 2008 i686 i686 i386 GNU/Linux but on aix: [wcs6]$ cat bales8.lp /* bales.lp */ /* bale sizes 2 8 10 12, that is bale_qty */ /* number of bales of each size 40 70 110 20 */ /* order quantity 1953 */ /* number of bales of each size w x y z */ max: 2 w + 8 x + 10 y + 12 z; w <= 40; x <= 70; y <= 110; z <= 20; 2 w + 8 x + 10 y + 12 z <= 1953; int w; int x; int y; int z; [wcs6]$ lp_solve bales8.lp This problem is infeasible [wcs6]$ uname -a AIX wcs6 2 5 0004180F4C00 The aix box cannot solve most of the 12 examples I first developed on linux, but it can solve some: [wcs6]$ cat bales9.lp /* bales9.lp */ /* bale sizes 2 8 10 12, that is bale_qty */ /* number of bales of each size 40 70 110 20 */ /* order quantity 2153 */ /* number of bales of each size w x y z */ max: 2 w + 8 x + 10 y + 12 z; w <= 40; x <= 70; y <= 110; z <= 20; 2 w + 8 x + 10 y + 12 z <= 2153; int w; int x; int y; int z; [wcs6]$ lp_solve bales9.lp Value of objective function: 1980.00000000 Actual values of the variables: w 40 x 70 y 110 z 20 I compiled both linux and aix from source: lp_solve_5.5.0.14_source.tar.gz the most recent I could find. Any suggestions would be most appreciated. |
|
|
Re: lp_solve finds solution on linux but "is infeasible" on aixAlso on windows the model is feasible and gives the result you have under Linux.
I can only guess that something is wrong with the compilation on AIX. Maybe a C-compiler optimization that generates wrong code or so. Peter --- In lp_solve@..., "gregoryrobbins" <gregrobbins@...> wrote: > > Here is the work on linux > [grobbins@induction1 lpprobs]$ cat bales8.lp > /* bales8.lp */ > /* bale sizes 2 8 10 12, that is bale_qty */ > /* number of bales of each size 40 70 110 20 */ > /* order quantity 1953 */ > /* number of bales of each size w x y z */ > > max: 2 w + 8 x + 10 y + 12 z; > > w <= 40; > x <= 70; > y <= 110; > z <= 20; > 2 w + 8 x + 10 y + 12 z <= 1953; > > int w; > int x; > int y; > int z; > > [grobbins@induction1 lpprobs]$ lp_solve bales8.lp > > Value of objective function: 1952.00000000 > > Actual values of the variables: > w 38 > x 70 > y 110 > z 18 > [grobbins@induction1 lpprobs]$ uname -a > Linux induction1 2.6.18-92.el5 #1 SMP Fri May 23 22:17:30 EDT 2008 i686 i686 i386 GNU/Linux > > but on aix: > [wcs6]$ cat bales8.lp > /* bales.lp */ > /* bale sizes 2 8 10 12, that is bale_qty */ > /* number of bales of each size 40 70 110 20 */ > /* order quantity 1953 */ > /* number of bales of each size w x y z */ > > max: 2 w + 8 x + 10 y + 12 z; > > w <= 40; > x <= 70; > y <= 110; > z <= 20; > 2 w + 8 x + 10 y + 12 z <= 1953; > > int w; > int x; > int y; > int z; > > [wcs6]$ lp_solve bales8.lp > This problem is infeasible > [wcs6]$ uname -a > AIX wcs6 2 5 0004180F4C00 > > The aix box cannot solve most of the 12 examples I first developed on linux, but it can solve some: > [wcs6]$ cat bales9.lp > /* bales9.lp */ > /* bale sizes 2 8 10 12, that is bale_qty */ > /* number of bales of each size 40 70 110 20 */ > /* order quantity 2153 */ > /* number of bales of each size w x y z */ > > max: 2 w + 8 x + 10 y + 12 z; > > w <= 40; > x <= 70; > y <= 110; > z <= 20; > 2 w + 8 x + 10 y + 12 z <= 2153; > > int w; > int x; > int y; > int z; > [wcs6]$ lp_solve bales9.lp > > Value of objective function: 1980.00000000 > > Actual values of the variables: > w 40 > x 70 > y 110 > z 20 > > I compiled both linux and aix from source: > lp_solve_5.5.0.14_source.tar.gz > the most recent I could find. > Any suggestions would be most appreciated. > |
|
|
RE: lp_solve finds solution on linux but "is infeasible" on aixTry a lower optimization level in the ccc script in the lp_solve directory.
Check ccc.aix in the lpsolve55 directory for building the .so for other hints for aix. I see -O2 there rather than the -O3 in the ccc. I also see a ref to -lc in the .aix which I do not see in the ccc. -lc -lm -ldl _____ From: lp_solve@... [mailto:lp_solve@...] On Behalf Of gregoryrobbins Sent: Thursday, September 10, 2009 12:01 PM To: lp_solve@... Subject: [lp_solve] lp_solve finds solution on linux but "is infeasible" on aix Here is the work on linux [grobbins@induction1 lpprobs]$ cat bales8.lp /* bales8.lp */ /* bale sizes 2 8 10 12, that is bale_qty */ /* number of bales of each size 40 70 110 20 */ /* order quantity 1953 */ /* number of bales of each size w x y z */ max: 2 w + 8 x + 10 y + 12 z; w <= 40; x <= 70; y <= 110; z <= 20; 2 w + 8 x + 10 y + 12 z <= 1953; int w; int x; int y; int z; [grobbins@induction1 lpprobs]$ lp_solve bales8.lp Value of objective function: 1952.00000000 Actual values of the variables: w 38 x 70 y 110 z 18 [grobbins@induction1 lpprobs]$ uname -a Linux induction1 2.6.18-92.el5 #1 SMP Fri May 23 22:17:30 EDT 2008 i686 i686 i386 GNU/Linux but on aix: [wcs6]$ cat bales8.lp /* bales.lp */ /* bale sizes 2 8 10 12, that is bale_qty */ /* number of bales of each size 40 70 110 20 */ /* order quantity 1953 */ /* number of bales of each size w x y z */ max: 2 w + 8 x + 10 y + 12 z; w <= 40; x <= 70; y <= 110; z <= 20; 2 w + 8 x + 10 y + 12 z <= 1953; int w; int x; int y; int z; [wcs6]$ lp_solve bales8.lp This problem is infeasible [wcs6]$ uname -a AIX wcs6 2 5 0004180F4C00 The aix box cannot solve most of the 12 examples I first developed on linux, but it can solve some: [wcs6]$ cat bales9.lp /* bales9.lp */ /* bale sizes 2 8 10 12, that is bale_qty */ /* number of bales of each size 40 70 110 20 */ /* order quantity 2153 */ /* number of bales of each size w x y z */ max: 2 w + 8 x + 10 y + 12 z; w <= 40; x <= 70; y <= 110; z <= 20; 2 w + 8 x + 10 y + 12 z <= 2153; int w; int x; int y; int z; [wcs6]$ lp_solve bales9.lp Value of objective function: 1980.00000000 Actual values of the variables: w 40 x 70 y 110 z 20 I compiled both linux and aix from source: lp_solve_5.5.0.14_source.tar.gz the most recent I could find. Any suggestions would be most appreciated. |
|
|
Re: lp_solve finds solution on linux but "is infeasible" on aixThanks for the ideas --
built the libraries with opts= I hesitate to try O3 or higher since IBM says semantics of the program may change. in the ccc.aix Overrode the NOISNAN to null in my script since the original omitted the math environment variable. The ccc for lp_solve gets it set up correctly. (isnan() exists in libm so NOISNAN should be null in this environment) Took the -lc out of the build for liblpsolve55.a and it still built. Not sure any of the lp library building matters to lp_solve since it seems to include all neccessary source in its executable by directly linking the .o files from the c compiles. (I don't see a reference to -llpsolve55 in the build for lp_solve) also in building lp_solve I have modified it also with opts= I am still getting "is infeasible" in aix. At this point I am gritting my teeth and thinking I will have to trace through program with the debugger -- very time consuming. --- In lp_solve@..., "William H. Patton" <pattonwh@...> wrote: > > Try a lower optimization level in the ccc script in the lp_solve directory. > > Check ccc.aix in the lpsolve55 directory for building the .so for other > hints for aix. > > I see -O2 there rather than the -O3 in the ccc. > > I also see a ref to -lc in the .aix which I do not see in the ccc. > > -lc -lm -ldl > > > > > > _____ > > From: lp_solve@... [mailto:lp_solve@...] On Behalf > Of gregoryrobbins > Sent: Thursday, September 10, 2009 12:01 PM > To: lp_solve@... > Subject: [lp_solve] lp_solve finds solution on linux but "is infeasible" on > aix > > > > > > Here is the work on linux > [grobbins@induction1 lpprobs]$ cat bales8.lp > /* bales8.lp */ > /* bale sizes 2 8 10 12, that is bale_qty */ > /* number of bales of each size 40 70 110 20 */ > /* order quantity 1953 */ > /* number of bales of each size w x y z */ > > max: 2 w + 8 x + 10 y + 12 z; > > w <= 40; > x <= 70; > y <= 110; > z <= 20; > 2 w + 8 x + 10 y + 12 z <= 1953; > > int w; > int x; > int y; > int z; > > [grobbins@induction1 lpprobs]$ lp_solve bales8.lp > > Value of objective function: 1952.00000000 > > Actual values of the variables: > w 38 > x 70 > y 110 > z 18 > [grobbins@induction1 lpprobs]$ uname -a > Linux induction1 2.6.18-92.el5 #1 SMP Fri May 23 22:17:30 EDT 2008 i686 i686 > i386 GNU/Linux > > but on aix: > [wcs6]$ cat bales8.lp > /* bales.lp */ > /* bale sizes 2 8 10 12, that is bale_qty */ > /* number of bales of each size 40 70 110 20 */ > /* order quantity 1953 */ > /* number of bales of each size w x y z */ > > max: 2 w + 8 x + 10 y + 12 z; > > w <= 40; > x <= 70; > y <= 110; > z <= 20; > 2 w + 8 x + 10 y + 12 z <= 1953; > > int w; > int x; > int y; > int z; > > [wcs6]$ lp_solve bales8.lp > This problem is infeasible > [wcs6]$ uname -a > AIX wcs6 2 5 0004180F4C00 > > The aix box cannot solve most of the 12 examples I first developed on linux, > but it can solve some: > [wcs6]$ cat bales9.lp > /* bales9.lp */ > /* bale sizes 2 8 10 12, that is bale_qty */ > /* number of bales of each size 40 70 110 20 */ > /* order quantity 2153 */ > /* number of bales of each size w x y z */ > > max: 2 w + 8 x + 10 y + 12 z; > > w <= 40; > x <= 70; > y <= 110; > z <= 20; > 2 w + 8 x + 10 y + 12 z <= 2153; > > int w; > int x; > int y; > int z; > [wcs6]$ lp_solve bales9.lp > > Value of objective function: 1980.00000000 > > Actual values of the variables: > w 40 > x 70 > y 110 > z 20 > > I compiled both linux and aix from source: > lp_solve_5.5.0.14_source.tar.gz > the most recent I could find. > Any suggestions would be most appreciated. > |
|
|
RE: Re: lp_solve finds solution on linux but "is infeasible" on aixTry an older version say 5.5.0.5. After that the qsort was changed to
possibly deal with longer pointers. Maybe something happens there on aix. Is AIX still on other endian than x86? Maybe something bad happens there. The code for lp_solve is thought to be pure C - architecture agnostic. I think it is still running on old SUN and HPUX machines. So on AIX, set the verbose level to full ( lp_solve -v6 bales8.lp ) and see if it dumps some nasty numerics warinings. Your test problem looks quite simple. The INT solution is a simple rounding of the relaxed solution and quite close to it. There was some issue with depth_limit just fixed in 5.5.0.15 where some integer problems returned infeasible when a single int variable searched beyond 50 away from its relaxed value. Also check that the relaxed problem converges ( lp_solve v6 -noint balse8.lp ). Stuff like this would be bad The primal and dual simplex pricing strategy set to 'Devex'. Objective value -164472.089127 at iter 144. Objective value 772809746930 at iter 288. Objective value 2.41722137124e+013 at iter 432. Objective value 2.44161142203e+014 at iter 576. Objective value 4.60424895968e+021 at iter 720. lp_solve optimization was stopped by the user. _____ From: lp_solve@... [mailto:lp_solve@...] On Behalf Of gregoryrobbins Sent: Friday, September 11, 2009 11:16 AM To: lp_solve@... Subject: [lp_solve] Re: lp_solve finds solution on linux but "is infeasible" on aix Thanks for the ideas -- built the libraries with opts= I hesitate to try O3 or higher since IBM says semantics of the program may change. in the ccc.aix Overrode the NOISNAN to null in my script since the original omitted the math environment variable. The ccc for lp_solve gets it set up correctly. (isnan() exists in libm so NOISNAN should be null in this environment) Took the -lc out of the build for liblpsolve55.a and it still built. Not sure any of the lp library building matters to lp_solve since it seems to include all neccessary source in its executable by directly linking the .o files from the c compiles. (I don't see a reference to -llpsolve55 in the build for lp_solve) also in building lp_solve I have modified it also with opts= I am still getting "is infeasible" in aix. At this point I am gritting my teeth and thinking I will have to trace through program with the debugger -- very time consuming. --- In lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com, "William H. Patton" <pattonwh@...> wrote: > > Try a lower optimization level in the ccc script in the lp_solve directory. > > Check ccc.aix in the lpsolve55 directory for building the .so for other > hints for aix. > > I see -O2 there rather than the -O3 in the ccc. > > I also see a ref to -lc in the .aix which I do not see in the ccc. > > -lc -lm -ldl > > > > > > _____ > > From: lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com Behalf > Of gregoryrobbins > Sent: Thursday, September 10, 2009 12:01 PM > To: lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com > Subject: [lp_solve] lp_solve finds solution on linux but "is infeasible" on > aix > > > > > > Here is the work on linux > [grobbins@induction1 lpprobs]$ cat bales8.lp > /* bales8.lp */ > /* bale sizes 2 8 10 12, that is bale_qty */ > /* number of bales of each size 40 70 110 20 */ > /* order quantity 1953 */ > /* number of bales of each size w x y z */ > > max: 2 w + 8 x + 10 y + 12 z; > > w <= 40; > x <= 70; > y <= 110; > z <= 20; > 2 w + 8 x + 10 y + 12 z <= 1953; > > int w; > int x; > int y; > int z; > > [grobbins@induction1 lpprobs]$ lp_solve bales8.lp > > Value of objective function: 1952.00000000 > > Actual values of the variables: > w 38 > x 70 > y 110 > z 18 > [grobbins@induction1 lpprobs]$ uname -a > Linux induction1 2.6.18-92.el5 #1 SMP Fri May 23 22:17:30 EDT 2008 i686 > i386 GNU/Linux > > but on aix: > [wcs6]$ cat bales8.lp > /* bales.lp */ > /* bale sizes 2 8 10 12, that is bale_qty */ > /* number of bales of each size 40 70 110 20 */ > /* order quantity 1953 */ > /* number of bales of each size w x y z */ > > max: 2 w + 8 x + 10 y + 12 z; > > w <= 40; > x <= 70; > y <= 110; > z <= 20; > 2 w + 8 x + 10 y + 12 z <= 1953; > > int w; > int x; > int y; > int z; > > [wcs6]$ lp_solve bales8.lp > This problem is infeasible > [wcs6]$ uname -a > AIX wcs6 2 5 0004180F4C00 > > The aix box cannot solve most of the 12 examples I first developed on > but it can solve some: > [wcs6]$ cat bales9.lp > /* bales9.lp */ > /* bale sizes 2 8 10 12, that is bale_qty */ > /* number of bales of each size 40 70 110 20 */ > /* order quantity 2153 */ > /* number of bales of each size w x y z */ > > max: 2 w + 8 x + 10 y + 12 z; > > w <= 40; > x <= 70; > y <= 110; > z <= 20; > 2 w + 8 x + 10 y + 12 z <= 2153; > > int w; > int x; > int y; > int z; > [wcs6]$ lp_solve bales9.lp > > Value of objective function: 1980.00000000 > > Actual values of the variables: > w 40 > x 70 > y 110 > z 20 > > I compiled both linux and aix from source: > lp_solve_5.5.0.14_source.tar.gz > the most recent I could find. > Any suggestions would be most appreciated. > |
|
|
Re: lp_solve finds solution on linux but "is infeasible" on aixThanks William,
Obviously, I haven't checked in for a while. I appreciate you keeping this problem in mind. I'll try these ideas and let you know. The Aix system is indeed the opposite endian from x86. Greg --- In lp_solve@..., "William H. Patton" <pattonwh@...> wrote: > > Try an older version say 5.5.0.5. After that the qsort was changed to > possibly deal with longer pointers. > > Maybe something happens there on aix. Is AIX still on other endian than > x86? Maybe something bad happens there. The code for lp_solve is thought to > be pure C - architecture agnostic. I think it is still running on old SUN > and HPUX machines. > > > > So on AIX, set the verbose level to full ( lp_solve -v6 bales8.lp ) and > see if it dumps some nasty numerics warinings. Your test problem looks > quite simple. The INT solution is a simple rounding of the relaxed solution > and quite close to it. There was some issue with depth_limit just fixed in > 5.5.0.15 where some integer problems returned infeasible when a single int > variable searched beyond 50 away from its relaxed value. > > > > Also check that the relaxed problem converges ( lp_solve v6 -noint > balse8.lp ). > > > > Stuff like this would be bad > > The primal and dual simplex pricing strategy set to 'Devex'. > > > > Objective value -164472.089127 at iter 144. > > Objective value 772809746930 at iter 288. > > Objective value 2.41722137124e+013 at iter 432. > > Objective value 2.44161142203e+014 at iter 576. > > Objective value 4.60424895968e+021 at iter 720. > > lp_solve optimization was stopped by the user. > > > > _____ > > From: lp_solve@... [mailto:lp_solve@...] On Behalf > Of gregoryrobbins > Sent: Friday, September 11, 2009 11:16 AM > To: lp_solve@... > Subject: [lp_solve] Re: lp_solve finds solution on linux but "is infeasible" > on aix > > > > > > Thanks for the ideas -- > built the libraries with > opts= > I hesitate to try O3 or higher since IBM says semantics of the program may > change. > > in the ccc.aix > Overrode the NOISNAN to null in my script since the original omitted > the math environment variable. The ccc for lp_solve gets it set up > correctly. > (isnan() exists in libm so NOISNAN should be null in this environment) > Took the -lc out of the build for liblpsolve55.a and it still built. > > Not sure any of the lp library building matters to lp_solve since it seems > to include all neccessary source in its executable by directly linking the > .o files from the c compiles. (I don't see a reference to -llpsolve55 in the > build for lp_solve) > > also in building lp_solve I have modified it also with > opts= > > I am still getting "is infeasible" in aix. > > At this point I am gritting my teeth and thinking I will have to trace > through program with the debugger -- very time consuming. > > --- In lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com, > "William H. Patton" <pattonwh@> wrote: > > > > Try a lower optimization level in the ccc script in the lp_solve > directory. > > > > Check ccc.aix in the lpsolve55 directory for building the .so for other > > hints for aix. > > > > I see -O2 there rather than the -O3 in the ccc. > > > > I also see a ref to -lc in the .aix which I do not see in the ccc. > > > > -lc -lm -ldl > > > > > > > > > > > > _____ > > > > From: lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com > [mailto:lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com] On > Behalf > > Of gregoryrobbins > > Sent: Thursday, September 10, 2009 12:01 PM > > To: lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com > > Subject: [lp_solve] lp_solve finds solution on linux but "is infeasible" > on > > aix > > > > > > > > > > > > Here is the work on linux > > [grobbins@induction1 lpprobs]$ cat bales8.lp > > /* bales8.lp */ > > /* bale sizes 2 8 10 12, that is bale_qty */ > > /* number of bales of each size 40 70 110 20 */ > > /* order quantity 1953 */ > > /* number of bales of each size w x y z */ > > > > max: 2 w + 8 x + 10 y + 12 z; > > > > w <= 40; > > x <= 70; > > y <= 110; > > z <= 20; > > 2 w + 8 x + 10 y + 12 z <= 1953; > > > > int w; > > int x; > > int y; > > int z; > > > > [grobbins@induction1 lpprobs]$ lp_solve bales8.lp > > > > Value of objective function: 1952.00000000 > > > > Actual values of the variables: > > w 38 > > x 70 > > y 110 > > z 18 > > [grobbins@induction1 lpprobs]$ uname -a > > Linux induction1 2.6.18-92.el5 #1 SMP Fri May 23 22:17:30 EDT 2008 i686 > i686 > > i386 GNU/Linux > > > > but on aix: > > [wcs6]$ cat bales8.lp > > /* bales.lp */ > > /* bale sizes 2 8 10 12, that is bale_qty */ > > /* number of bales of each size 40 70 110 20 */ > > /* order quantity 1953 */ > > /* number of bales of each size w x y z */ > > > > max: 2 w + 8 x + 10 y + 12 z; > > > > w <= 40; > > x <= 70; > > y <= 110; > > z <= 20; > > 2 w + 8 x + 10 y + 12 z <= 1953; > > > > int w; > > int x; > > int y; > > int z; > > > > [wcs6]$ lp_solve bales8.lp > > This problem is infeasible > > [wcs6]$ uname -a > > AIX wcs6 2 5 0004180F4C00 > > > > The aix box cannot solve most of the 12 examples I first developed on > linux, > > but it can solve some: > > [wcs6]$ cat bales9.lp > > /* bales9.lp */ > > /* bale sizes 2 8 10 12, that is bale_qty */ > > /* number of bales of each size 40 70 110 20 */ > > /* order quantity 2153 */ > > /* number of bales of each size w x y z */ > > > > max: 2 w + 8 x + 10 y + 12 z; > > > > w <= 40; > > x <= 70; > > y <= 110; > > z <= 20; > > 2 w + 8 x + 10 y + 12 z <= 2153; > > > > int w; > > int x; > > int y; > > int z; > > [wcs6]$ lp_solve bales9.lp > > > > Value of objective function: 1980.00000000 > > > > Actual values of the variables: > > w 40 > > x 70 > > y 110 > > z 20 > > > > I compiled both linux and aix from source: > > lp_solve_5.5.0.14_source.tar.gz > > the most recent I could find. > > Any suggestions would be most appreciated. > > > |
|
|
Re: Re: lp_solve finds solution on linux but "is infeasible" on aixIt took me quite some time to figure this one out.
Fortunately I had access to an AIX system via work, but unfortunately no debugger on that environment. So I had to use printf statement to find out the problem... The problem is with the following instruction in lp_price.c: w *= 2*lp->is_lower[i] - 1; It must change the sign of w if lp->is_lower[i] is zero. Unfortunately on AIX is messes up w totally. Even when no compiler optimization is used. I guess it has to do with types. w is a real while is_lower is a char. To fix it, change it to: for(ix = 1; ix <= iy; ix++) { i = nzprow[ix]; w = prow[i] * g; /* Change sign if upper bound of the leaving variable is violated */ /* Change sign if the non-basic variable is currently upper-bounded */ /* w *= 2*lp->is_lower[i] - 1; */ /* fails on AIX!!! */ w = my_chsign(!lp->is_lower[i], w); /* Check if the candidate is worth using for anything */ my_chsign in lp_types.h also has such a strange construct: #if 0 #define my_chsign(t, x) ( ((t) && ((x) != 0)) ? -(x) : (x)) #else #define my_chsign(t, x) ( (2*((t) == 0) - 1) * (x) ) /* "Pipelined" */ #endif In Kjells version 6 code this was already changed to: #define my_chsign(t, x) ( ((t) && ((x) != 0)) ? -(x) : (x) ) /* #define my_chsign(t, x) ( (2*((t) == 0) - 1) * (x) ) */ /* "Pipelined", but problem with "negative zero" */ So for version 5.5, change the code to: #if 1 #define my_chsign(t, x) ( ((t) && ((x) != 0)) ? -(x) : (x)) #else #define my_chsign(t, x) ( (2*((t) == 0) - 1) * (x) ) /* "Pipelined", but problem with "negative zero" and possible problems on AIX */ #endif With these 2 changes, the model solves successfully on AIX. Peter From: gregoryrobbins Sent: Friday, September 25, 2009 19:04 To: lp_solve@... Subject: [lp_solve] Re: lp_solve finds solution on linux but "is infeasible" on aix Thanks William, Obviously, I haven't checked in for a while. I appreciate you keeping this problem in mind. I'll try these ideas and let you know. The Aix system is indeed the opposite endian from x86. Greg --- In lp_solve@..., "William H. Patton" <pattonwh@...> wrote: > > Try an older version say 5.5.0.5. After that the qsort was changed to > possibly deal with longer pointers. > > Maybe something happens there on aix. Is AIX still on other endian than > x86? Maybe something bad happens there. The code for lp_solve is thought to > be pure C - architecture agnostic. I think it is still running on old SUN > and HPUX machines. > > > > So on AIX, set the verbose level to full ( lp_solve -v6 bales8.lp ) and > see if it dumps some nasty numerics warinings. Your test problem looks > quite simple. The INT solution is a simple rounding of the relaxed solution > and quite close to it. There was some issue with depth_limit just fixed in > 5.5.0.15 where some integer problems returned infeasible when a single int > variable searched beyond 50 away from its relaxed value. > > > > Also check that the relaxed problem converges ( lp_solve v6 -noint > balse8.lp ). > > > > Stuff like this would be bad > > The primal and dual simplex pricing strategy set to 'Devex'. > > > > Objective value -164472.089127 at iter 144. > > Objective value 772809746930 at iter 288. > > Objective value 2.41722137124e+013 at iter 432. > > Objective value 2.44161142203e+014 at iter 576. > > Objective value 4.60424895968e+021 at iter 720. > > lp_solve optimization was stopped by the user. > > > > _____ > > From: lp_solve@... [mailto:lp_solve@...] On Behalf > Of gregoryrobbins > Sent: Friday, September 11, 2009 11:16 AM > To: lp_solve@... > Subject: [lp_solve] Re: lp_solve finds solution on linux but "is infeasible" > on aix > > > > > > Thanks for the ideas -- > built the libraries with > opts= > I hesitate to try O3 or higher since IBM says semantics of the program may > change. > > in the ccc.aix > Overrode the NOISNAN to null in my script since the original omitted > the math environment variable. The ccc for lp_solve gets it set up > correctly. > (isnan() exists in libm so NOISNAN should be null in this environment) > Took the -lc out of the build for liblpsolve55.a and it still built. > > Not sure any of the lp library building matters to lp_solve since it seems > to include all neccessary source in its executable by directly linking the > .o files from the c compiles. (I don't see a reference to -llpsolve55 in the > build for lp_solve) > > also in building lp_solve I have modified it also with > opts= > > I am still getting "is infeasible" in aix. > > At this point I am gritting my teeth and thinking I will have to trace > through program with the debugger -- very time consuming. > > --- In lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com, > "William H. Patton" <pattonwh@> wrote: > > > > Try a lower optimization level in the ccc script in the lp_solve > directory. > > > > Check ccc.aix in the lpsolve55 directory for building the .so for other > > hints for aix. > > > > I see -O2 there rather than the -O3 in the ccc. > > > > I also see a ref to -lc in the .aix which I do not see in the ccc. > > > > -lc -lm -ldl > > > > > > > > > > > > _____ > > > > From: lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com > [mailto:lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com] On > Behalf > > Of gregoryrobbins > > Sent: Thursday, September 10, 2009 12:01 PM > > To: lp_solve@yahoogroup <mailto:lp_solve%40yahoogroups.com> s.com > > Subject: [lp_solve] lp_solve finds solution on linux but "is infeasible" > on > > aix > > > > > > > > > > > > Here is the work on linux > > [grobbins@induction1 lpprobs]$ cat bales8.lp > > /* bales8.lp */ > > /* bale sizes 2 8 10 12, that is bale_qty */ > > /* number of bales of each size 40 70 110 20 */ > > /* order quantity 1953 */ > > /* number of bales of each size w x y z */ > > > > max: 2 w + 8 x + 10 y + 12 z; > > > > w <= 40; > > x <= 70; > > y <= 110; > > z <= 20; > > 2 w + 8 x + 10 y + 12 z <= 1953; > > > > int w; > > int x; > > int y; > > int z; > > > > [grobbins@induction1 lpprobs]$ lp_solve bales8.lp > > > > Value of objective function: 1952.00000000 > > > > Actual values of the variables: > > w 38 > > x 70 > > y 110 > > z 18 > > [grobbins@induction1 lpprobs]$ uname -a > > Linux induction1 2.6.18-92.el5 #1 SMP Fri May 23 22:17:30 EDT 2008 i686 > i686 > > i386 GNU/Linux > > > > but on aix: > > [wcs6]$ cat bales8.lp > > /* bales.lp */ > > /* bale sizes 2 8 10 12, that is bale_qty */ > > /* number of bales of each size 40 70 110 20 */ > > /* order quantity 1953 */ > > /* number of bales of each size w x y z */ > > > > max: 2 w + 8 x + 10 y + 12 z; > > > > w <= 40; > > x <= 70; > > y <= 110; > > z <= 20; > > 2 w + 8 x + 10 y + 12 z <= 1953; > > > > int w; > > int x; > > int y; > > int z; > > > > [wcs6]$ lp_solve bales8.lp > > This problem is infeasible > > [wcs6]$ uname -a > > AIX wcs6 2 5 0004180F4C00 > > > > The aix box cannot solve most of the 12 examples I first developed on > linux, > > but it can solve some: > > [wcs6]$ cat bales9.lp > > /* bales9.lp */ > > /* bale sizes 2 8 10 12, that is bale_qty */ > > /* number of bales of each size 40 70 110 20 */ > > /* order quantity 2153 */ > > /* number of bales of each size w x y z */ > > > > max: 2 w + 8 x + 10 y + 12 z; > > > > w <= 40; > > x <= 70; > > y <= 110; > > z <= 20; > > 2 w + 8 x + 10 y + 12 z <= 2153; > > > > int w; > > int x; > > int y; > > int z; > > [wcs6]$ lp_solve bales9.lp > > > > Value of objective function: 1980.00000000 > > > > Actual values of the variables: > > w 40 > > x 70 > > y 110 > > z 20 > > > > I compiled both linux and aix from source: > > lp_solve_5.5.0.14_source.tar.gz > > the most recent I could find. > > Any suggestions would be most appreciated. > > > |
| Free embeddable forum powered by Nabble | Forum Help |