User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
gams:what_is_the_meaning_of_compilation_time_generation_time_and_execution_time [2021/09/28 00:27]
Atharv Bhosekar removed
— (current)
Line 1: Line 1:
-====== What is the meaning of ''​COMPILATION TIME'',​ ''​GENERATION TIME'',​ and ''​EXECUTION TIME''?​ ====== 
-The log and the listing file contain a number of different timing information. These information can be obtained via the Search - Menu of the GAMS IDE (or using the grep utility under UNIX). ​ 
-  * There are some general self-explaining ​ [[http://​​wiki/​Wall_clock_time|wall]] timing information in the log file of a model run (indus89 from the [[http://​​modlib/​modlib.htm|GAMS model library]] using GAMS distribution 22.6): 
-<​code> ​   ​ 
-    --- Job indus89 Start 11/17/07 08:28:00 
-    ... 
-    --- Starting execution: elapsed 0:00:00.125 
-    ... 
-    --- Executing CPLEX: elapsed 0:00:00.688 
-    ... 
-    --- Job indus89.gms Stop 11/17/07 08:28:04 elapsed 0:00:04.344 
-  * More detailed information is available within the lst-file. GAMS uses a two pass process to compile and run a model: 
-    - COMPILATION TIME i.e. ''​COMPILATION TIME     ​= ​       0.094 SECONDS...'':​ The compilation time is the time required to perform the first (compilation) pass, and is often dominated by the time required to read in large model and data files. (By default) GAMS writes an echo print of the source file possibly containing error messages, along with lists of GAMS objects, and cross reference maps to the lst file. 
-    -  EXECUTION TIME i.e. ''​EXECUTION TIME       ​= ​       0.547 SECONDS...'':​ This is the time required for the second (execution) pass. Time consuming factors can be heavy numerical calculations on existing data and the use of "​long"​ loops. Parallel assignments should be used wherever possible. The results of calculations and also execution errors (if any) are written to the lst file or othere external files. 
-    - GENERATION TIME i.e.''​GENERATION TIME      =        0.375 SECONDS...'':​ Time required to process a solve statement. GAMS constructs the problem at this time, and calls the solver. There are two execution times because GAMS resumes execution after the solve to read in the solution and to do any reporting etc. necessary. 
-    - To get the time required to solve the model, you want to look at resource usage by the solver. This appears in the solve summary, just search for ''​S O L V E''​. ​ The model attribute ''​model_name.resusd''​ makes this information available within your model. Note that this time is not included in the GAMS execution time. 
-One can also turn on an additional option on the command line (or in the parameter box in the upper right corner of the IDE): ''​stepsum=1''​. 
-At the end of the listing file you will find a section like this: 
-STEP SUMMARY: ​    ​0.016 ​      0.125 STARTUP 
-                  0.000       0.062 COMPILATION 
-                  0.078       0.235 EXECUTION 
-                  0.000       0.015 CLOSEDOWN 
-                  0.094       0.437 TOTAL SECONDS 
-                  1.360       1.719 ELAPSED SECONDS 
-                  3.738       7.333 MAX HEAP SIZE (Mb) 
-The numbers in the right column are the aggregated times for the GAMS job. The difference between ''​ELAPSED SECONDS''​ and ''​TOTAL SECONDS''​ is the time consumed by the solver. ​ 
-You could also program this inside the GAMS program. Create a scalar and  set it at the begin of the program to ''​jnow''​ (a function that reports the current time as a fraction of today'​s julian date): 
-scalar starttime; starttime = jnow; 
-At the end of the program do something similar: 
-scalar elapsed; elapsed = (jnow - starttime)*24*3600;​ 
-display elapsed; 
-This will display the elapsed time in seconds. 
-All time information reported in a lst-file by GAMS are [[http://​​wiki/​Wall_clock_time|wall time]] and **not** ​ [[http://​​wiki/​CPU_time|cpu time]]. ​