GAMS to Mosel syntax

Hi,

I would like to know if there is a way to convert a model written in GAMS to a model using Mosel syntax in order to solve it with Xpress.
My model is quite large and I would like to solve it on a dedicated server, which only has an Xpress license without a GAMS license.

I was thinking of the CONVERT function, but I don’t think there’s an option for .mos files. Maybe trying to go through an intermediate syntax (e.g. AMPL and then another tool to convert to Xpress input file). Has anyone tried this or knows anything that might help?

Many thanks for your help!

I am not aware of a GAMS to Mosel converter. Moreover, the Convert options AMPL etc will translate a model instance (the outcome of a GAMS “solve” statement). not an entire GAMS model. If you have an LP/QP/MIP model instance, you can just export this in the MPS format (via convert) and give this directly to XPRESS without the detour via Mosel. I am sure XPRESS has ways to digest an MPS file.

-Michael

Thank you very much Michael for your thoughtful reply.

I took some time to make sure I could make it work. The MPS format is used and usable by most solvers, and the GAMS CONVERT function makes it fairly easy to switch to a computer that doesn’t have a GAMS environment installed.

I’d like to add a few clarifications. I recommend using the CplexMPS format, which as I understand it corresponds to the free MPS format, rather than the FixedMPS format, especially for large problems. On the one hand, it significantly reduces the size of the MPS file, at least in my case. On the other hand, for a fixed MPS file, the number of variables is limited to 10,000,000 because the variable name is coded on 8 characters. The GAMS CONVERT function may truncate a variable name (e.g. x10000000 becomes x1000000), which leads to a wrong transcription of the initial problem, and which, unless I’m mistaken, doesn’t raise any warning in GAMS.

In conclusion, the CplexMPS format is not restricted to Cplex, and works very well with other solvers such as Xpress.
What’s more, the .mps format can be compressed to .mps.gz using third-party software, which can also be used by Xpress, and is much easier to handle.