How do I automatically re-submit a model, which failed due to a solver license error?

Frequently asked questions about GAMS

Moderator: aileen

Forum rules
Please ask questions in the other sub-forums
Locked
aileen
User
User
Posts: 136
Joined: 4 years ago

How do I automatically re-submit a model, which failed due to a solver license error?

Post by aileen »

I have a batch job consisting of a large number of gams models to be run, each of these requiring cplex. I am running this on my faculty's it system, where we share a number of licenses. It varies a lot how many is available, but sometimes none are available. This answer is returned to gams, which outputs this and terminates. That is very unfortunate for my application and I would very much prefer if it waits until a license becomes available. So my question is, can some flag be set for either cplex or gams, telling gams to keep trying to find a license?
aileen
User
User
Posts: 136
Joined: 4 years ago

Re: How do I automatically re-submit a model, which failed due to a solver license error?

Post by aileen »

You can program this into your GAMS program. The GAMS/CPLEX-link returns with a license error in the solver status. If this happens, you could put your model to sleep for x seconds and try again:

Code: Select all

repeat
  solve mymodel min z using mip;
  if (mymodel.solvestat=7, display$sleep(5) 'sleep 5 seconds for Cplex license');
until mymodel.solvestat<>7;
Locked