0

I solve my ILP problem using docplex IBM package for Python under CP Optimizer Model. It's working correctly, and I get the target result; however, when I call the Model.solve() many times. i.e., more than 10000 cycles, in the beginning, everything running correctly but after a while the program crash, and I get the following error::

LocalSolver Exception: Nothing to read from local solver process. Possibly not started because cplex dll is not accessible.

I have CPLEX Studio 12.10 installed on a desktop computer under Windows 10 operating system with I7.4 CPU 3.40 GHz, 32 GB memory, an anaconda environment. I want to solve the problem locally, not on the cloud.

  • Hello. The local solve is done using a separate sub-process that is created every time you invoke solve(). It is terminated at the end, but it is possible, due to the high frequency of your requests, that the OS has not the time to properly clean these process. Could you please check with a Windows Monitor that your memory is not growing up to the limit because of that ? – Olivier OUDOT Oct 23 '20 at 17:59
  • thank you for your response, I checked the windows monitor, the memory not growing only a slight rise. – labed AbdelJalil Oct 26 '20 at 02:40
  • I have may be a solution to your problem. When creating the sub-process, there is a timer to check if the process has been started and has sent an acknowledge message. The timer (one second) is apparently too short in some environments, in particular if your disk is slow (if remote for example). I have already fixed that by making the timeout delay configurable, and by adding a more explicit error in this case. This will be available in pypi soon. – Olivier OUDOT Oct 26 '20 at 18:04
  • To by-pass this problem (and check it is the real cause of the behavior you have), you can modify the file docplex.cp.solver.solver_local.py, located where you have installed docplex. Search for the line "timer = threading.Timer(1, lambda: self.process.kill() if self.version_info is None else None)" (around line 120) and then replace the "1" by "10" for example. Keep me informed of the result. :-) – Olivier OUDOT Oct 26 '20 at 18:08
  • yeah, I did as you said. I change the timer "1" by "10" but I still have the same problem. – labed AbdelJalil Oct 29 '20 at 01:55
  • Did you try to start the process (cpoptimizer.exe) directly from a command prompt ? It is an interactive solver allowing to solve problems expressed with the CPO file format. If all is correct, you should have a start banner and a prompt to enter a command. If not, then you have a problem with your installation of COS. – Olivier OUDOT Oct 30 '20 at 07:33
  • I will check again – labed AbdelJalil Nov 01 '20 at 01:31

0 Answers0