restart1.gms : Test restart from old workfiles

Description

Windows (32 Bit) is the only platform left that created old workfiles


Small Model of Type : GAMS


Category : GAMS Test library


Main file : restart1.gms

$title Test restart from old workfiles (restart1,SEQ=90)

* Windows (32 Bit) is the only platform left that created old workfiles
$ifi %system.platform% == WIN $goto haveWorkfiles
abort.noError "No old workfiles exist for platform = %system.platform%: exiting";
$exit

$label haveWorkfiles

$echo {print "'" substr($0,match($0,/[1-9][0-9]\.[0-9]/),4)"'"} > d.awk
$call gmsunzip -v restest | grep -i TRNSPORT.G01 | awk -f d.awk | sort | uniq > rdist.txt
$call rm -rf restart


Set rdist distribution restart files /
$include rdist.txt
    /;

* Create run script
$echo display x.l; > rtrans.gms

file fx /rescript.gms/; fx.pw=1024;
put fx   '$call gmsunzip -Coq restest restart%system.dirsep%*'
       / '$if errorlevel 1 $abort "Could not run gmsunzip"'
loop(rdist,
  put  / '$if exist restart%system.dirsep%' rdist.tl:0 '%system.dirsep%trnsport.g01'
       / '$call =gams rtrans lo=%GAMS.lo% r=restart%system.dirsep%' rdist.tl:0 '%system.dirsep%trnsport'
       / '$if errorlevel 1 $error "Restart Distribution:' rdist.tl:0 '"';
);

putclose fx;

Scalar rc;
execute '=gams rescript lo=%GAMS.lo%';
rc=errorlevel;
abort$rc 'Restart Test Failed';