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