Solved

Terminated by The Solver


Badge +1

Hi,

I am solving a huge MIP (4446310 integer variables). I set the relative gap to 0% from CPLEX MIP settings. After 69532.16 sec (19.3 hours), the model stops running and the solver status says 'Terminated by solver' while the gap is 0.14%. Why does this happen? What are the possible causes? Thank you.

 

Best regards,

Wanie Saidi

 

icon

Best answer by Marcel Hunting 26 April 2024, 11:09

View original

12 replies

Userlevel 5
Badge +4

HI @Wanie Saidi. Probably CPLEX ran out of memory. I strongly recommend to print the CPLEX status file by setting the following options:

  • Solvers General option 'Solver listing messages' to 'All'
  • CPLEX option 'MIP display' to 'Nth node + info on node cuts'
  • CPLEX option 'Parameter display' to 'Yes'

The CPLEX status file will be printed in the log folder. It contains useful information about the solving process. See also this topic.

Badge +1

Thank you @Marcel Hunting for the recommendations. I’d like to understand if this issue is solely due to CPLEX running out of memory, or if there might be other factors contributing to the problem. Could you provide further insights into possible alternative causes that could lead to the issues?

Best regards,
Wanie Saidi

Userlevel 5
Badge +4

Hi @Wanie Saidi. The only realistic possible cause that I see is lack of memory (or lack of disk space, if the node file is written on disk). The CPLEX status file should tell you more.

Badge +1

Where is the option to open the log folder in AIMMS?

Userlevel 5
Badge +4

Hi @Wanie Saidi. You can open the log folder using the File Explorer. It is a sub-folder inside the folder with the AIMMS project. The CPLEX status file can be opened with a text editor like Notepad.

Note that you can open the CPLEX status file inside AIMMS by selecting File - Open - Text File, select All Files instead of Text Files (bottom-right), browse to the log folder, and select, e.g., 'CPLEX 22.1.sta'.

Badge +1

Is it this folder?

 

Userlevel 5
Badge +4

That is the correct folder. Please note that the CPLEX status file will be emptied if you re-open the AIMMS project, so you might want to copy it after the solve.

Badge +1

This is the CPLEX status file that I got after the model stopped running. Solver status shows ‘Terminated by Solver’ with the gap 0.15%. It seems that it is because there is not enough memory from the CPLEX status file. Can you give a detailed explanation about the other information in this status file?

 

Badge +1

 

Userlevel 5
Badge +4

The CPLEX status file indeed shows that CPLEX ran out of memory.

The status file shows the type of cutting planes (cuts) that were added while solving the model. The warning about MIP starts not constructed seems incorrect because MIP starts are used (if enabled) at the beginning of the solve when CPLEX should still have sufficient memory.

You did not show the beginning of the CPLEX status file while it contains very useful information about the CPLEX presolver, e.g., the model size after presolving the model.

There are some ways to reduce the memory usage by CPLEX:

  1. Enabling the AIMMS Presolver, by switching on the Solvers General option ‘Linear presolve’, sometimes helps to (drastically) reduce the memory usage by CPLEX. For this you need AIMMS 4.89 or newer. Preferably AIMMS 4.96 or newer because there have been some improvements for the AIMMS Presolver between AIMMS 4.89 and 4.96.
  2. Set the CPLEX option ‘Node file’ to 'On disk and compressed'. However, your hard disk should then have sufficient free space; at least 70 Gb but more preferably.
  3. Reduce the number of threads used by CPLEX by setting the CPLEX option ‘Global thread limit’ to 16. However, this likely will increase the solving time.
  4. Make the model formulation more tight such that CPLEX needs less nodes to solve the model. But this is not easy. See the paper Practical guidelines for solving difficult mixed integer linear programs by Ed Klotz and Alexandra M.Newman (2013) for more information.

Enabling the AIMMS Presolver would only be useful if the CPLEX status file shows that the CPLEX presolver drastically reduced the model size.

Badge +1

I see. Then I have a few questions to ask,

(1) For now I am using AIMMS 4.91. How do I upgrade the AIMMS version to 4.96?

(2) Can you explain about 'threads'? What is the meaning of threads 28 for these iterations? For the thread setting, is it CPLEX 22.1 - Parallel - Global thread limit? What if I set the 16 (as your suggestion) or 0 for the global thread limit?

(3) What is meant by the 0.08% gap for this solution? Have I reached 99.2% optimality, or something else? If I want to limit the solution to 5%, what value should be entered into the MIP Relative Optimality Tolerance?

(4) As shown in this progress window, the solver status is 'Terminated by Solver' and I can't get a result for this solution (since I am looking for a solution to the university exam scheduling problem, the result I should get is in the form of an exam schedule). Is there any way for me to get the entire result from this solver even up to the solution that has been carried out by AIMMS before it was terminated?

 

Userlevel 5
Badge +4

​​​​​​(1) You can download older AIMMS versions from here. After installing AIMMS 4.96 (or newer) you can just open the project with AIMMS 4.96.

(2) CPLEX uses threads to solve the problem in parallel on multiple cores. In general using more threads results in a better performance but with a higher memory consumption. The CPLEX option 'Global thread limit’ controls the amount of threads used by CPLEX. The value 0 means that the number of threads used is set equal to the number of (logical) cores in the computer.

(3) A gap of 0.08% means that the objective value found is within 0.08% of the optimal objective value. (So, in theory, CPLEX could find an objective value that is 0.08% better if it would have been able to solve the model to optimality.) If you want to limit the solution to 5% then you should set the 'MIP Relative Optimality Tolerance' to 0.05.

(4) You should install an incumbent callback which is called whenever CPLEX finds a new integer feasible solution, which can be stored in AIMMS. After the solve, the last of these solutions can be restored. See the attached example.

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator