User Tools

Site Tools


gams:call_gams_within_gams

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gams:call_gams_within_gams [2015/09/18 13:57]
Jarungjit Parnjai
gams:call_gams_within_gams [2018/10/03 13:20]
Stefan Vigerske
Line 7: Line 7:
 **Note:** ''​$call '​external program'''​ calls the shell to execute you command and shell commands like redirection (''>''​) or piping (''​|''​) are possible. ''​$call '​=external program'​ ''​ calls a single executable without using the shell. In most cases you can use just ''​$call '​external program''',​ but is a slight overhead with the shell call. **Note:** ''​$call '​external program'''​ calls the shell to execute you command and shell commands like redirection (''>''​) or piping (''​|''​) are possible. ''​$call '​=external program'​ ''​ calls a single executable without using the shell. In most cases you can use just ''​$call '​external program''',​ but is a slight overhead with the shell call.
  
-The Bruce McCarl User Guide features some nice information about this, please search for: "​Executing an external program" ​ and "​Executing an external program"​. If you are using the Windows version, you will find the Mc Carl User Guide at: Help -> Expanded GAMS Guide (Mc Carl) or [[http://​www.gams.com/​help/​topic/​gams.doc/​userguides/​mccarl/​index.html|here]].+The Bruce McCarl User Guide features some nice information about this, please search for: "​Executing an external program" ​ and "​Executing an external program"​. If you are using the Windows version, you will find the Mc Carl User Guide at: Help -> Expanded GAMS Guide (Mc Carl).
 Please also have a look at this entry: "​[[interfaces:​user_defined_functions_or_subroutines|User defined Functions or Subroutines]]"​. Please also have a look at this entry: "​[[interfaces:​user_defined_functions_or_subroutines|User defined Functions or Subroutines]]"​.
  
 Within the optimization (while the solver is running) you can: Within the optimization (while the solver is running) you can:
-  * either use external functions, see: [[http://​www.gams.com/​help/topic/gams.doc/​userguides/​userguide/​_u_g__external_equations.html|external equations]] +  * either use external functions, see: [[https://​www.gams.com/​latest/docs/UG_ExternalEquations.html|external equations]] 
-  * or use the "[[http://​www.gams.com/​help/​topic/​gams.doc/​solvers/advanced/index.html?cp=0_3_1#​ADVANCED_USAGE_BCHFacility|The GAMS Branch-and-Cut-and-Heuristic Facility]]"​ for user supplied routines. Both methods are only available for certain solvers. ​+  * or use the "[[https://​www.gams.com/​latest/docs/UG_SolverUsage.html#​ADVANCED_USAGE_BCHFacility|The GAMS Branch-and-Cut-and-Heuristic Facility]]"​ for user supplied routines. Both methods are only available for certain solvers. ​
  
  
- +If using the GAMS IDE, then the log of a model if called by ''​$call =gams your_model.gms''​ or ''​execute "gams trnsport.gms";''​ will not be shown in the process window of the GAMS IDE and will not be accessible ​after the model run. To make the log also appear in the GAMS IDE process window, add the following lines to your model:
-Please note the log of a model if called by ''​$call =gams your_model.gms''​ or ''​execute "gams trnsport.gms";''​ will be invisible ​and lost after the model run. To avoid thisjust add the following lines to you model to echo the log file into the process window or the console (if GAMS is executed via the command line).+
 <​code>​ <​code>​
 $setglobal ide "​ide=%gams.ide% lo=%gams.lo% errorlog=%gams.errorlog% errmsg=1"​ $setglobal ide "​ide=%gams.ide% lo=%gams.lo% errorlog=%gams.errorlog% errmsg=1"​
Line 28: Line 27:
 abort$errorlevel '​your_model failed';​ abort$errorlevel '​your_model failed';​
 </​code>​ </​code>​
 +
 +
 +Note, that also other options that have been set for the main GAMS run are not automatically passed on. For example, if you use an alternative license file, then you may want to add ''​license=%gams.license%''​ to the GAMS call.
  
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY gams/call_gams_within_gams.txt · Last modified: 2018/10/03 13:20 by Stefan Vigerske