Download gams a user's guide
Transcript
E Appendix E: THE SAVE AND RESTART FEATURE E.1 INTRODUCTION GAMS saves the information provided in the input files in intermediate, mostly binary, files. These files are referred to as "work files" or "scratch files". Some of these files are used to exchange information between GAMS and the various solvers. Just before a GAMS run is complete, these files are usually deleted. Input files can be processed in parts through the use of these intermediate files. This is an extremely powerful feature that can reduce the time needed when several runs of the same model are being made with different data. It may be clearer if the process is described in a different way. Imagine taking a large GAMS program and running it, producing one output file. Then think of splitting the program into two pieces. The first piece is run and the resulting work files are saved along with the resulting listing file. Then the second piece is run after reading in the data from the work files saved previously. A new listing file is generated for the second piece. The content of the output that results is the same, though slightly rearranged, as the case when the large file was run. Splitting the files allows one to interrupt a GAMS task and restart it later without loss of information. Further, changes could be made, or errors corrected, to the later parts. E.2 THE SAVE AND RESTART FEATURES Using the save and restart command line parameters provides a mechanism to break up the compilation of a large input file into many components and stages. Some of the reasons for using these features and running a model in pieces are explained in Section E.3. The next two subsections explain the save and restart mechanisms in GAMS. The save and restart command line parameters, described in Appendix B, are used for this purpose. [TRNSPORT] is used for the purposes of illustration. Consider the following file, containing code extracted from [TRNSPORT] called file1.gms, Sets i "canning plants" / j "markets" / Parameters a(i) "capacity of plant / seattle 350 san-diego 600 b(j) / seattle, san-diego / new-york, chicago, topeka / ; i in cases" / "demand at market j in cases" new-york 325 chicago 300 topeka 275 / ;