debug, force to stop and get results - Printable Version

+- IEA-ETSAP Forum (
+-- Forum: Model Generators (
+--- Forum: TIMES (
+--- Thread: debug, force to stop and get results (/showthread.php?tid=234)

debug, force to stop and get results - VictorG - 16-11-2023

Dear forum members, I use the solver gurobi and I have difficulty to get results when the solver encounters a resolution error. I would like to force the barrier algorithm to stop at a given number of iterations and analyze the results to debug my model. I modified my run file with the line ”$SET ERR_ABORT NO” to get a gdx of results even if TIMES encounters a resolution error. Then I modified the .opt file to set a maximum of barrier iteration. The results I get with gurobi in this case are incomplete, for instance there is no value for OBJZ or Var_Act. I tried with CPLEX and I get a vd file which is more complete and include these two attributes. I noticed that the TIMES Solve status is different depending of the solver. Gurobi: Error unknown and cplex: Intermediate infeasible. It seems that TIMES has a different procedure for these two cases. Do you have any idea how can I get a gdx file of the result when I force to stop barrier with gurobi please ? There is attached a gams_wrk of a demo model modified for gurobi and cplex where barrier iteration are limited. Associated run logs are included. Thank you for the help Victor

RE: debug, force to stop and get results - Antti-L - 16-11-2023

The difference in the post-processing is caused by the difference in the model status and the solution information given by the solver.  Cplex is able to provide a solution even in the iteration interrupt case, and provides a status that is reported by GAMS as Intermediate Infeasible: **** SOLVER STATUS    2 Iteration Interrupt **** MODEL STATUS      6 Intermediate Infeasible **** OBJECTIVE VALUE        73549121.4264 However, Gurobi is not able to handle the interrupt equally gracefully, as it is not able to provide any solution, and GAMS therefore reports the status No Solution Returned: **** SOLVER STATUS    2 Iteration Interrupt **** MODEL STATUS      14 No Solution Returned **** OBJECTIVE VALUE              NA So, the difference in the results processing is caused by what the solvers provide to GAMS. Cplex appears better in handling exceptions.  You can of course only get a GDX file of the results only when the solver provides a solution.

RE: debug, force to stop and get results - VictorG - 17-11-2023

I understand, I missed these lines in the lst files. It seems that I am not able to use gurobi in my specific case. From what I understand in this post it is impossible to get the solution after an iteration interrupt with gurobi. Thank you for your answer Antti