This is a collection of issues and questions which are not covered by the official MOSEK documentation. Click on the section of interest:

If you cannot find a satisfactory answer to your questions, or you need more help, please constact our support service.

Technical Issues

Problem on library setup on Mac OS X 10.5+

For issues related to setting up MOSEK on Mac OS X 10.5+ please refere to this note.

Multi-architecture .NET programs

For issues related to the use of MOSEK in a .NET framework please refere to this note

When using the Python interface I get a RuntimeWarning: Item size computed from the PEP 3118

This is casues by a bug in the CTypes module in Python 2.7 and 3.x, related to Issue 10744 and Issue 10746.

These issues are only registered as being related to Python 3.1+, but the ctypes code from 3.x is routinely back-ported to 2.7. The problem is that CTypes reports the size and shape of arrays correctly, but provides a wrong element formatting string: Numpy and other libraries may check this and issue a warning.

The bug appears to be harmless; we know of no cases where the invalid information is used.

Can the C API be used from Fortran?

MOSEK has no official support for FORTRAN, but if the FORTRAN compiler supports C calling convention it should be possible use to the C API. The appropriate FORTRAN compiler documentation will have to tell you how to do it.

Can MOSEK run on virtualized server such as VmWare server?

Yes,MOSEKruns fine on a virtualized server. However, particularly when solving large problems, MOSEK can exploit all the resources of computer and hence using a virtualized server may cost performance. If performance is important it is recommended to test whether MOSEK runs as fast on the virtualized server as on a native server for the relevant applications.

How do I write an MPS file using GAMS and MOSEK?

GAMS can write native MPS files but they do not include any nonlinear information so they are not useful for nonlinear problems.

However, it is possible to MPS files using MOSEK as follows. Create a file name mosek.opt that has the content

MSK_SPAR_DATA_FILE_NAME somename.mps


and then execute the command gams mygamsprogram MOSEK should now write the file somename.mps

Does MOSEK support Cygwin?

No. Cygwin is not supported. An alternative to using Cygwin is the use of MinGW toolchain that is supported by MOSEK.

Does MOSEK work with MinGW?

Yes.MOSEKincludes archives(libraries) that are compatible with MinGW and MinGW-w64. Applications built with MinGW should link with mosek7_0.lib and libmosek64_7_0.a on the platforms win32x86 and win64x86 respectively. The native import library (.lib) will not work on 64 bit Windows.

How do I dump a MOSEK task file in CVX?

Before starting the optimization, set the following option

cvx_solver_settings( 'write', 'filename.task' )


where filename.task is the chosen file name. Note that the extension determines the file format. Supported file formats are listed in the official documentation. Using .task.gz produces a gzipped file. Please use .task.gz when asking for support.

How do I set MOSEK solver parameters from CVXPY?

When invoking the solver, pass a dictionary mosek_params with pairs parameter: value. For example

prob.solve(solver=cvxpy.MOSEK, mosek_params={mosek.iparam.num_threads: 1})


will limit the number of threads to 1.

Modeling Issues

Can MOSEK solve nonconvex problems?

MOSEK cannot solve continuous non-convex optimization problems, and if non-convexity is detected, the solver will terminate. MOSEK may not always be able to detect non-convexity, but we strongly recommend not to applyMOSEKto non-convex problems.

Can MOSEK handle SOS (or SOS2) sets in mixed integer optimization?

MOSEK currently has no special support for SOS1 or SOS2 (special ordered sets). Note that SOS1 can easily be implemented with linear constraints of the form

$$x_1 + x_2 + \ldots \leq 1$$

Why does MOSEK not report a dual solution when I have solved a mixed integer problem?

In general, the dual problem corresponding to a mixed-integer problem is not well-defined. In some cases the desired dual solution'' is the one obtained by fixing all integer variables at their optimal solution values and re-solve the problem with the continuous optimizer.

Can I get the solution MOSEK produce in every iteration of the optimizer?

No. Since MOSEK performs a lot of transformations on the problem before starting to solve it, the intermediate solution values may make little sense in the context of the user-specified problem. These solution values are not made available.

Can the MOSEK interior-point optimizers be hot-started?

No, since there are no known generally reliable way to hot-start interior-point methods. This is an open research topic.

Why do not I get a good speedup when using multiple threads?

There are many reasons why a good speedup cannot be achieved when using more threads. Some of them are:

• Not all operations can be parallelized, as for instance the presolve phase.

• There is an overhead associated with using multiple threads because coordinating the multiple threads requires some management operations which cost some of the computational performance. This is particular visible if more threads than the number of cores is employed.

• Assume you are parallelizing the inner product of two long vectors using two threads. Now each thread will have to move data from main memory to CPU. Since the amount data that can be moved from main memeory and to the CPUs is limited then data movement easily becomes the bottleneck. This will limit the potential speedup.

• For many operations such as matrix multiplication then the sequential version runs relatively faster the larger the matrices are. Now if matrix multiplication is parallelized then one big matrix multiplication is replaced by several small ones leading to a loss of effciency compared to the sequential one. Hence, a linear speedup is not achived.

• Some recent CPUs may boost the clock frequency if the CPU is not loaded too heavily. This is likely to be the case if only one thread is employed. See Intel's explanation for details. This will of course offset some of the benefits of using multiple threads.

To summarize then obtaining a linear speedup when using multiple threads is nearly impossible. In fact in many cases it is not possible to obatin any speed if the job to be paralellized is small.

Why does MOSEK not produce the same solution for a problem when using multiple threads?

Solving the same problem repeatedly using multiple threads may produce different results, although optimal objective values will be the same. This is a well known side effect of the non-determinism introduced by using multiple threads: The operating system decides when a thread is serviced and in which order they are serviced. Moreover, in repeated runs, the threads are unlikely to be serviced in the same order each time.

But why does it affects the the computations? The explanation is as follows: Numerical computation are done in finite precision, hence rounding errors appear. This implies that the associative law

$$(a+b)+c = a+(b+c)$$

does not always hold, and that the order in which the computations are performed affects the result. In other words, since performing computations in multiple threads introduce a randomness in the order of the computations, the result is not deterministic.

As of MOSEK version 7 the interior-point optimizer for linear and conic problems should be from run-to-run deterministic.

Is the simplex optimizer in MOSEK parallelized?

The simplex optimizers in MOSEK are not parallelized and hence cannot exploit multiple threads. The iterations in the simplex algorithm very serial in nature, and each iteration performs so little work that they cannot efficiently be parallelized. To our knowledge, high-performance large scale parallel simplex is currently unavailable.

Is the mixed integer optimizer parallelized in MOSEK?

Yes, the branch-and-bound algorithmis parallelized. Moreover, each relaxation can be solved in parallel using either the concurrent optimizer or the parallelized interior-point optimizer.

Can a MOSEK license be used under Citrix?

This is not a case that we test for, but MOSEK employs a floating license scheme by default and that works under Citrix.

I can't run lmutil, lmgrd and MOSEKLM on Linux?

If running the command

user@hostname:~/path_to_mosek\$ ./lmutil


you get an error

./lmutil: No such file or directory


then the most likely Standard Base (LSB) version 3 or newer is not installed on your system. On Ubuntu the latest version of LSB can be installed by the command apt-get install lsb

How does the MOSEK license system work?

A license is a file which specifies:

• How many copies of MOSEK you are allowed to use simultaneously.
• Which features in MOSEK you are allowed to use.

The licenses are managed by the FLEXnet system which is included in the MOSEK distribution. The FLEXnet license system handles three types of licenses:

• Demo: A demo license (trial or academic) is not tied to any particular computer but is time limited.
• Floating: A floating license can be used from any application/program on any computer connected to computer running the license server. However, the FLEXnet license system makes sure that a floating license is only used at one server at any given point in time.
• Server: A server license can be used unlimited on a single prespecified server/computer. It is a very robust licensing method, since no token server is needed. There is no restrictions on how many applications and users that can use the license at the designated computer.

Is it possible to reserve a number licenses to particular group of users or hosts?

Yes it is. To reserve a certain number license features for a particular user or IP address, you must add lines like

RESERVE num_lic feature[:keyword=value] type {name | group_name}


Is it possible to use MOSEK on a laptop detached from the LAN(WAN)?

Yes. Either the license can be tied to USB dongle or it is possible to use the lmborrow functionality. Please see license administration guide.

The license checkout from a client is very slow. What to do?

Most likely the problem will be solved by fixing the port the license server listens on and then make the client connect to the right port. The token server line should look like

SERVER hostname hostid port


on both the server and client side.

How many license token servers should I have?

All MOSEK licenses are floating. That means if you install one license on one computer the computer can act as a token server for itself.

In reality it will often be easier and more economical to use few shared token servers rather than one per MOSEK installation. Each token server would require at least one license, and often this would mean that each license is free most of the time.

A best practice is to employ one or two token servers for each site, where 2 token servers are employed if licenses for development and production should be kept separate.

How do I get the token server working under Ubuntu?

Flexlm needs the directory /usr/tmp to exists and be writable by the user running lmgrd.

Is it possible to host a token server on Amazon Cloud?

It is definitely possible, althought some specific steps must be performed. Please see the licensing guide for details.

Miscellanea

How do I cite MOSEK in an academic publication?

The preferred way to cite MOSEK is to use a BibTex entry as

@manual{mosek,
author = "MOSEK ApS",
title = "XXX",
year = 2015,
url = "YYY"
}


where YYY is the link to the relevant manual of the specific API used, and XXX is the title of the manual main page. For instance, citing the MATLAB toolbox would result in

@manual{mosek,
author = "MOSEK ApS",
title = "The MOSEK optimization toolbox for MATLAB manual. Version 7.1 (Revision 28).",
year = 2015,
url = "http://docs.mosek.com/7.1/toolbox/index.html"
}


The same applies for al other material we provide on the web site.