Page 1 of 1

Error Using ParallelMode

Posted: Sun Jun 07, 2020 8:01 pm
by nabilkenan
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

Re: Error Using ParallelMode

Posted: Mon Jun 08, 2020 7:33 am
by Renger
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

Re: Error Using ParallelMode

Posted: Mon Jun 15, 2020 4:43 pm
by nabilkenan
Thank you very much Renger! That worked perfectly!
Renger wrote: 3 years 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