Error Using ParallelMode Topic is solved

Problems with syntax of GAMS
Post Reply
nabilkenan
User
User
Posts: 5
Joined: 3 months ago

Error Using ParallelMode

Post by nabilkenan » 3 months ago

Dear All,

I am solving a relatively large MIP using GAMS/CPLEX. To harness the power of the CPUs on my computer while trying to using the opportunistic mode, I inserted the two following lines of code before by solve statement
Option threads = 8;
Option ParallelMode = -1;

But I am getting a syntax error (attached). Also, when just using "Option threads=8;" the performance does not improve. In fact, in some instances it becomes worse. Could you please help in exploiting the CPUs of my computer?

Thank you.
GAMS Error.PNG

User avatar
Renger
Posts: 588
Joined: 4 years ago

Re: Error Using ParallelMode

Post by Renger » 3 months ago

Hi

Gams does not recognize the option parallelmode as it is solver specific and should be put in an option file. For example, you could add this to your code

Code: Select all

$echo parallelmode -1 > cplex.opt
$echo threads = 8 >>cplex.opt
mymodel.optfile=1;
where "mymodel" is your model name.
Try this and see if the problem solves faster.
I hope this helps
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist

nabilkenan
User
User
Posts: 5
Joined: 3 months ago

Re: Error Using ParallelMode

Post by nabilkenan » 3 months ago

Thank you very much Renger! That worked perfectly!
Renger wrote:
3 months ago
Hi

Gams does not recognize the option parallelmode as it is solver specific and should be put in an option file. For example, you could add this to your code

Code: Select all

$echo parallelmode -1 > cplex.opt
$echo threads = 8 >>cplex.opt
mymodel.optfile=1;
where "mymodel" is your model name.
Try this and see if the problem solves faster.
I hope this helps
Cheers
Renger

Post Reply