Parallelizing with GAMS/Lindo

Problems with syntax of GAMS
Post Reply
ggood
User
User
Posts: 6
Joined: 1 year ago

Parallelizing with GAMS/Lindo

Post by ggood »

Hi,

I'm using Lindo to find a global solution to a large MINLP flow network optimization problem. I'm attempting to reduce my solve time by parallelizing Lindo. I tried setting threads to n=-2 using the GAMS command line parameter 'threads' based on https://www.gams.com/mccarlGuide/threads.htm

Code: Select all

option threads = -2 ;
but didn't have any effect on my solve time.

GAMS Lindo Documentation https://www.gams.com/latest/docs/S_LIND ... UM_THREADS indicates that Lindo supports thread-based parallelization through the Option File (text file named lindo.opt) using the NUM_THREADS option, but does not provide an explicit example. Based on the GAMS Lindo Option File documentation https://www.gams.com/latest/docs/S_LIND ... DO_OPTIONS I expect the call line in the option file would look something like this:

Code: Select all

NUM_THREADS 50
for 50 threads. My questions are (1) is this the correct syntax to activate parallel processing in GAMS/Lindo and (2) is there a way to set reserved cores in Lindo similar to 'option threads = -#' in the GAMS options? Thanks!
Fred
Posts: 373
Joined: 7 years ago

Re: Parallelizing with GAMS/Lindo

Post by Fred »

Hi,

Your syntax is correct. It does not matter whether you set the threads parameter through an option statement in GAMS, as a command line parameter or through NUM_THREADS in a lindo option file (read abooy sover option files here).

You can see that multiple threads have been used in the lindo log through statistics as the following.

Code: Select all

GOP thread workload: 0.15 secs
    0   1   2   3   4   5   6   7   8   9 
0:|13%|22%|23%|23%|9%|9%|0%|0%|0%|0%|
1:|0%|0%|0%|0%|
Even though solvers may be able to utilize multiple threads in general, there is no guarantee that this always improves performance. Not all parts of of the solution process can be parallelized efficiently.

If you need further assistance, I suggest that you share your log file and code here, to give other forum users the chance to experiment with your model to eventually come up with suggestions how to improve performance.

I hope this helps!

Fred
ggood
User
User
Posts: 6
Joined: 1 year ago

Re: Parallelizing with GAMS/Lindo

Post by ggood »

Hi Fred,

Thank you for replying and confirming that my syntax is correct. I will keep experimenting with the code, and if I need further assistance I will post code and log files. Cheers!

Greg
Post Reply