Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the output messages in CPLEX solver?

Tags:

python

cplex

pulp

I am using Pulp modeler with python to solve an integer programming problem. I am using IBM CPLEX as a solver. When I run my Python program, I have a lot of output messages in the console like:

The CPLEX Optimizers will solve problems up to 1000 variables and 1000 constraints. IBM ILOG CPLEX Optimization Studio Preview Edition good for 48 more days ...

I look for a solution on the internet and I fix the issue. So I disable the display by writing msg=0 as follows:

from coinor.pulp import *
# ...
prob = LpProblem("MyProblem", LpMaximize)
# ...
prob.solve(CPLEX(msg=0))

Yesterday I removed some softwares from my computer and when I tried to run my Python program, Python says cannot run cplex.exe. I find out that something went wrong with my environment variables (all environment variable in path are erased). So I re-installed the CPLEX solver and I run exactly the same program but I still have the output messages now even with msg=0.

What do you think is the problem? And how can I disable the output messages?

like image 638
Learning Avatar asked Jul 03 '15 16:07

Learning


People also ask

How many variables can CPLEX handle?

CPLEX can handle 30 million variables. The more interesting question will be: does your machine have enough memory for that. CPLEX needs to store lower, upper bounds and objective function coefficients as double precision values for each variable.

Does CPLEX use simplex?

To solve such linear programming problems, CPLEX implements optimizers based on the simplex algorithms (both primal and dual simplex) as well as primal-dual logarithmic barrier algorithms and a sifting algorithm.

Is CPLEX a solver?

The CPLEX solver from IBM ILOG is a high performance solver for Linear Programming (LP), Mixed Integer Programming (MIP) and Quadratic Programming (QP/QCP/MIQP/MIQCP) problems. A detailed list of all features supported by CPLEX can be found on our Solvers page.

What is CPLEX used for?

CPLEX is a tool for solving linear optimization problems, commonly referred to as Linear Programming (LP) problems.


1 Answers

Maybe simply redirect stdout of the command to nul? cplex.exe ..your args.. > nul

like image 119
Anton Malyshev Avatar answered Sep 25 '22 18:09

Anton Malyshev