Description
Call "gams" executable with IncrementalMode=1. Contributor: Michael Bussieck, January 2024
Small Model of Type : GAMS
Category : GAMS Test library
Main file : gamsincr.gms
$title Test GAMS incrementalMode (GAMSINCR,SEQ=952)
$onText
Call "gams" executable with IncrementalMode=1.
Contributor: Michael Bussieck, January 2024
$offText
$call gamslib -q 1
$call.checkErrorLevel gams trnsport a=c dumpopt=22 lo=2
$if not exist trnsport.dmp16 $abort expecting trnsport.dmp16
$if exist trnsport.dmp17 $abort do not expect trnsport.dmp17
$onEcho > trnsport.dmp
Set
i 'canning plants' / seattle, san-diego /
j 'markets' / new-york, chicago, topeka /;
$offEcho
$if not dExist scratch $call mkdir scratch
* Prepare good parameter file in scratch
$call.checkErrorLevel gams trnsport lo=%gams.lo% procdir=scratch gdx=ref > %system.nullFile%
$call.checkErrorLevel gams trnsport lo=%gams.lo% procdir=scratch > %system.nullFile%
$call cat scratch/gmsprm* > pf.txt
$echo Input=trnsport.dmp >> pf.txt
$echo pf.txt > stdin.txt
$set cnt 1
$label l1
$eval cnt %cnt%+1
$call cat scratch/gmsprm* > pf%cnt%.txt
$echo Input=trnsport.dmp%cnt% >> pf%cnt%.txt
$echo pf%cnt%.txt >> stdin.txt
$if not %cnt%==16 $goTo l1
$echo gdx=incr.gdx >> pf%cnt%.txt
$echo stop >> stdin.txt
$call.checkErrorLevel gams nothing incrementalMode=1 < stdin.txt > %system.nullFile%
$onEchoV > checkrc.gms
Scalar rc /
$include %fnrc%
/;
abort$rc 'unexpected return code';
$offEcho
$call.checkErrorLevel gams checkrc lo=%gams.lo% --fnrc=pf.txt.rc
$set cnt 1
$label l2
$eval cnt %cnt%+1
$call.checkErrorLevel gams checkrc lo=%gams.lo% --fnrc=pf%cnt%.txt.rc
$if not %cnt%==16 $goTo l2
$call.checkErrorLevel gdxdiff ref.gdx incr.gdx > %system.nullFile%