Skip to content

mingodad/GLPK

Repository files navigation

This is a personal repository made with the tarbals available at:

https://ftp.gnu.org/gnu/glpk/

Here is a brief of changes made to GLPK 4.65 distribution on this branch https://github.com/mingodad/GLPK/tree/local-set-param (binaries are availlable here https://github.com/mingodad/GLPK/actions/runs/2339697539):

* Added the fixes proposed on http://lists.gnu.org/archive/html/bug-glpk
* Add a reference count to ARRAY to minimize unnecessary copies
* Reorder several struct members to allow better memory usage
* Add a splaytree to replace the avltree on ARRAY structure to reduce memory usage
* Fix assertions with side effects to allow compilation with NDEBUG defined
* Replace SYMBOL structure fields by an unique nanbox field
	see https://github.com/zuiderkwast/nanbox
* Add a hash table for string interning
* Added the patches from https://github.com/lcsirmaz/inner for
	MultiObjective Linear Program (MOLP)
* Added --genall option to glpsol to pre generate all entities in a GMPL model
* Added --showdelta option to glpsol to show time/memory delta when generating a GMPL model
* Added --addmissing option to glpsol to add missing parameter values with default option
	instead of calculate then every time (that was the previous default), on one problem
	this change alone made the momory usage drop from 1.7GB to  26MB
* Add the if/then/else statements
* Add the break/continue statements
* Change the `mod` operator to behave like AMPL/GAMS
* Pending fix segfault when trying to reference a paramter while declaring it `param b := a + b;`

You can test it online here https://meimporta.eu/myglpk-ext

To get the best performance configure like:

CFLAGS="-g -O3 -march=native -ffp-contract=off -DWITH_SPLAYTREE -DNDEBUG -flto" ./configure

Or a less aggressive configuration:

CFLAGS="-g -O2 -DWITH_SPLAYTREE -DNDEBUG -flto" ./configure

Comparison:

#ubuntu package glpsol 4.65
/usr/bin/time glpsol --check -m osemosys.mod -d atlantis.dat
3.30user 0.07system 0:03.37elapsed 100%CPU (0avgtext+0avgdata 309988maxresident)k

#CFLAGS="-g -O3 -march=native -ffp-contract=off -flto" ./configure
/usr/bin/time ./glpsol-4.65-std --check -m osemosys.mod -d atlantis.dat
2.61user 0.13system 0:02.75elapsed 99%CPU (0avgtext+0avgdata 309612maxresident)k

#CFLAGS="-g -O3 -march=native -ffp-contract=off -DWITH_SPLAYTREE -DNDEBUG -flto" ./configure
/usr/bin/time ./glpsol-this-master --check -m osemosys.mod -d atlantis.dat
1.20user 0.04system 0:01.25elapsed 100%CPU (0avgtext+0avgdata 228972maxresident)k


Olga K. gewidmet

GLPK (GNU Linear Programming Kit) Version 4.65

Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2009, 2010, 2011, 2013, 2014, 2015, 2016, 2017, 2018 Andrew Makhorin,
Department for Applied Informatics, Moscow Aviation Institute, Moscow,
Russia. All rights reserved. E-mail: <mao@gnu.org>.

GLPK is part of the GNU Project released under the aegis of GNU.

GLPK is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

See the file COPYING for the GNU General Public License.

See the file INSTALL for compilation and installation instructions.

The GLPK package is a set of routines written in ANSI C and organized
in the form of a callable library. This package is intended for solving
large-scale linear programming (LP), mixed integer linear programming
(MIP), and other related problems.

The GLPK package includes the following main components:

* primal simplex method;
* dual simplex method;
* exact simplex method based on rational arithmetic;
* primal-dual interior-point method;
* branch-and-cut method;
* application program interface (API);
* GNU MathProg modeling language (a subset of AMPL);
* GLPSOL (stand-alone LP/MIP solver).

See GLPK webpage <http://www.gnu.org/software/glpk/glpk.html>.

Please report bugs to <bug-glpk@gnu.org>.