"reading solution for model" - What happens here?

Solver related questions
Post Reply
fribra
User
User
Posts: 2
Joined: 3 months ago

"reading solution for model" - What happens here?

Post by fribra » 3 months ago

Hello everyone,

I have a question regarding the solving process of GAMS. I have an MILP-Model and I am using the CPLEX-Solver. I run a Loop in GAMS to solve for different model variations. The model runs and produces optimal results but the run-time is very long.

In the log-file I can see the following:

Fixed MIP status(1): optimal
Cplex Time: 7.47sec (det. 2575.80 ticks)

Proven optimal solution.

MIP Solution: -370160.220173 (3161 iterations, 0 nodes)
Final Solve: -370160.220173 (4350 iterations)

Best possible: -370160.220173
Absolute gap: 0.000000
Relative gap: 0.000000

--- Restarting execution
--- SpeicherOptMFH.gms(842) 555 Mb
--- Reading solution for model Modell_SBSopt
--- SpeicherOptMFH.gms(764) 762 Mb 2220 secs


You can see, Cplex finds the optimal solution after around 7 sec. But, "reading solution" takes around 40 minutes...

I wanna know, what happens at "reading solutions" and is there a way to shorten the computation time. Additionally for my results, I don't need to know all the variables, just a small selection.

Maybe there is someone who could help me?

Thank you very much.
Cheers,
Fritz

User avatar
bussieck
Moderator
Moderator
Posts: 235
Joined: 2 years ago

Re: "reading solution for model" - What happens here?

Post by bussieck » 3 months ago

It's probably not the reading that takes that long, but probably some of your calculations you do after the solve. It is easy to build expensive statements in GAMS. The GAMS profile option (https://www.gams.com/latest/docs/UG_Gam ... SAOprofile) helps you to figure out which lines really takes long. If you run this in a loop (one nesting level, then use "option profile=2;" before the loop. This will enable profiling of statements inside the loop (otherwise (profile=1) you just get the timing information aggregated for all the statements in the loop). You get the profile summary in the log and the timing of the individual statements in the listing file.

-Michael

fribra
User
User
Posts: 2
Joined: 3 months ago

Re: "reading solution for model" - What happens here?

Post by fribra » 2 months ago

Thanks a lot.

That was the right call.

There was a loop that read the gdx file, which took forever.

Thank you very much.

Cheers
Fritz

Post Reply