gams/cplex option file

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 2 years ago

gams/cplex option file

Post by Archiver » 6 years ago


Hi,
I want to create an option file in cplex solver.How can I that?



Archiver
User
User
Posts: 7876
Joined: 2 years ago

Re: gams/cplex option file

Post by Archiver » 6 years ago


*To let GAMS know there is a user-defined option file - BEFORE THE *SOLVE STATEMENT
YourModelName.optfile=1;

*Your options ------ example
$onecho > cplex.opt
threads 4
nodefileind 2
workmem 2048
nodesel 2
varsel 3
$offecho

HTH.

Destin


On Mon, Jun 4, 2012 at 9:29 AM, esra wrote:

Hi,
I want to create an option file in cplex solver.How can I that?

--
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


--
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Archiver
User
User
Posts: 7876
Joined: 2 years ago

Re: gams/cplex option file

Post by Archiver » 6 years ago


Hi Destin,
My gams file

model pipe /all/;
Options optcr=1e-4,reslim = 20000,iterlim = 1e9;
Option mip=cplex;
pipe.optfile=1;
SOLVE pipe minimizing PA using mip;
Display PA.l;
File output /pipe_cplex.txt/;

After I run gams, give below error

User supplied options:
startalg 1
mipsearch 1
>> >> No such option.
*solvefinal 0
fixoptfile fix.opt
>> >> No such option.


On 4 Haziran, 11:04, Destin Zed wrote:
> > *To let GAMS know there is a user-defined option file - BEFORE THE *SOLVE
> > STATEMENT
> > YourModelName.optfile=1;
> >
> > *Your options ------ example
> > $onecho > cplex.opt
> > threads 4
> > nodefileind 2
> > workmem 2048
> > nodesel 2
> > varsel 3
> > $offecho
> >
> > HTH.
> >
> > Destin
> >
> >
> >
> > On Mon, Jun 4, 2012 at 9:29 AM, esra wrote:
>> > > Hi,
>> > > I want to create an option file in cplex solver.How can I that?
> >
>> > > --
>> > > "gamsworld" group.
>> > > To post to this group, send email to gamsworld@googlegroups.com.
>> > > To unsubscribe from this group, send email to
>> > > gamsworld+unsubscribe@googlegroups.com.
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/gamsworld?hl=en.- Alıntıyı gizle -
> >
> > - Alıntıyı göster -



Archiver
User
User
Posts: 7876
Joined: 2 years ago

Re: gams/cplex option file

Post by Archiver » 6 years ago


Esra,

Your piece of GAMS code doesn't show where/how you introduced the CPLEX options. Anyway, the following should work for you.

model pipe /all/;
Options optcr=1e-4,reslim = 20000,iterlim = 1e9;
Option mip=cplex;
pipe.optfile=1;
SOLVE pipe minimizing PA using mip;

$onecho > cplex.opt
startalg 1
mipsearch 1
$offecho

Display PA.l;
File output /pipe_cplex.txt/;

HTH.
Destin.


On Mon, Jun 4, 2012 at 11:04 AM, esra wrote:

Hi Destin,
My gams file

model pipe /all/;
Options optcr=1e-4,reslim = 20000,iterlim = 1e9;
Option mip=cplex;
pipe.optfile=1;
SOLVE pipe minimizing PA using mip;
Display PA.l;
File output /pipe_cplex.txt/;

After I run gams, give below error

User supplied options:
startalg 1
mipsearch 1
>> No such option.
*solvefinal 0
fixoptfile fix.opt
>> No such option.


On 4 Haziran, 11:04, Destin Zed wrote:
> *To let GAMS know there is a user-defined option file - BEFORE THE *SOLVE
> STATEMENT
> YourModelName.optfile=1;
>
> *Your options ------ example
> $onecho > cplex.opt
> threads 4
> nodefileind 2
> workmem 2048
> nodesel 2
> varsel 3
> $offecho
>
> HTH.
>
> Destin
>
>
>
> On Mon, Jun 4, 2012 at 9:29 AM, esra wrote:
> > Hi,
> > I want to create an option file in cplex solver.How can I that?
>
> > --
> > "gamsworld" group.
> > To post to this group, send email to gamsworld@googlegroups.com.
> > To unsubscribe from this group, send email to
> > gamsworld+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/gamsworld?hl=en.- Alıntıyı gizle -
>
> - Alıntıyı göster -

--
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


--
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Archiver
User
User
Posts: 7876
Joined: 2 years ago

Re: gams/cplex option file

Post by Archiver » 6 years ago


Hi Destin
Thanks your answer I am new user so I don't know how/where I
introduced the cplex opt.file
Programme give below error

Unable to open options file: C:\GAMS\GAMSPDF\CPLEX.OPT.
Unable to process options file.
Presolve found the problem infeasible or unbounded.

On 5 Haziran, 14:07, Destin Zed wrote:
> > Esra,
> >
> > Your piece of GAMS code doesn't show where/how you introduced the CPLEX
> > options. Anyway, the following should work for you.
> >
> > model pipe /all/;
> > Options optcr=1e-4,reslim = 20000,iterlim = 1e9;
> > Option mip=cplex;
> > pipe.optfile=1;
> > SOLVE pipe minimizing PA using mip;
> >
> > $onecho > cplex.opt
> > startalg 1
> > mipsearch 1
> > $offecho
> >
> > Display PA.l;
> > File output /pipe_cplex.txt/;
> >
> > HTH.
> > Destin.
> >
> >
> >
> > On Mon, Jun 4, 2012 at 11:04 AM, esra wrote:
>> > > Hi Destin,
>> > > My gams file
> >
>> > > model pipe /all/;
>> > > Options optcr=1e-4,reslim = 20000,iterlim = 1e9;
>> > > Option mip=cplex;
>> > > pipe.optfile=1;
>> > > SOLVE pipe minimizing PA using mip;
>> > > Display PA.l;
>> > > File output /pipe_cplex.txt/;
> >
>> > > After I run gams, give below error
> >
>> > > User supplied options:
>> > > startalg 1
>> > > mipsearch 1
>>>> > > >> No such option.
>> > > *solvefinal 0
>> > > fixoptfile fix.opt
>>>> > > >> No such option.
> >
>> > > On 4 Haziran, 11:04, Destin Zed wrote:
>>> > > > *To let GAMS know there is a user-defined option file - BEFORE THE *SOLVE
>>> > > > STATEMENT
>>> > > > YourModelName.optfile=1;
> >
>>> > > > *Your options ------ example
>>> > > > $onecho > cplex.opt
>>> > > > threads 4
>>> > > > nodefileind 2
>>> > > > workmem 2048
>>> > > > nodesel 2
>>> > > > varsel 3
>>> > > > $offecho
> >
>>> > > > HTH.
> >
>>> > > > Destin
> >
>>> > > > On Mon, Jun 4, 2012 at 9:29 AM, esra wrote:
>>>> > > > > Hi,
>>>> > > > > I want to create an option file in cplex solver.How can I that?
> >
>>>> > > > > --
>>>> > > > > You received this message because you are subscribed to the Google
>> > > Groups
>>>> > > > > "gamsworld" group.
>>>> > > > > To post to this group, send email to gamsworld@googlegroups.com.
>>>> > > > > To unsubscribe from this group, send email to
>>>> > > > > gamsworld+unsubscribe@googlegroups.com.
>>>> > > > > For more options, visit this group at
>>>> > > > >http://groups.google.com/group/gamsworl ... lıntıyı gizle -
> >
>>> > > > - Alıntıyı göster -
> >
>> > > --
>> > > "gamsworld" group.
>> > > To post to this group, send email to gamsworld@googlegroups.com.
>> > > To unsubscribe from this group, send email to
>> > > gamsworld+unsubscribe@googlegroups.com.
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/gamsworld?hl=en.- Alıntıyı gizle -
> >
> > - Alıntıyı göster -



vahdi
User
User
Posts: 1
Joined: 1 year ago

Re: gams/cplex option file

Post by vahdi » 1 year ago

Hello,

I have some problems about to form a "cplex.opt" and get the errors below and
I googled but I can not solve the problem. In addition I cannot chande the
default with option THREADS. Please, could you help me to solve the problem?

In addition, I added our gams code below. I am newly user for gams. So I don't
know the gams code fully.

"Error Cannot open parameter file "C:\Users\VAHDİY-NTB\Documents\gamsdir
\projdir\cplex.opt"
*** Error Error code = 2; No such file or directory
Cplex MIP uses 1 of 4 parallel threads. Change default with option THREADS."

MODEL model2 /all/;
model2.optfile=1;
$onecho > model2.opt
threads=0;
$offecho;
Option MIP = cplex;
Option reslim = 86400;
Solve model2 using MIP minimizing P;

Vahdi.

User avatar
bussieck
Moderator
Moderator
Posts: 209
Joined: 2 years ago

Re: gams/cplex option file

Post by bussieck » 1 year ago

Hi, just drop the ';' from the lines in the cplex.opt:

$onecho > model2.opt
threads=0
$offecho

The ';' is important to separate GAMS language statements (see https://www.gams.com/latest/docs/UG_GAMSPrograms.html) The $xxx are dollar control options (https://www.gams.com/latest/docs/UG_Dol ... tions.html) and not really part of the GAMS language. They are "compiler directives" and should not be terminated with ';'.

Hope this helps,
-Michael

User avatar
bussieck
Moderator
Moderator
Posts: 209
Joined: 2 years ago

Re: gams/cplex option file

Post by bussieck » 1 year ago

Uhhh, and I forgot the obvious, create a 'cplex.opt' not a model2.opt as clearly instructed in https://www.gams.com/latest/docs/UG_Sol ... PTION_FILE:

$onecho > cplex.opt
threads=0
$offecho

-Michael

Post Reply