How can I set the Threads for gurobi via CVX

CVX invoke gurobi with the default Threads (==4).
How can I modify this? THANKS!

I can set gurobi directly as

para.Threads = 16;
results = gurobi(model,para);

But do not know how to set via CVX.

best wish

Use cvx_solver_settings http://cvxr.com/cvx/doc/solver.html#advanced-solver-settings
I don’t know for sure whether number of threads is honored when Gurobi is invoked by CVX.

Thanks! That’s working.
cvx_solver_settings(‘Threads’, 16)

Depend on the maximum number of CPU.

Another question:
When I invoke gurobi directly, it is 2 or 3 times faster than through CVX.
Especially for the large-scale problem. WHY?
How can I improve the performance?

CVX takes modeling time, before the solver is called, which might not be necessary depending on what other way you invoke Gurobi. It is possible that there are different default options in whatever other way you are calling Gurobi. It’s also possible that the problem Gurobi is provided might be different and solved when called in a different environment.

CVX Is designed to save human moideling time, but at the expense of overall tun time.

Thanks for your help.

As you say, CVX take two step: modeling and optimzation.
Can I seperate these two parts?

In my procedure, the same optimization problem ( just with different data) needs be solved several times.

For saving the modeling times, can I firstly save the modeling results and then invoke Gurobi manually.

Thanks.

Not using CVX. …