1

My MIP Model in OPL CPLEX V12.9 is currently working with a small amount of Data, but with a bigger database import from excel, after running for 1 hour I get the following error:

Error 1001: Out of memory.

I already know that I can change some Parameters at the .ops

I have already tried to set the following parameters: CPX_PARAM_WORKMEM = 1920.0 (default 2048.0) CPX_PARAM_NODEFILEIND = 3 (default Node file in memory and compressed)

and afterward I got:

Error 1422: Can not open file %s for writing

So I changed the Parameter: CPX_PARAM_WORKDIR to C:\Users\..\opl

But my main worry is about the memory issue. I am using a surface 4 pro with 4GB RAM and 1867MHz and i5-6300U CPU.

While the Model is running my CPU also goes to 99-100%.

Which parameters can I change to solve the memory problem and what value should I change these parameters to?

Enthus3d
  • 1,727
  • 12
  • 26
Frieda12
  • 37
  • 1
  • 7

1 Answers1

1

It is expected that the CPU goes to almost 100%. Actually, this is what you want. You want CPLEX to use all the power your machine has. The CPU load should be unrelated to memory issues -- unless the operating system is swapping like crazy.

The parameters you set for workmem and nodefileind look correct and given that you got a "failure to write" it seems they are active. So this is the best you can do at the moment. If your model has a lot of constraints you could try setting CPX_PARAM_DPRIIND to 1. That allows for smaller search tree nodes and may save some memory. Another option is to limit parameter CPX_PARAM_TRELIM. This will stop CPLEX as soon as the size of the tree (on disk and in memory) exceeds that limit. Note that this will stop CPLEX no matter what. You will get the best solution CPLEX found until that point, it is not necessarily the optimal solution. If you run out of memory because the tree has a huge number of nodes then you could crank up parameters like node presolve, probing, strong branching, etc. to have CPLEX spend more work for each node so that the number of nodes to process can potentially be reduced.

You could update your question with the engine log, maybe that gives other/new ideas.

Daniel Junglas
  • 5,830
  • 1
  • 5
  • 22
  • So I have to update my post. After changing the parameters above, my model is still running for 24 hours. And I have to go in a next pass through a larger amount of data. My next question is how can I reduce the running time without having a big impact on the quality of the results? I know that I can reduce the computation time with _CPX_PARAM_TILIM_. But that does not give me a global optimum. Furthermore, I have activated the Presolve indicator. Do you have any ideas? – Frieda12 Oct 10 '19 at 11:33
  • You have to show at least the engine log so that we can see what is going on. It could be that nodes solve to slowly. It could be that CPLEX requires too many nodes to solve the model. It could be that dual or primal bound do not move. All these things require different measures to counter. – Daniel Junglas Oct 11 '19 at 09:03
  • I started my model with the already mentioned parameters and additionally set a time limit of 48h=172800sec. After the model ran 9h, I got the message that CPLEX is no longer running and I should restart the model of. Here you can see the corresponding engine log. That it is not too long, I have omitted a part in the middle. – Frieda12 Oct 11 '19 at 17:25
  • CPXPARAM_MIP_Strategy_File 3 CPXPARAM_TimeLimit 172800 CPXPARAM_WorkMem 1920 CPXPARAM_WorkDir "C:\Users\Jan\opl" Found incumbent of value 774802,677456 after 0,14 sec. (37,49 ticks) Tried aggregator 2 times. MIP Presolve eliminated 325470 rows and 167342 columns. MIP Presolve modified 18082 coefficients. Aggregator did 1 substitutions. – Frieda12 Oct 11 '19 at 17:31
  • Reduced MIP has 42448 rows, 42898 columns, and 127342 nonzeros. Reduced MIP has 25380 binaries, 0 generals, 0 SOSs, and 0 indicators. Presolve time = 1,31 sec. (1734,00 ticks) Probing time = 0,05 sec. (3,86 ticks) Clique table members: 232. MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time = 1,91 sec. (755,63 ticks) – Frieda12 Oct 11 '19 at 17:32
  • Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap * 0+ 0 766353,8650 -19143,8909 102,50% * 0+ 0 488002,5822 -19143,8909 103,92% * 0+ 0 487010,2546 -19143,8909 103,93% * 0+ 0 486183,8227 -19143,8909 103,94% – Frieda12 Oct 11 '19 at 17:34
  • 2716900 2615457 140614,0988 4142 147692,6704 140400,8623 23184327 4,94% 2721363 2617427 140461,4248 4325 147692,6704 140400,8663 23201591 4,94% 2725565 2621838 140619,0059 4346 147692,6704 140400,8760 23238759 4,94% 2729979 2626895 140711,8141 4190 147692,6704 140400,8837 23282409 4,94% Elapsed time = 32284,31 sec. (9404949,12 ticks, tree = 36947,06 MB, solutions = 74) Nodefile size = 35004,90 MB (9509,84 MB after compression) 2734650 2632131 140593,3325 4266 147692,6704 140400,8939 23326209 4,94% – Frieda12 Oct 11 '19 at 17:35
  • I'm sorry for the confusing presentation of the engine log, but I do not know how I can post it better here – Frieda12 Oct 11 '19 at 17:36
  • You should edit your question and add your engine log there. In the comments it is not possible to post the log in a readable format. – Daniel Junglas Oct 14 '19 at 06:30