我正在使用Java中的ILOG CPLEX庫來解決ILP問題。我使用的是默認設置,並沒有調整任何參數。我使用的示例代碼,我在網上找到的樣品我的主循環:Ubuntu內核因內存不足而殺死CPLEX ILP進程
if (cplex.solve()) {
Log.printLine("CPLEX solved successfully");
} else {
Log.printLine("probably insufficient memory or some other weird problem.");
}
我推出了具有24GB RAM一個Ubuntu 14系統上我的罐子,讓它解決更大的問題。當我的問題變得太大而無法用24GB RAM解決時,我希望CPLEX從解決方法返回false。相反,我的CPLEX不斷運行,直到我的內核殺死進程。我通過檢查kern.log驗證了這一點:
Nov 6 00:21:47 node0 kernel: [3779722.641458] Out of memory: Kill process 3600 (java) score 980 or sacrifice child
Nov 6 00:21:47 node0 kernel: [3779722.641476] Killed process 3600 (java) total-vm:36562768kB, anon-rss:23969732kB, file-rss:688kB
這是我第一次與CPLEX工作,我不知道我怎樣才能讓這個CPLEX將返回false的解決方法時,它運行的內存與(而不是捱餓系統資源)工作?
我試着在網上查找,發現了一些有關WorkMem和TreeLimit參數的C++線程,但我無法找到如何使用Java庫配置這些線程。
有人能幫我進一步嗎?謝謝。
編輯:這裏是CPLEX日誌
Found incumbent of value 5000.000000 after 0.09 sec. (48.51 ticks)
Tried aggregator 1 time.
MIP Presolve eliminated 600000 rows and 1 columns.
MIP Presolve modified 156010 coefficients.
Reduced MIP has 171010 rows, 770000 columns, and 3170000 nonzeros.
Reduced MIP has 770000 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 5.54 sec. (2155.22 ticks)
Probing time = 5.51 sec. (186.83 ticks)
Tried aggregator 1 time.
Reduced MIP has 171010 rows, 770000 columns, and 3170000 nonzeros.
Reduced MIP has 770000 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 3.68 sec. (1438.46 ticks)
Probing time = 3.45 sec. (181.50 ticks)
Clique table members: 263821.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: deterministic, using up to 4 threads.
Root relaxation solution time = 43.34 sec. (14019.88 ticks)
Nodes Cuts/
Node Left Objective IInf Best Integer Best Bound ItCnt Gap
0+ 0 5000.0000 0.0000 100.00%
0 0 4547.0452 14891 5000.0000 4547.0452 20 9.06%
0 0 4568.6089 12066 5000.0000 Cuts: 6990 318432 8.63%
如此下去,直到內核殺死它。
最佳答案取決於cplex耗盡內存的過程。你可以在日誌中看到這個。它能夠啓動並解決初始LP嗎? –
嗨大衛,不,它一直試圖解決,似乎並沒有放棄,這就是爲什麼我認爲內核跳入並殺死它。在一段時間左右之後有沒有辦法讓ILP迴歸? – Piet
我已經添加了日誌,我希望這有助於爲我的問題找到解決方案。 – Piet