Skip to content

Path issues when running multiple solves at the same time with COIN-OR CBC #3638

Open
@arizzuto

Description

@arizzuto

Summary

I'm running a series of sequential MIP solves with COIN-OR CBC. The process runs a solution and then uses the solution as input to a new problem. This continues in a loop for many iterations. If I simultaneously kick off another series of solves as described above, after some time, one of the two processes throws the following:

Traceback (most recent call last):
  File "/Users/aaronrizzuto/code/arbitrageModelling/BackCasting/run_backcast.py", line 197, in <module>
    main()
  File "/Users/aaronrizzuto/code/arbitrageModelling/BackCasting/run_backcast.py", line 121, in main
    mip.solve(additional_solver_options={'solu': settings_obj.sol_path}, print_solver_output=False, attempt_tolerance_adjustment=True)
  File "/Users/aaronrizzuto/code/arbitrageModelling/BackCasting/venv/lib/python3.12/site-packages/energy_schedule_optimiser/OptimiseEnergyStorage/btm_mip.py", line 708, in solve
    _results = self._run_solve(solver_options=solver_options, print_solver_output=print_solver_output)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aaronrizzuto/code/arbitrageModelling/BackCasting/venv/lib/python3.12/site-packages/energy_schedule_optimiser/OptimiseEnergyStorage/btm_mip.py", line 665, in _run_solve
    results = pyo.SolverFactory('cbc').solve(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aaronrizzuto/code/arbitrageModelling/BackCasting/venv/lib/python3.12/site-packages/pyomo/opt/base/solvers.py", line 636, in solve
    result = self._postsolve()
             ^^^^^^^^^^^^^^^^^
  File "/Users/aaronrizzuto/code/arbitrageModelling/BackCasting/venv/lib/python3.12/site-packages/pyomo/solvers/plugins/solvers/CBCplugin.py", line 1087, in _postsolve
    results = super(CBCSHELL, self)._postsolve()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aaronrizzuto/code/arbitrageModelling/BackCasting/venv/lib/python3.12/site-packages/pyomo/opt/solver/shellcmd.py", line 286, in _postsolve
    raise IOError(msg % (self._log_file, self.path))
                                         ^^^^^^^^^
AttributeError: 'CBCSHELL' object has no attribute 'path'

Is it possible that I am creating a race condition on intermediary files in some way?

Steps to reproduce the issue

Have to series of sequential solves running at the same time. I will attempt to generate a repo with the problem failure with a simple MIP problem if required.

Error Message

$ # Output message here, including entire stack trace, if available

Information on your system

Pyomo version: 6.9.2
Python version: 3.12
Operating system: MAC OS 15.1
How Pyomo was installed: PyPI
Solver: COIN-OR [email protected] via coinbrew script.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions