Using maximum possible CPU number and RAM for the GAMS solver

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

Using maximum possible CPU number and RAM for the GAMS solver

Post by Archiver »


Dear all

I want to dedicate the maximum possible threads of my computer to the GAMS solver. My model is a linear model which only includes continuous variables. I run my code in Grid computing environment. I set model option as follows:

modelname.threads=0;

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

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.

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 usage was below the %50. My laptop is core i3.

Thanks in advance;

Regards;

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: Using maximum possible CPU number and RAM for the GAMS solver

Post by Archiver »


Hi Hossein,

I am currently facing the same problem as you had. As no one had replied it, I am wondering did you find the solution?

Thank you very much!

Xuan

在 2014年11月16日星期日 UTC-5上午8:53:33,Hossein写道:

Dear all

I want to dedicate the maximum possible threads of my computer to the GAMS solver. My model is a linear model which only includes continuous variables. I run my code in Grid computing environment. I set model option as follows:

modelname.threads=0;

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

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.

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 usage was below the %50. My laptop is core i3.

Thanks in advance;

Regards;

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 https://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: Using maximum possible CPU number and RAM for the GAMS solver

Post by Archiver »


Hi,

When you need to solve a *single* LP it's not clear how to make use of the multi-core architecture available in modern CPUs. Here are a few comments:

- You could use the Barrier algorithm. Some part of the algorithm (solving systems of equations) can be executed in parallel.

- The Xpress solver can run their simplex algorithm utilizing a multi-core architecture. This is relatively new (http://arxiv.org/abs/1503.01889, http://www.fico.com/en/blogs/analytics- ... the-world/)

- Some solvers offer concurrent LP solvers, i.e. they run the same LP with different algorithms (primal and dual simplex, barrier) in different threads and stop as soon as the first one returns with a solution. This sounds very good, but this has a couple of disadvantages: a) your memory requirement increases with the parallel solves, b) even if you have enough memory, you create congestion of the bus between the memory and the cpus. So concurrent often runs slower compared to the running the fastest method all by itself.

When you need to solve *many* LPs your can execute the solve asynchronously in GAMS (https://www.gams.com/help/topic/gams.do ... uting.html) and this way can utilize the parallel power of your set up. When you work with a large network of computers the GAMS Grid Facility is best, if you "just" want to harness the multi-cores on your PC the AsyncThreads option is the best because the communication is done in memory and we execute the solve in threads instead of processes. For this to work you need to alter your GAMS program in a submission and collection part as done in the trnsgrid example (https://www.gams.com/modlib/libhtml/trnsgrid.htm). You can also combine the submission and collection loop and control this way how many active "solves" you want at any given time. This is done in the example model tgridmix (https://www.gams.com/modlib/libhtml/tgridmix.htm). In a recent talk my colleague collected the following numbers to demonstrate the effect of solving 1000 small LPs (https://www.gams.com/modlib/libhtml/trnsport.htm) with different "solvelink" setting: in sequence (0, %Solvelink.Call Module%,%Solvelink.Load Library%), using the async grid (%Solvelink.Async Grid%), and the async threads (%Solvelink.Async Thread%):



The model for this is attached.

Hope this helps,
Michael Bussieck - GAMSWorld Coordinator

On Monday, March 7, 2016 at 1:54:58 AM UTC-5, zhang xuan wrote:

Hi Hossein,

I am currently facing the same problem as you had. As no one had replied it, I am wondering did you find the solution?

Thank you very much!

Xuan

在 2014年11月16日星期日 UTC-5上午8:53:33,Hossein写道:

Dear all

I want to dedicate the maximum possible threads of my computer to the GAMS solver. My model is a linear model which only includes continuous variables. I run my code in Grid computing environment. I set model option as follows:

modelname.threads=0;

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

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.

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 usage was below the %50. My laptop is core i3.

Thanks in advance;

Regards;

Hossein

--
Attachments

[The extension has been deactivated and can no longer be displayed.]

tSLAll.gms
(4.03 KiB) Downloaded 431 times
Post Reply