load12.gms : Tests filtered load

Description

This tests filtered loading at compile time. The default and $onFiltered
should be the same. With $offFiltered we should see errors when hitting
domain violations unless we use $loadFiltered explicitly.

Contributor: Lutz Westermann, December 2019


Small Model of Type : GAMS


Category : GAMS Test library


Main file : load12.gms

$title Tests filtered load (LOAD12,SEQ=806)

$onText
This tests filtered loading at compile time. The default and $onFiltered
should be the same. With $offFiltered we should see errors when hitting
domain violations unless we use $loadFiltered explicitly.

Contributor: Lutz Westermann, December 2019
$offText


$onEcho > prepData.gms
Set       i    / i1*i3 /;
Parameter p(i) / #i  2 /;
$offEcho
$call.checkErrorLevel 'gams prepData.gms lo=%GAMS.lo% gdx=data'


$onEchoV > load.gms
Set       i    / i2*i4 /;
Parameter p(i) / i4  4 /;

$onMulti
$gdxIn data.gdx
$load p

Parameter pW(i) / (i2,i3) 2, i4 4 /;

execute_unload 'p.gdx', p;
execute_unload 'pW.gdx', pW=p;

execute.checkErrorlevel 'gdxdiff p.gdx pW.gdx > %system.nullfile%';
$offEcho
$call.checkErrorLevel 'gams load.gms lo=%GAMS.lo%'


$onEchoV > load.gms
Set       i    / i2*i4 /;
Parameter p(i) / i4  4 /;

$onMulti
$onFiltered
$gdxIn data.gdx
$load p

Parameter pW(i) / (i2,i3) 2, i4 4 /;

execute_unload 'p.gdx', p;
execute_unload 'pW.gdx', pW=p;

execute.checkErrorlevel 'gdxdiff p.gdx pW.gdx > %system.nullfile%';
$offEcho
$call.checkErrorLevel 'gams load.gms lo=%GAMS.lo%'


$onEchoV > load.gms
Set       i    / i2*i4 /;
Parameter p(i) / i4  4 /;

$onMulti
$offFiltered
$gdxIn data.gdx
$load p

$if errorFree $abort 'Error expected'
$clearErrors

Parameter pW(i) / (i2,i3) 2, i4 4 /;

execute_unload 'p.gdx', p;
execute_unload 'pW.gdx', pW=p;

execute.checkErrorlevel 'gdxdiff p.gdx pW.gdx > %system.nullfile%';
$offEcho
$call.checkErrorLevel 'gams load.gms lo=%GAMS.lo%'


$onEchoV > load.gms
Set       i    / i2*i4 /;
Parameter p(i) / i4  4 /;

$onMulti
$offFiltered
$gdxIn data.gdx
$loadFiltered p

Parameter pW(i) / (i2,i3) 2, i4 4 /;

execute_unload 'p.gdx', p;
execute_unload 'pW.gdx', pW=p;

execute.checkErrorlevel 'gdxdiff p.gdx pW.gdx > %system.nullfile%';
$offEcho
$call.checkErrorLevel 'gams load.gms lo=%GAMS.lo%'