How to change the CPLEX options in a Loop?

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

How to change the CPLEX options in a Loop?

Post by Archiver »


Dear all

I need to change the CPLEX options during an iterative procedure. However, it resulted in ‘error’ message.

Would you please guide me?

Thanks in advance;

Hossein

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: How to change the CPLEX options in a Loop?

Post by Archiver »


You can write the Cplex option file 'on the fly'.

set i /i1,i2/;
file fcpx / 'cplex.opt' /;
loop(i,
putclose$sameas('i1',i) fcpx '* first cplex option file'
/ 'advind 0'
/ 'scaind 1';
putclose$sameas('i1',i) fcpx '* second cplex option file'
/ 'advind 1'
/ 'scaind 1';
);

Hope this helps,
Michael Bussieck - GAMSWorld Coordinator
On Thursday, November 20, 2014 3:02:49 PM UTC-5, Hossein wrote:

Dear all

I need to change the CPLEX options during an iterative procedure. However, it resulted in ‘error’ message.

Would you please guide me?

Thanks in advance;

Hossein

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: How to change the CPLEX options in a Loop?

Post by Archiver »


Dear Michael

Many thanks for your useful comment. I have some questions which have been posted in group forum.

I rewrite the posts here. Would you please read these questions?



A)

I want to dedicate the maximum possible threads and memory of my computer, but I do not how, to the GAMS solver (CPLEX). My model is a linear model which only includes continuous variables. I run my code in Grid computing environment. I set the model option as follows:

modelname.threads=0;

It means the model can use all available cores. However I have some questions.

How can I sure that the solver (CPLEX) uses the maximum available threads and RAM to speed up solution process? How can I monitor it? I monitored its process via task manager in windows but most of the time CPU and memory usage was below the %40 and %30 respectively. My laptop is core i7 with 8 GB RAM.



What is the relationship between this option (modelname.threads) and grid computing environment? ‘McCarl Expanded GAMS User’explains “Note that this does not alter the cores used in Grid computing.” about modelname.threads option.



B)



I have a LP model which is solved by iterative procedure (clearly, Benders decomposition approach).

The solution algorithm converges in 24 iterations. However, when I tried to speed up the algorithm by increasing the number of used threads in master problem, algorithm converged in 30 iterations.

The only different command in two scripts is the following option which sets the number of used threads in the current model:

mymodel.threads=0;

(This option had been set to zero in the subproblem model without any inconsistencies)

Would you explain its reason?

I truly appreciate your time and effort.



Thanks in advance;

Regards;

Hossein

On Tue, Nov 25, 2014 at 11:32 AM, Michael Bussieck wrote:

You can write the Cplex option file 'on the fly'.

set i /i1,i2/;
file fcpx / 'cplex.opt' /;
loop(i,
putclose$sameas('i1',i) fcpx '* first cplex option file'
/ 'advind 0'
/ 'scaind 1';
putclose$sameas('i1',i) fcpx '* second cplex option file'
/ 'advind 1'
/ 'scaind 1';
);

Hope this helps,
Michael Bussieck - GAMSWorld Coordinator
On Thursday, November 20, 2014 3:02:49 PM UTC-5, Hossein wrote:

Dear all

I need to change the CPLEX options during an iterative procedure. However, it resulted in ‘error’ message.

Would you please guide me?

Thanks in advance;

Hossein

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.


--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
m-pakdaman
User
User
Posts: 3
Joined: 5 years ago

Re: How to change the CPLEX options in a Loop?

Post by m-pakdaman »

Dear Friends.

I solve a DEA via LP in Gams and using a loop. But, I see errors:

LP status(5): optimal with unscaled infeasibilities
Cplex Time: 0.06sec (det. 1.07 ticks)
Optimal solution found, but with infeasibilities after unscaling

I want to set scaling "off". How can I set scaling off in GAMS? How is the syntax?

Bests
Post Reply