Dumpopt

Top  Previous  Next

This keyword creates a GAMS file of input that will reproduce results encapsulating all include files into one GAMS file. If activated a file will be written containing GAMS source code for the entire problem. The file name is the input file name plus the extension DMP. Numeric input is expected with the allowable numeric values being

 

 0no dump file (default)
 1extract referenced data from the restart file using original set element names

 2    extract referenced data from the restart file using new set element names

 3    extract referenced data from the restart file using new set element names and drop symbol text

 4    extract referenced symbol declarations from the restart file

11    write processed input file without comments

21    write processed input file with all comments 

The command is implemented with

 

Dumpopt=number

 

Example:

To illustrate the use of the dumpopt option, [TRNSPORT] has been split into two files. The first file (say trans1.gms) contains most of the original file except for the solve statement, and looks as follows

 

sets

       i   canning plants   / seattle, san-diego /

       j   markets          / new-york, chicago, topeka / ;

 

parameters

       a(i)  capacity of plant i in cases

         /    seattle     350

              san-diego   600  /

 

       b(j)  demand at market j in cases

         /    new-york    325

              chicago     300

              topeka      275  / ;

 

table d(i,j)  distance in thousands of miles

                    new-york       chicago      topeka

      seattle          2.5           1.7          1.8

      san-diego        2.5           1.8          1.4  ;

 

scalar f  freight in dollars per case per thousand miles  /90/ ;

 

parameter c(i,j) transport cost in thousands of dollars per case ;

 

  c(i,j) = f * d(i,j) / 1000 ;

 

variables

    x(i,j)  shipment quantities in cases

    z       total transportation costs in thousands of dollars ;

 

positive variable x ;

 

equations

    cost        define objective function

    supply(i)   observe supply limit at plant i

    demand(j)   satisfy demand at market j ;

 

cost ..        z  =e=  sum((i,j), c(i,j)*x(i,j)) ;

supply(i) ..   sum(j, x(i,j))  =l=  a(i) ;

demand(j) ..   sum(i, x(i,j))  =g=  b(j) ;

 

model transport /all/ ;

 

Running this model and saving the work files through the save parameter leads to the generation of eight work files.

The second file (say trans2.gms) generated from [TRNSPORT] looks as follows

 

solve transport using lp minimizing z ;

display x.l, x.m ;

 

One can then run trans2.gms restarting from the saved work files generated from running trans1.gms. The result obtained is equivalent to running [TRNSPORT].

To illustrate the use of the dumpopt option, run the second model using the following command

 

gams trans2 restart=trans dumpopt=1

 

where trans is the name of the saved files generated through the save parameter from trans1.gms. A new file trans2.dmp is created as a result of this call, and looks as follows

 

* This file was written with DUMPOPT=1 at 11/30/11 08:43:06

*

*   INPUT = C:\Fred\GAMS options\test\trnsport2.gms

*    DUMP = C:\Fred\GAMS options\test\trnsport2.dmp

* RESTART = C:\Fred\GAMS options\test\trans1.g0?

*

*           with time stamp of 11/30/11 08:40:41

*

* You may have to edit this file and the input file.

 

 

* There are 5 labels

 

Set WorkFileLabelOrder dummy set to establish the proper order /

   seattle,san-diego,new-york,chicago,topeka /;

 

 

Model transport;

 

Variable z total transportation costs in thousands of dollars;

 

Set i(*) canning plants /

   seattle,san-diego /

 

Set j(*) markets /

   new-york,chicago,topeka /

 

Parameter c(i,j) transport cost in thousands of dollars per case /

   seattle.new-york 0.225,seattle.chicago 0.153,seattle.topeka 0.162,

   san-diego.new-york 0.225,san-diego.chicago 0.162,san-diego.topeka 0.126 /

 

Positive Variable x(i,j) shipment quantities in cases;

 

Parameter a(i) capacity of plant i in cases /

   seattle 350,san-diego 600 /

 

Parameter b(j) demand at market j in cases /

   new-york 325,chicago 300,topeka 275 /

 

Equation demand(j) satisfy demand at market j;

 

Equation supply(i) observe supply limit at plant i;

 

Equation cost define objective function;

 

*      *** EDITS FOR INPUT FILE ***

 

*** END OF DUMP ***