Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Setting threads parameter leads to Cbc crash #303

Closed
Sceriffo opened this issue Sep 1, 2022 · 2 comments
Closed

Setting threads parameter leads to Cbc crash #303

Sceriffo opened this issue Sep 1, 2022 · 2 comments

Comments

@Sceriffo
Copy link
Contributor

Sceriffo commented Sep 1, 2022

Describe the bug
Setting threads parameter using model's setter method doesn't work and leads to crash of Cbc at the end of computation.

ERROR while running Cbc. Signal SIGSEGV caught. Getting stack trace.
...
python3(_PyObject_MakeTpCall+0x296) [0x5f74f6]
python3(_PyEval_EvalFrameDefault+0x5dc4) [0x571164]
python3(_PyEval_EvalCodeWithName+0x26a) [0x569dba]
python3(_PyFunction_Vectorcall+0x393) [0x5f6eb3]
python3(_PyEval_EvalFrameDefault+0x85a) [0x56bbfa]
python3(_PyEval_EvalCodeWithName+0x26a) [0x569dba]
python3(_PyFunction_Vectorcall+0x393) [0x5f6eb3]
python3(_PyEval_EvalFrameDefault+0x85a) [0x56bbfa]
python3(_PyFunction_Vectorcall+0x1b6) [0x5f6cd6]
python3(_PyEval_EvalFrameDefault+0x72d) [0x56bacd]
python3(_PyEval_EvalCodeWithName+0x26a) [0x569dba]
python3(_PyFunction_Vectorcall+0x393) [0x5f6eb3]
python3(_PyEval_EvalFrameDefault+0x72d) [0x56bacd]
python3(_PyEval_EvalCodeWithName+0x26a) [0x569dba]
python3(PyEval_EvalCode+0x27) [0x6902a7]
python3() [0x67f951]
python3() [0x67f9cf]
python3() [0x67fa71]
python3(PyRun_SimpleFileExFlags+0x197) [0x681b97]
python3(Py_RunMain+0x212) [0x6b9d32]
python3(Py_BytesMain+0x2d) [0x6ba0bd]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f92f51de083]
python3(_start+0x2e) [0x5fc5fe]

To Reproduce

model.threads = 2
model.optimize()

Expected behavior
Threads limited to 2 and Cbc oesn't crash

Desktop (please complete the following information):

  • Operating System, version: Ubuntu 20.04.4 LTS
  • Python version: 3.8.10
  • Python-MIP version (we recommend you to test with the latest version): 1.14.1

Additional context
I notice that it works fine by using the Cbc wrapped method. Like:

cbc_set_parameter(model.solver, "threads", "{}".format(2))
@Sceriffo
Copy link
Contributor Author

Sceriffo commented Sep 1, 2022

I might have a fix.

@sebheger
Copy link
Collaborator

sebheger commented Sep 1, 2022

@Sceriffo We are more that happy to review a pull request

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants