Skip to content

Commit

Permalink
update FAQ ref #325
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin committed Nov 30, 2014
1 parent ce9b543 commit 3f4f8bf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,19 @@ setValue(x[3], 2.0)

If you don't set the value of a variable, the behavior is solver-dependent. Some solvers attempt to "complete" solutions that aren't completely specified.

**Q: How can I suppress output in a solver-independent way?**

A: JuMP does not currently support generic parameters independent of the chosen solver object. To suppress output with Gurobi, for example, one would say

```julia
m = Model(solver=GurobiSolver(OutputFlag=0))
```

When a solver is not specified, i.e., the model is created with ``m = Model()``, there's no option to suppress output. A workaround is to redirect STDOUT before and after the call to ``solve(m)``:

```julia
TT = STDOUT # save original STDOUT stream
redirect_stdout()
solve(m)
redirect_stdout(TT) # restore STDOUT
```

4 comments on commit 3f4f8bf

@joehuchette
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mlubin
Copy link
Member Author

@mlubin mlubin commented on 3f4f8bf Nov 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should beef up the FAQ a bit more.

@joehuchette
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure, but it's hard to determine what will be useful before someone asks for it. We should remember to add things whenever reasonable requests like this come up on the list or in the issues.

@mlubin
Copy link
Member Author

@mlubin mlubin commented on 3f4f8bf Nov 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.