User Tools

Site Tools


solver:the_solver_option_file

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
solver:the_solver_option_file [2017/09/02 19:31]
support
— (current)
Line 1: Line 1:
-====== The Solver Option File ====== 
  
-If you’ve not used an option file before, create a new file of that name and save it in the same directory as your GAMS source file.  
-If you want the options to appear in your GAMS source code, you can use the following code fragment as an example (with an option file for baron as example): 
-<​code>​ 
-Model process /all/ ; 
-Option MINLP = BARON; 
-$onecho > baron.opt 
-lpsol 2 
-nlpsol 2 
-$offecho 
-process.OptFile = 1; 
-Solve process maximizing pr using minlp ;  
-</​code>​ 
-The option file that is being used is ''​solvername.opt'',​ where ''​solvername''​ is the name of the solver that is 
-specified (i.e. ''​baron.opt'',​ ''​cplex.opt'',​ ''​minos.opt''​). ​ 
- 
-Do not forget to "​tell"​ the solver to read the options file by adding a line ''​m.OptFile = 1;''​ to you GAMS model  right before your ''​Solve''​ statement (m is the name of your model). You can also add ''​OptFile 1''​ to the [[gams:​enter_command-line_parameter_into_the_gams_ide|parameter field of the GAMS IDE]] or at the command line.  
- 
-The log will indicate whether an option file was used: 
-<​code>​ 
-... 
---- Executing BARON 
-... 
---- Using Option File 
-Reading parameter(s) from "​D:​\temp\baron.opt"​ 
->> ​ lpsol 2 
->> ​ nlpsol 2 
-... 
-</​code>​ 
- 
-To allow different option file names for the same solver, the modelname.OPTFILE parameter can take other values as well. Formally, the rule is M.OPTFILE = n will use solvename.opt if n=1, and solvername.opX,​ solvername.oXX or solvername.XXX,​ where x's are the characters representing the value of n for n > 1 and will use no option file at all for n = 0. This scheme implies an upper bound on n of 999. For example, ​ 
-  * for ''​M.OPTFILE = 2'' ​  the option file is ''​minos.op2'' ​ 
-  * for ''​M.OPTFILE = 26'' ​ the option file is ''​minos.o26'' ​ 
-  * for ''​M.OPTFILE = 345''​ the option file is ''​minos.345''​ 
- 
-You’ll find the complete documentation about the solver option file at https://​www.gams.com/​latest/​docs/​UG_SolverUsage.html#​BASIC_USAGE_SOLVER_OPTION_FILE 
- 
-Note: Starting with Distribution 22.4 the GAMSIDE includes an option editor, which gives you access to all solver options and can generate an option file. To access the option editor within the GAMSIDE goto: Utilities --> Options Editor 
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY solver/the_solver_option_file.1504373463.txt.gz · Last modified: 2017/09/02 19:31 by support