User Tools

Site Tools


gams:continuing_subsequent_solves_in_a_loop_after_gams_execution_error_abort

Continuing subsequent solves in a loop after GAMS execution error abort

When having multiple solves in a loop and GAMS aborts due to an execution error, all subsequent solve statements are ignored. Sometimes it may be desirable to continue with subsequent solves even if one solve is aborted by GAMS due to an execution error. This may be the case for example if GAMS detects infeasibilities in a model. [Note that this is different than if the solver detects infeasibilities. If the solver detects infeasibilities, subsequent solves in the loop are not affected.]

To continue with subsequent solves, one can do the following: Use the execerr command line option to increase the number of execution errors allowed before GAMS aborts. From the command line one would specify: gams (modelname) execerr=[n], where [n] is a suitable large number. GAMS will then abort only if [n] execution errors are found during model execution. The default is execerr=0, so that GAMS always aborts if an execution error is found. If you are using the GAMS/IDE, you can specify execerr=[n] in the GAMS/IDE parameter box in the upper right corner.

To entirely ignore execution errors, one can also reset the number of execution errors found after the solve statement. For example, suppose execerr=[n] has been specified during the GAMS call (either from the command line or in the IDE parameter box). One can reset the number of execution errors found during the previous solve to 0 by specifying in the model after the solve statement execerror = 0;. For example:

loop(numsolves,
  solve model using lp minimizing obj;
  execerror = 0;
);
gams/continuing_subsequent_solves_in_a_loop_after_gams_execution_error_abort.txt · Last modified: 2015/01/21 12:03 by tlastusilta