Hi Experts,
I have one question regarding the syntax that could output the GAMS/CPLEX model creation time. I have a huge but relatively simple model (0.7 million constrs/vars) in which the CPLEX solver time was only 4 seconds, while the actual elapsed time was above 10 minutes.
I'm not sure if there is a good way or coding standard that makes GAMS create the model faster, but I'm wondering at least if there is any syntax that could accurately capture the model creation time in GAMS/CPLEX API.
Thanks in advance!
Best,
Gabriel
GAMS/CPLEX Model Creation Time
-
- User
- Posts: 72
- Joined: 6 years ago
- Location: Dallas, TX, USA
- Contact:
-
- User
- Posts: 18
- Joined: 4 years ago
- Location: Fairfax, VA
Re: GAMS/CPLEX Model Creation Time
Hi Gabriel,
If you are in a situation where the solve is quick, but everything else is slower... a good place to start is to turn on profile:
You might also want to turn off some of the printing to the LST:
You will see some output in the LST file that will be helpful to determine with statements are taking time.
There are other good ideas here: https://www.gams.com/45/docs/UG_ExecErr ... ionProfile
You can always post your code and the community might be able to suggest some fixes.
best,
adam
If you are in a situation where the solve is quick, but everything else is slower... a good place to start is to turn on profile:
Code: Select all
option profile = 1;
Code: Select all
option limrow = 0;
option limcol = 0;
option solprint = off;
There are other good ideas here: https://www.gams.com/45/docs/UG_ExecErr ... ionProfile
You can always post your code and the community might be able to suggest some fixes.
best,
adam
-
- User
- Posts: 72
- Joined: 6 years ago
- Location: Dallas, TX, USA
- Contact:
Re: GAMS/CPLEX Model Creation Time
Thanks a lot Adam!! That is a great information. According to the profile, I noticed that GAMS spent around 20 seconds building the equations, which is OK. However, GAMS took around 300 seconds to read all the inputs and process them. Then, the CPLEX solver only took 4 seconds to solve it. I'm wondering if there is a general rule of thumb in writing efficient input processing code for GAMS. The most input processing we used was to read CSV files and fill in parameter values with several conditions.achristensen wrote: ↑3 months ago Hi Gabriel,
If you are in a situation where the solve is quick, but everything else is slower... a good place to start is to turn on profile:
You might also want to turn off some of the printing to the LST:Code: Select all
option profile = 1;
You will see some output in the LST file that will be helpful to determine with statements are taking time.Code: Select all
option limrow = 0; option limcol = 0; option solprint = off;
There are other good ideas here: https://www.gams.com/45/docs/UG_ExecErr ... ionProfile
You can always post your code and the community might be able to suggest some fixes.
best,
adam
Best,
Gabriel
Re: GAMS/CPLEX Model Creation Time
Hi Gabriel,
Adam already shared a link to some hints on how to formulate a model efficiently. If this did not help, I suggest you share your code and data, such that other forum user can analyze and provide help.
If this cannot be shared publicly (e.g. due to confidentiality), feel free to reach out to supportt@gams.com
Best,
Fred
Adam already shared a link to some hints on how to formulate a model efficiently. If this did not help, I suggest you share your code and data, such that other forum user can analyze and provide help.
If this cannot be shared publicly (e.g. due to confidentiality), feel free to reach out to supportt@gams.com
Best,
Fred