ctrlc.gms : Interactive test for interrupt behaviour

Description


Small Model of Type : GAMS


Category : GAMS Test library


Main file : ctrlc.gms

$title 'Interactive test for interrupt behaviour' (CTRLC,SEQ=557)

$if not set solver $set solver allsolvers

$call rm -rf report%solver%.txt

$onEcho > reporthead.gms
file freport /report%solver%.txt/; freport.ap=1; put freport;
$onPut >> freport
SOLVELINK
0 GAMS operates as it has for years (default)
1 the solver is called from a  shell and GAMS remains open.
2 the solver is called with a spawn (if possible as determined by GAMS) or a shell (if the spawn is not possible) and GAMS remains open.
3 GAMS starts the solution and continues in a Grid computing environment
4 GAMS starts the solution and wait (same submission process as 3) in a Grid computing environment
5 the problem is passed to the solver in core without use of temporary files.

MODELSTAT
 1 Optimal solution achieved
 2 Local optimal solution achieved
 3 Unbounded model found
 4 Infeasible model found
 5 Locally infeasible model found (in NLPs)
 6 Solver terminated early and model was infeasible
 7 Solver terminated early and model was feasible but not yet optimal
 8 Integer solution model found
 9 Solver terminated early with a non integer solution found (only in MIPs)
10 No feasible integer solution could be found
11 Licensing problem
12 Error achieved No cause known
13 Error achieved No solution attained
14 No solution returned
15 Feasible in a CNS models
16 Locally feasible in a CNS models
17 Singular in a CNS models
18 Unbounded no solution
19 Infeasible no solution

SOLVESTAT
1 Normal termination
2 Solver ran out of iterations (fix with iterlim)
3 Solver exceeded time limit (fix with reslim)
4 Solver quit with a problem (see LST file) found
5 Solver quit with excessive nonlinear term evaluation errors (see LST file and fix with bounds or domlim)
6 Solver terminated for unknown reason (see LST file)
7 Solver terminated with preprocessor error (see LST file)
8 User interrupt
9,10,11,12,13 Solver terminated with some type of failure (see LST file)
$offPut
put freport /'FILE', @16'MODELTYPE', @29'SOLVER', @42'SL', @45'MS', @48'SS'/;
$offEcho

* %1 = solver, %2 = filename
$onEchoV > miptest.inc
$call gams %2.gms sl=0 lo=%GAMS.lo% mip=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=1 lo=%GAMS.lo% mip=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=2 lo=%GAMS.lo% mip=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=5 lo=%GAMS.lo% mip=%1 optcr=0 --solver=%solver%
$offEcho

* %3 = n, parameter to vary model size
$onEchoV > nlptest.inc
$call gams %2.gms --n=%3 sl=0 lo=%GAMS.lo% nlp=%1 optcr=0 --solver=%solver%
$call gams %2.gms --n=%3 sl=1 lo=%GAMS.lo% nlp=%1 optcr=0 --solver=%solver%
$call gams %2.gms --n=%3 sl=2 lo=%GAMS.lo% nlp=%1 optcr=0 --solver=%solver%
$call gams %2.gms --n=%3 sl=5 lo=%GAMS.lo% nlp=%1 optcr=0 --solver=%solver%
$offEcho

$onEchoV > nlptest2.inc
$call gams %2.gms sl=0 lo=%GAMS.lo% nlp=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=1 lo=%GAMS.lo% nlp=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=2 lo=%GAMS.lo% nlp=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=5 lo=%GAMS.lo% nlp=%1 optcr=0 --solver=%solver%
$offEcho

$onEchoV > minlptest.inc
$call gams %2.gms sl=0 lo=%GAMS.lo% minlp=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=1 lo=%GAMS.lo% minlp=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=2 lo=%GAMS.lo% minlp=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=5 lo=%GAMS.lo% minlp=%1 optcr=0 --solver=%solver%
$offEcho

$onEchoV > mcptest.inc
$call gams %2.gms sl=0 lo=%GAMS.lo% mcp=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=1 lo=%GAMS.lo% mcp=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=2 lo=%GAMS.lo% mcp=%1 optcr=0 --solver=%solver%
$call gams %2.gms sl=5 lo=%GAMS.lo% mcp=%1 optcr=0 --solver=%solver%
$offEcho


*import required models
*MIP
$call testlib -q n3707
$onEchoV >> n3707.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'n3707', @16'MIP', @29"%gams.mip% ", @42"%gams.solvelink% ", @45 m.modelstat:2:0, @48 m.solvestat:2:0;
$offEcho

$call testlib -q mod011
$onEchoV >> mod011.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'mod011', @16'MIP', @29"%gams.mip% ", @42"%gams.solvelink% ", @45 m.modelstat:2:0, @48 m.solvestat:2:0;
$offEcho

*NLP
$call gamslib -q popdynm
$onEchoV >> popdynm.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'popdynm', @16'NLP', @29"%gams.nlp% ", @42"%gams.solvelink% ", @45 popdynm.modelstat:2:0, @48 popdynm.solvestat:2:0;
$offEcho

$call gamslib -q catmix
$onEchoV >> catmix.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'catmix', @16'NLP', @29"%gams.nlp% ", @42"%gams.solvelink% ", @45 catmix.modelstat:2:0, @48 catmix.solvestat:2:0;
$offEcho

*MINLP
$call testlib -q fuzzy
$onEchoV >> fuzzy.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'fuzzy', @16'MINLP', @29"%gams.minlp% ", @42"%gams.solvelink% ", @45 m.modelstat:2:0, @48 m.solvestat:2:0;
$offEcho

$call testlib -q nuclear49b
$onEchoV >> nuclear49b.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'nuclear49b', @16'MINLP', @29"%gams.minlp% ", @42"%gams.solvelink% ", @45 m.modelstat:2:0, @48 m.solvestat:2:0;
$offEcho

$call gamslib -q pump
$onEchoV >> pump.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'pump', @16'MINLP', @29"%gams.minlp% ", @42"%gams.solvelink% ", @45 pump.modelstat:2:0, @48 pump.solvestat:2:0;
$offEcho

$call testlib -q enpro56
$onEchoV >> enpro56.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'enpro56', @16'MINLP', @29"%gams.minlp% ", @42"%gams.solvelink% ", @45 m.modelstat:2:0, @48 m.solvestat:2:0;
$offEcho

*MCP
$call testlib -q popdynmMCP25
$onEchoV >> popdynmMCP25.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'popdynmMCP25', @16'MCP', @29"%gams.mcp% ", @42"%gams.solvelink% ", @45 m.modelstat:2:0, @48 m.solvestat:2:0;
$offEcho

$call testlib -q popdynmMCP250
$onEchoV >> popdynmMCP250.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'popdynmMCP250', @16'MCP', @29"%gams.mcp% ", @42"%gams.solvelink% ", @45 m.modelstat:2:0, @48 m.solvestat:2:0;
$offEcho

$call testlib -q popdynmMCP1000
$onEchoV >> popdynmMCP1000.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'popdynmMCP100', @16'MCP', @29"%gams.mcp% ", @42"%gams.solvelink% ", @45 m.modelstat:2:0, @48 m.solvestat:2:0;
$offEcho

*MPSGE
$call testlib -q gft
$onEchoV >> gft.gms
file freport /report%solver%.txt/; freport.ap=1; put freport 'gft', @16'MPSGE', @29"%gams.mcp% ", @42"%gams.solvelink% ", @45 gtap8.modelstat:2:0, @48 gtap8.solvestat:2:0;
$offEcho

$call gams reporthead.gms lo=%GAMS.lo% --solver=%solver%
$ifI %solver% == alphaecp       $goTo testalphaecp
$ifI %solver% == baron          $goTo testbaron
$ifI %solver% == cbc            $goTo testcbc
$ifI %solver% == conopt         $goTo testconopt
$ifI %solver% == cplex          $goTo testcplex
$ifI %solver% == dicopt         $goTo testdicopt
$ifI %solver% == gurobi         $goTo testgurobi
$ifI %solver% == ipopt          $goTo testipopt
$ifI %solver% == knitro         $goTo testknitro
$ifI %solver% == lindo          $goTo testlindo
$ifI %solver% == lindoglobal    $goTo testlindoglobal
$ifI %solver% == miles          $goTo testmiles
$ifI %solver% == minos          $goTo testminos
$ifI %solver% == mosek          $goTo testmosek
$ifI %solver% == nlpec          $goTo testnlpec
$ifI %solver% == path           $goTo testpath
$ifI %solver% == pathnlp        $goTo testpathnlp
$ifI %solver% == sbb            $goTo testsbb
$ifI %solver% == scip           $goTo testscip
$ifI %solver% == xpress         $goTo testxpress
$ifI NOT %solver% == allsolvers $abort 'solver does not exist'

$label testalphaecp
$batInclude      minlptest.inc   alphaecp        fuzzy
$if NOT %solver% == allsolvers   $exit

$label testbaron
$batInclude      miptest.inc     baron           n3707
$batInclude      nlptest.inc     baron           popdynm         10
$batInclude      minlptest.inc   baron           pump
$if NOT %solver% == allsolvers   $exit

$label testcbc
$batInclude      miptest.inc     cbc             mod011
$if NOT %solver% == allsolvers   $exit

$label testconopt
$batInclude      nlptest.inc     conopt          popdynm         1000
$if NOT %solver% == allsolvers   $exit

$label testcplex
$batInclude      miptest.inc     cplex           n3707
$if NOT %solver% == allsolvers   $exit

$label testdicopt
$batInclude      minlptest.inc   dicopt          nuclear49b
$if NOT %solver% == allsolvers   $exit

$label testgurobi
$batInclude      miptest.inc     gurobi          n3707
$if NOT %solver% == allsolvers   $exit

$label testipopt
$batInclude      nlptest.inc     ipopt           popdynm         1000
$if NOT %solver% == allsolvers   $exit

$label testknitro
$batInclude      nlptest.inc     knitro          popdynm         2000
$batInclude      minlptest.inc   knitro          enpro56
$if NOT %solver% == allsolvers   $exit

$label testlindo
$batInclude      miptest.inc     lindo           n3707
$batInclude      nlptest2.inc    lindo           catmix
$batInclude      minlptest.inc   lindo           pump
$if NOT %solver% == allsolvers   $exit

$label testlindoglobal
$batInclude      miptest.inc     lindoglobal     n3707
$batInclude      nlptest2.inc    lindoglobal     catmix
$batInclude      minlptest.inc   lindoglobal     pump
$if NOT %solver% == allsolvers   $exit

$label testmiles
$batInclude      mcptest.inc     miles           popdynmMCP25
$if NOT %solver% == allsolvers   $exit

$label testminos
$batInclude      nlptest.inc     minos           popdynm         250
$if NOT %solver% == allsolvers   $exit

$label testmosek
$batInclude      miptest.inc     mosek            n3707
$if NOT %solver% == allsolvers   $exit

$label testnlpec
$batInclude      mcptest.inc     nlpec           popdynmMCP250
$if NOT %solver% == allsolvers   $exit

$label testpath
$batInclude      mcptest.inc     path            popdynmMCP1000
$batInclude      mcptest.inc     path            gft
$if NOT %solver% == allsolvers   $exit

$label testpathnlp
$batInclude      nlptest.inc     pathnlp         popdynm         500
$if NOT %solver% == allsolvers   $exit

$label testsbb
$batInclude      minlptest.inc   sbb             enpro56
$if NOT %solver% == allsolvers   $exit

$label testscip
$batInclude      miptest.inc     scip            n3707
$batInclude      nlptest.inc     scip            popdynm         10
$batInclude      minlptest.inc   scip            pump
$if NOT %solver% == allsolvers   $exit

$label testxpress
$batInclude      miptest.inc     xpress          n3707
$if NOT %solver% == allsolvers   $exit