GAMS Log

# Introduction

The GAMS log provides the log of a GAMS run including the GAMS job description, defined command line parameters, license information, solver log, and GAMS compilation and execution output. Looking at the log gives a brief idea about the success of a GAMS run and is usually a useful first step in debugging a GAMS model. The detailed output from GAMS is displayed in the output file. Log output can be obtained in the form of a text file (typically with .log extension) that is generated with each GAMS run based on the command line parameters logOption and logFile. The GAMS log consists of three major sections: header, compilation log, and execution log.

The header of the GAMS log consists of information that is independent of the content of the executed GAMS file. It contains the job description, parameter log, and license log.

## Job Description

In this line, the name of the GAMS file being run along with a timestamp, the GAMS version and operating system information is provided.

--- Job trnsport.gms Start 08/30/21 17:29:15 36.1.0 r2c0a44a WEX-WEI x86 64bit/MS Windows


## Parameter Log

The default parameters for the operating system and configuration are obtained via parameter file (gmsprmNT.txt on Windows, gmsprmun.txt on Linux, gmsprmun.txt on MacOS) and gamsconfig.yaml files. The parameter log explicitly lists all additional parameters in the following lines. For example, input displays the full path of the GAMS input file. In the example log provided below, the output file option PageSize is set to 0. ScrDir is the full path to the scratch directory; SysDir is the full path to the systems directory, logOption is defined that controls the location of the output log.

--- Applying:
C:\GAMS\36\gmsprmNT.txt
C:\Users\jsmith\Documents\GAMS\gamsconfig.yaml
--- GAMS Parameters defined
Input C:\test\trnsport.gms
PageSize 0
ScrDir C:\test\225a\
SysDir C:\GAMS\36\
LogOption 3
ErrMsg 1
ErrorLog 99
IDE 1
LstTitleLeftAligned 1


This section provides information about the license such as licensee, the organization, and the license number is provided on the second line. The full path to the license file that is being read is provided on the third line. The last line in the image shows the GAMS license type being used.

Licensee: John Smith                                     G201001/0001CS-GEN
The ACME Corporation, USA                                  DC0000
C:\Users\jsmith\Documents\GAMS\gamslice.txt


## Processor Information and GAMS version

This section provides information about the processor and GAMS version being used.

Processor information: 1 socket(s), 8 core(s), and 16 thread(s) available


# Compilation Log

A GAMS run consists of two phases: compilation and execution. The following lines provide details about the compilation, memory usage, the time elapsed in compilation. The number in parentheses refers to the line number in the echo print of the input file. In addition to the above-mentioned output, this part of the log also contains information about the output such as as GDX files, the files included using $include, and outputs of commands such as$call as shown in the following lines.

--- Starting compilation
--- $echo File C:\test\includefilename.gms --- clad.gms(30) 2 Mb --- . includefilename.gms(1) 2 Mb --- clad.gms(32) 2 Mb --- call echo "hello!" "hello!" --- clad.gms(45) 3 Mb --- GDXin=C:\test\claddat.gdx --- GDX File ($gdxIn) C:\test\claddat.gdx


# Execution Output

The beginning of the execution phase of the GAMS run is clearly indicated in the GAMS log:

--- Starting execution: elapsed 0:00:00.010


In general, the execution log output indicates the progress of the GAMS job, including line numbers, memory usage, elapsed time for the run, and time required for long-running statements. Several statements also result in specific log output.

Output of GDX files generated using execute_unload is shown in the log as follows.

--- GDX File (execute_unload) path\to\outputfile.gdx


The output for reference files generated is shown in the log as follows.

--- RefFile  path\to\trnsport.ref


Similarly, the information about a file written using the Put writing facility is mentioned in the log as follows.

--- Putfile results  path\to\results.txt


The output of the program flow control features such as abort is shown as follows.

*** Error at line 61: Execution halted: abort\$1 'model not solved as expected'


If there are loops in the program, the log shows information about the current iteration as follows.

--- LOOPS scen = s1


Similar to the output of call command shown during compilation phase, the output for execute command is shown in the execution phase. The following line of GAMS code

execute "echo output of execute command";


will result in the following output in the log.

--- trnsport.gms(67) 4 Mb
output of execute command


For each solve statement, there will also be a solver log embedded in the execution output (see below for details regarding the solver log). After a solver log, the execution output continues. It ends with the status of the GAMS Job (here *** Status: Normal completion), a timestamp and the total run time of the GAMS job.

--- Executing after solve: elapsed 0:00:02.892
--- trnsport.gms(66) 4 Mb
*** Status: Normal completion
--- Job trnsport.gms Stop 08/30/21 17:29:18 elapsed 0:00:02.892


## Solver Log

One of the most important GAMS statements is the solve statement: a solve results in a substantial amount of log output.

The first line in the execution output is about model generation. Model generation can take a long time in which case the log also shows progress and equations that take long to generate.

--- Generating LP model transport
--- trnsport.gms(64) 4 Mb
---   6 rows  7 columns  19 non-zeroes


This is followed by some statistics about the range of values seen in the model:

--- Range statistics (absolute non-zero finite values)
--- RHS       [min, max] : [ 2.750E+02, 6.000E+02] - Zero values observed as well
--- Bound     [min, max] : [        NA,        NA] - Zero values observed as well
--- Matrix    [min, max] : [ 1.260E-01, 1.000E+00]


After model generation, the solver name and solveLink are displayed.

--- Executing CPLEX (Solvelink=2): elapsed 0:00:02.066


The log output following this line is specific to the solver and will usually display the objective function value.

Optimal solution found
Objective:          153.675000

GAMS Development Corp.
GAMS Software GmbH

General Information and Sales
U.S. (+1) 202 342-0180
Europe: (+49) 221 949-9170