MosekTools.jl icon indicating copy to clipboard operation
MosekTools.jl copied to clipboard

Working with external server

Open aferragu opened this issue 2 years ago • 3 comments

I have some issues related to working with a remote Mosek server. In this case, the server is not the trial server (solve.mosek.com:30080) but a locally running container.

I work on Linux (Fedora 36) and Julia 1.7.2 trying the master branch of MosekTools.jl and Mosek.jl 1.2.2. My server listens in mosek://localhost:30080

First of all, the way that MosekTools handles remote servers is a bit confusing: you have to set the "fallback" parameter, which is a very bad name.

using MosekTools, JuMP
model = JuMP.Model(Mosek.Optimizer)
set_optimizer_attribute(model,"fallback","mosek://localhost:30080")
#....model stuff...
optimize!(model)
  • If Mosek.jl does not find a locally installed license then it connects to the server and solves the problem.
  • If Mosek.jl finds a local license, then it solves the problem locally.

I think this explains the name "fallback" in the sense that it only sends the problem to the remote server if there is no local license. However, I htink that this functionality is becoming more and more important in cloud deployments, so properly choosing a remote server (and providing an access token if needed) would be an interesting addition.

aferragu avatar May 18 '22 18:05 aferragu

I'll see if I can make it a configuration parameter so it select remote optimization as first priority.

In truth, the "fallback" was implemented mainly to allow the automated in tests to run on github.

ulfworsoe avatar Oct 24 '22 18:10 ulfworsoe

I think it is, in fact, already possible as it is. Please try to set the parameter "MSK_IPAR_REMOTE_OPTSERVER_HOST" to the full solver host (protocol, hostname, port). Mosek should recognize that from version 10.

ulfworsoe avatar Oct 24 '22 19:10 ulfworsoe

Great! I'll try it when I find time to update to Mosek 10

aferragu avatar Oct 28 '22 18:10 aferragu