Pyomo MIQP problem hanging prior to branch and bound process.

81 views
Skip to first unread message

Diarmid Roberts

unread,
Jun 9, 2021, 5:08:48 AM6/9/21
to pyomo...@googlegroups.com
Hi forum,

I've posed an MIQP problem in pyomo and am trying to solve it repeatedly with Gurobi using different coefficients . It runs well generally (<1s for construct and solve) but in certain instances it hangs. I'm confident it's not stuck in the branch and bound process, as I've set a time cap on that, and when I've had trouble with long solve times in the past, a branch and bound log is shown when I abort. Can anyone help me pin down the problem? Also, is there a way to obtain the real time log from Gurobi when it is called as a solver in pyomo?

The below message is shown when I abort the script. 

Thanks in advance,

Diarmid


  Signal handler called from  C:\Python\Anaconda3\envs\pyomo\lib\subprocess.py _wait 1361
  Waiting...
Traceback (most recent call last):
  File "v_2a_scenario_manager.py", line 111, in <module>
    opt_MIQP(s_dict, BESS_dict, load, K, k_charges, U, W, peak_demands_record)
  File "C:\Python\thesis\v_2a_MIQP\v_2a_PYOMO_functions.py", line 237, in opt_MIQP
    opt.solve(m)
  File "C:\Python\Anaconda3\envs\pyomo\lib\site-packages\pyomo\opt\base\solvers.py", line 584, in solve
    _status = self._apply_solver()
  File "C:\Python\Anaconda3\envs\pyomo\lib\site-packages\pyomo\opt\solver\shellcmd.py", line 244, in _apply_solver
    self._rc, self._log = self._execute_command(self._command)
  File "C:\Python\Anaconda3\envs\pyomo\lib\site-packages\pyomo\opt\solver\shellcmd.py", line 302, in _execute_command
    [rc, log] = run(
  File "C:\Python\Anaconda3\envs\pyomo\lib\site-packages\pyutilib\subprocess\processmngr.py", line 662, in run_command
    rc = process.wait(timelimit)
  File "C:\Python\Anaconda3\envs\pyomo\lib\site-packages\pyutilib\subprocess\processmngr.py", line 836, in wait
    self.process.communicate(input=bytes_cast(self.stdin))
  File "C:\Python\Anaconda3\envs\pyomo\lib\subprocess.py", line 1020, in communicate
    self.wait()
  File "C:\Python\Anaconda3\envs\pyomo\lib\subprocess.py", line 1083, in wait
    return self._wait(timeout=timeout)
  File "C:\Python\Anaconda3\envs\pyomo\lib\subprocess.py", line 1361, in _wait
    result = _winapi.WaitForSingleObject(self._handle,
  File "C:\Python\Anaconda3\envs\pyomo\lib\site-packages\pyutilib\subprocess\processmngr.py", line 144, in verbose_signal_handler
    signal_handler(signum, frame, True)
  File "C:\Python\Anaconda3\envs\pyomo\lib\site-packages\pyutilib\subprocess\processmngr.py", line 190, in signal_handler
    orig_handler(signum, frame)
KeyboardInterrupt
^C
--

Diarmid Roberts
PhD Candidate
The University of Sheffield

Recent Publications:

Diarmid Roberts

unread,
Jun 9, 2021, 5:47:34 AM6/9/21
to pyomo...@googlegroups.com
This problem has been partly resolved, I was not sending the time limit to the solver correctly. Fixing this lets me abort with a solution. The problem is likely stuck trying to get the MIPgap down, which I'm comfortable with.
Reply all
Reply to author
Forward
0 new messages