GDXIN produces compilation error in dump file with onEmpty

Post Reply
chrispahm
User
User
Posts: 20
Joined: 6 years ago

GDXIN produces compilation error in dump file with onEmpty

Post by chrispahm »

Hi there,

I'm (once again) running a model with the command line parameter `dumpOpt=11` in order to generate a single GAMS file containing all includes and data.
However, using GDXIN with empty empty data statements seem to create a compilation error in the .dmp file.

Consider the following minimum working example (test-empty.gms):

Code: Select all

$onempty

set empty(*);

* Uncomment to create GDX test file once
$ontext
$gdxOut test.gdx
$unload empty
$gdxOut
$offtext

$gdxin test.gdx
  $$load empty
$gdxin
     
set test(*) //;
$offempty
which produces the following .dmp file when executed with dumpOpt=11 (GAMS comments left out for brevity):

Code: Select all

$onEmpty

set empty(*);

$onMulti
Set empty(*) /
$onempty
   /;
$offempty
$offMulti

set test(*) //;
$offEmpty
Running this .dmp file then produces the following compilation error:

Code: Select all

*** Error 460 in /Users/pahmeyer/Documents/gams-empty-dumpopt/test-empty.dmp.gms[ERR:"/Users/pahmeyer/Documents/gams-empty-dumpopt/test-empty.dmp.gms",21,14][LST:21]
    Empty data statements not allowed. You may want to use $ON/OFFEMPTY
It seems that dumpOpt does not consider whether onEmpty/onMulti is already set in the current scope, and adds the $onEmpty/$onMulti block regardlessly wich cause this error. Also I would have expected that a nested $on/offEmpty block would be ignored by the compiler, maybe with a warning that nested on/offEmpty blocks are ignored?

Thanks for the help, I also attached the test-empty.gms,.dmp.gms and required .gdx file.

Best
Christoph

P.S. Despite their similar title, this is a different issue than viewtopic.php?p=26743&hilit=dumpopt#p26743!
Attachments
test-empty.dmp.gms
(435 Bytes) Downloaded 172 times
test.gdx
(425 Bytes) Downloaded 171 times
test-empty.gms
(192 Bytes) Downloaded 185 times
Lutz
User
User
Posts: 60
Joined: 7 years ago

Re: GDXIN produces compilation error in dump file with onEmpty

Post by Lutz »

Christoph,

Thanks for the report! I'll try to get the GAMS behavior improved.

Best,
Lutz
Lutz
User
User
Posts: 60
Joined: 7 years ago

Re: GDXIN produces compilation error in dump file with onEmpty

Post by Lutz »

FYI: We published the beta of GAMS 45 today. With that, the problem you reported should be fixed.

Best,
Lutz
chrispahm
User
User
Posts: 20
Joined: 6 years ago

Re: GDXIN produces compilation error in dump file with onEmpty

Post by chrispahm »

Awesome! Can confirm that v45 fixes this issue!
Post Reply