Description
This test ensures that asynchronous solves work as expected with different settings for the command line parameter and option holdFixedAsync. Contributor: Michael Bussieck, September 2021
Small Model of Type : GAMS
Category : GAMS Test library
Main file : asyncfix02.gms
$title Test asynchronous solves with holdFixedAsync setting (ASYNCFIX02,SEQ=874)
$onText
This test ensures that asynchronous solves work as expected with different
settings for the command line parameter and option holdFixedAsync.
Contributor: Michael Bussieck, September 2021
$offText
$onEchoV > m.gms
Variable x,y,z;
Equation e;
e.. z =e= x+y;
model m /e/;
x.fx = 3; y.lo = 0;
m.SolveLink=%solveLink.asyncGrid%;
m.holdfixed=1;
$if set optHoldFixedAsync Option HoldFixedAsync=%optHoldFixedAsync%;
solve m min z us lp;
x.l = 4;
display$readyCollect(m.handle, 100) 'waiting';
display$handleCollect(m.handle) 'collecting';
abort$(abs(x.l-%expected%) > 1e-6) 'wrong value expected: %expected%, actual', x.l;
display$handleDelete(m.handle) 'deleting';
$offEcho
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% HoldFixedAsync=0 --expected=3
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% HoldFixedAsync=1 --expected=4
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% HoldFixedAsync=0 --optHoldFixedAsync=0 --expected=3
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% HoldFixedAsync=0 --optHoldFixedAsync=1 --expected=4
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% HoldFixedAsync=1 --optHoldFixedAsync=0 --expected=3
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% HoldFixedAsync=1 --optHoldFixedAsync=1 --expected=4
* restart test
$echo option HoldFixedAsync=0; > r.gms
$call.checkErrorLevel gams r.gms lo=%GAMS.lo% s=0
$echo option HoldFixedAsync=1; > r.gms
$call.checkErrorLevel gams r.gms lo=%GAMS.lo% s=1
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% r=0 --expected=3
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% r=1 --expected=4
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% r=0 HoldFixedAsync=0 --expected=3
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% r=0 HoldFixedAsync=1 --expected=4
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% r=1 HoldFixedAsync=0 --expected=3
$call.checkErrorLevel gams m.gms lo=%GAMS.lo% r=1 HoldFixedAsync=1 --expected=4