OOM error while trying to solve LP
mingodad opened this issue · 3 comments
Testing the online version with an lp converted by glpsol from https://github.com/mingodad/GLPK/blob/master/examples/life_goe.mod glpsol --check -m life_goe.mod --wlp life_goe.mod.lp
(see attached) we get this error message:
Error: Error: Unable to solve the problem. HiGHS error RuntimeError: Aborted(OOM). Build with -s ASSERTIONS=1 for more info.
But with the command line we can solve it:
highs life_goe.mod.lp
Running HiGHS 1.1.1 [date: 2021-12-17, git hash: 2da8f7d4]
Copyright (c) 2021 ERGO-Code under MIT licence terms
MIP life_goe.mod has 350 rows; 388 cols; 1330 nonzeros; 248 integer variables
Presolving model
280 rows, 318 cols, 1190 nonzeros
280 rows, 318 cols, 1190 nonzeros
Objective function is integral with scale 600
Solving MIP model with:
280 rows
318 cols (178 binary, 0 integer, 0 implied int., 140 continuous)
1190 nonzeros
( 0.0s) Starting symmetry detection
( 0.0s) No symmetry present
Solving root node LP relaxation
Nodes | B&B Tree | Objective Bounds | Dynamic Constraints | Work
Proc. InQueue | Leaves Expl. | BestBound BestSol Gap | Cuts InLp Confl. | LpIters Time
0 0 0 0.00% 0 inf inf 0 0 0 168 0.0s
T 1044 0 429 100.00% 0 0 0.00% 8100 238 2200 25476 2.7s
Solving report
Status Optimal
Primal bound 0
Dual bound 0
Solution status feasible
0 (objective)
0 (bound viol.)
0 (int. viol.)
0 (row viol.)
Timing 2.67 (total)
0.00 (presolve)
0.00 (postsolve)
Nodes 1046
LP iterations 25480 (total)
0 (strong br.)
2269 (separation)
5724 (heuristics)
2.68user 0.02system 0:02.68elapsed 100%CPU (0avgtext+0avgdata 55320maxresident)k
Hello, the memory size in webassembly is unfortunately limited.
I'm not sure if this is the real problem with the size of this problem (see on previous message on command line it was using 55 MB), for example look at https://meimporta.eu/myglpk-ext/ that is glpsol
also compiled to wasm, select the model huge.mod
then press the run glpsol
button this problem needs 1.5GB to execute and it does it really well if you have enough memory, see the output bellow.
GLPSOL: GLPK LP/MIP Solver, v4.65-ex, glp_double size 8
Parameter(s) specified in the command line:
--math input_file
Reading model section from input_file...
25 lines were read
Generating zumVariance...
Generating variances...
Model has been successfully generated
GLPK Simplex Optimizer, v4.65-ex
1048576 rows, 1048576 columns, 3145725 non-zeros
Preprocessing...
1048576 rows, 1048576 columns, 3145725 non-zeros
Scaling...
A: min|aij| = 1.000e+00 max|aij| = 1.000e+00 ratio = 1.000e+00
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part is 1048575
0: obj = 0.000000000e+00 inf = 5.498e+11 (1)
1: obj = 0.000000000e+00 inf = 0.000e+00 (0)
OPTIMAL LP SOLUTION FOUND
Time used: 2.0 secs
Memory used: 1529.6 Mb (1603864700 bytes)
The arithmetic mean of the integers from 1 to 1048575 is 524288.000000
Model has been successfully processed