output suppression

351 views
Skip to first unread message

Ido Ben-Tsion

unread,
Aug 7, 2009, 12:43:46 AM8/7/09
to pulp-or-discuss
I am using pulp-or-1.3.07.zip
I am using the default COIN-OR Lp Solver in Windows (Vista 32bit).

I am running pulp as an evaluation step in a genetic algorithm, which
requires the solution of many small problems (between a few thousands
to hundred thousand or so).

To remove the intermediate messages, I created an instance of the
solver as follows:
SilentLpSolver = COINMP_DLL(msg=0)

After some time, the program crashes with
File "C:\Python25\Lib\site-packages\pulp\pulp.py", line 1364, in
solve
status = solver.actualSolve(self, **kwargs)
File "C:\Python25\Lib\site-packages\pulp\solvers.py", line 1165, in
actualSolve
savestdout = os.dup(1)
OSError: [Errno 24] Too many open files

Can you think of something I can do about it?

Thanks, in advance,
Ido.

Stuart Mitchell

unread,
Aug 7, 2009, 8:59:16 AM8/7/09
to pulp-or...@googlegroups.com
I'll have a look at that and see what I can do.

In the meantime you could turn the messages back on COINMP_DLL() and see
if that changes things

Stu
--
___________________________________
Dr Stuart Mitchell
Research Fellow
Light Metals Research Centre (LMRC)
University of Auckland
Private Bag 92019
Auckland
New Zealand

Ph (wk) +64 9 3737599 ext 84867
(ddi) +64 9 9234967
(fax) +64 9 3737925
(mb) +64 21 441331
___________________________________

s_mitchell.vcf

Stuart Mitchell

unread,
Aug 7, 2009, 9:59:43 AM8/7/09
to pulp-or...@googlegroups.com
I have commited a fix 1.3.08 to launchpad, and pypi (sorry not
googlecode yet)

you should be able to use easyinstall to install the latest version from
pypi if you want

>easyinstall pulp-or

I will update the others later (well when you tell me that the solve
your problem)

Stu
s_mitchell.vcf

Ido Ben-Tsion

unread,
Aug 8, 2009, 4:46:51 PM8/8/09
to pulp-or...@googlegroups.com
Hi,

Thanks for the quick response.
Now that I have installed the update, pulp does not crash with that error anymore.

However, I think there is a memory leak and maybe the solver does not really release the LP's memory, since after some time the process consumes all my memory and then crashes with some memory exception or something like that.
I think this is an issue with the solver, since when I run my program without the solver - everything is fine. Furthermore, I saw that when the program finishes, there is a report describing all solved problems. This also means that the solver keeps track of all problems instead of freeing the memory.

Is there a way to just get the optimal value, without any messages and other information, and free all associated memory between problems?

Thanks again,
Ido.

BTW,
I am also checking  lpsolve, which is not included among the solvers that pulp supports. It looks like supporting it would be quite easy, since it also follows the matrix notation used by other solvers and already has some basic python bindings..

Stuart Mitchell

unread,
Aug 8, 2009, 4:52:40 PM8/8/09
to pulp-or...@googlegroups.com
Its not really a memory leak as such but you do have to be careful to
remove all references to problem instances (including variables and
constraints) so that the problems can be garbage collected.

> without the solver - everything is fine. Furthermore, I saw that when
> the program finishes, there is a report describing all solved
> problems.

What is this report??? is it generated by pulp or your program??

Stu
s_mitchell.vcf

Ido Ben-Tsion

unread,
Aug 8, 2009, 5:11:04 PM8/8/09
to pulp-or...@googlegroups.com
Maybe I should have stated that I am using Eclipse Pydev as development environment.

All the variables used were local, except the Solver object I use as follows:
SilentLpSolver = COINMP_DLL(msg=0)
When I thought there was something to do with deleting references, I tried deleting this solver object every 1000 or so times and that should have release even this object, but this didn't solve the problem. 

This report appeared on one run:
629860783 - 3 iterations time 0.002
Coin0506I Presolve 3 (0) rows, 3 (0) columns and 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0117543 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0117543 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.762986
Clp0000I Optimal - objective value 0.762986
Clp0032I Optimal objective 0.7629860783 - 3 iterations time 0.002

Sometimes it is longer, for example (in another run):
 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.657113
Clp0000I Optimal - objective value 0.657113
Clp0032I Optimal objective 0.6571126322 - 3 iterations time 0.002
Coin0506I Presolve 3 (0) rows, 3 (0) columns and 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.654261
Clp0000I Optimal - objective value 0.654261
Clp0032I Optimal objective 0.6542612294 - 3 iterations time 0.002
Coin0506I Presolve 3 (0) rows, 3 (0) columns and 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.657113
Clp0000I Optimal - objective value 0.657113
Clp0032I Optimal objective 0.6571126322 - 3 iterations time 0.002
Coin0506I Presolve 3 (0) rows, 3 (0) columns and 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.657113
Clp0000I Optimal - objective value 0.657113
Clp0032I Optimal objective 0.6571126322 - 3 iterations time 0.002
Coin0506I Presolve 3 (0) rows, 3 (0) columns and 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.657113
Clp0000I Optimal - objective value 0.657113
Clp0032I Optimal objective 0.6571126322 - 3 iterations time 0.002
Coin0506I Presolve 3 (0) rows, 3 (0) columns and 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.657113
Clp0000I Optimal - objective value 0.657113
Clp0032I Optimal objective 0.6571126322 - 3 iterations time 0.002
Coin0506I Presolve 3 (0) rows, 3 (0) columns and 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.657113
Clp0000I Optimal - objective value 0.657113
Clp0032I Optimal objective 0.6571126322 - 3 iterations time 0.002
Coin0506I Presolve 3 (0) rows, 3 (0) columns and 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.657113
Clp0000I Optimal - objective value 0.657113
Clp0032I Optimal objective 0.6571126322 - 3 iterations time 0.002
Coin0506I Presolve 3 (0) rows, 3 (0) columns and 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.657113
Clp0000I Optimal - objective value 0.657113
Clp0032I Optimal objective 0.6571126322 - 3 iterations time 0.002
Coin0506I Presolve 3 (0) rows, 3 (0) columns and 6 (0) elements
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 0  Obj -0 Dual inf 0.0099999 (1) w.o. free dual inf (0)
Clp0006I 3  Obj 0.657113
Clp0000I Optimal - objective value 0.657113
Clp0032I Optimal objective 0.6571126322 - 3 iterations time 0.002

Reply all
Reply to author
Forward
0 new messages