10

I'm using the optional MOSEK solver with CVXOPT Quadratic Programming, i.e.

sol = cvxopt.solvers.qp(-Q,-p,G,h,A,b,solver='mosek')

Now without using the MOSEK solver, i.e.

sol = cvxopt.solvers.qp(-Q,-p,G,h,A,b)

Terminal output generated by CVXOPT can be suppressed with the command

cvxopt.solvers.options['show_progress'] = False

However, this does not work when using the MOSEK solver option. The MOSEK solver, which I have within a couple of loops, produces a lot of output I'm not interested in, meaning I can't see the output I am interested in (i.e what I choose to output using 'print').

Does anyone know if it's possible to suppress the MOSEK output? Or if not, a potential work around (pipe the output to a file or something)?

Many thanks!

Dan

p.s Sorry I couldn't include more specific tags (I'm not allowed to create new tags).

Fabian Pedregosa
  • 6,329
  • 1
  • 22
  • 20
Dan
  • 223
  • 3
  • 6

2 Answers2

4

I couldn't figure out how to pass these options through CVXOPT, but after some screening of CVXOPT's source I came up with this solution:

from cvxopt import matrix, solvers
from mosek import iparam
solvers.options['MOSEK'] = {iparam.log: 0}

It works with mosek 6.

FLab
  • 7,136
  • 5
  • 36
  • 69
pettni
  • 41
  • 3
  • This actually works for me; only instead of {mosek.iparam.log: 0} I used {iparam.log: 0}. Thanks! – Arash Sep 21 '16 at 17:22
  • 3
    For a newer version of cvxopt, you should use solvers.options['mosek'] = {iparam.log: 0} instead of capitalized MOSEK. Mmmm, a tricky design anyway – Xin Zhang Nov 06 '18 at 09:35
0

This question should be asked at the CVXOPT google-group (linked from CVXOPT homepage):

http://groups.google.com/forum/?fromgroups#!forum/cvxopt

Anyway, from the doc-strings:

>>> help(cvxopt.msk.qp)
.
.
   Options are passed to MOSEK solvers via the msk.options dictionary, 
    e.g., the following turns off output from the MOSEK solvers

        >>> msk.options = {mosek.iparam.log: 0} 

    see chapter 15 of the MOSEK Python API manual.
  • Thanks. I'm still have trouble (I'm very new to using both CVXOPT and MOSEK). I'll repost my question in the google group. – Dan Jun 12 '12 at 17:10
  • 1
    Stackoverflow is a Q&A site - and this is a perfect question. Additionally, this doesn't really answer the question, unlike the answer from @petter-nilsson – Zero Nov 12 '14 at 22:50