Page 1 of 1

Calling GDX files

Posted: Sat Mar 18, 2023 5:21 am
by edwardmw
Hello,

I have a master gms file that I run before calling one of several gms files, depending on the simulation I am running. I am calling all files in dos.

The master gms file is used to develop the baseline data. At the end of this master gms file I store the data in a file called baseline.gdx

I want to be able to load all sets, parameters, variables, etc in this baseline.gdx file when I run each simulation gms file.

It appears that to use the syntax $gdxin followed by $load, I need to specify each set and parameter and variable that I want to load. Is there not a way to load ALL elements from the gdx file?

Re: Calling GDX files

Posted: Sat Mar 18, 2023 7:03 am
by bussieck
No, there is no way to declare and load implicitly from a GDX file. That's what restart/work/save files (https://www.gams.com/latest/docs/UG_SaveRestart.html) are for. If you create a baseline save file then you can restart your simulation from there without redeclaring and loading symbols. If that does not work for you, you can create GAMS source file with all declaration and $load instruction by using the gdxdump (https://www.gams.com/latest/docs/T_GDXDUMP.html) utility: "gdxdump baseline.gdx nodata > baseline.gms". If the GDX file was created properly the declarations in the created GAMS source will have preserved all the domain information.

-Michael

Re: Calling GDX files

Posted: Sat Mar 18, 2023 7:13 pm
by edwardmw
Thank you for this clear and helpful explanation!