scipopt / PySCIPOpt

Python interface for the SCIP Optimization Suite
https://pyscipopt.readthedocs.io/en/latest/
MIT License
825 stars 255 forks source link

Kernel restarts without showing reason when calling solveConcurrent() on jupyter while SCIP is compiled with TPI=tny #885

Closed adover134 closed 2 months ago

adover134 commented 3 months ago

Describe the bug Calling solveConcurrent() killed kernel without any error code.

To Reproduce Run a model with solveConcurrent() with SCIP compiled with TPI=tny using jupyter notebook.

The example model I tried is this:

from pyscipopt import Model
import pandas as pd
import numpy as np

m = Model()

A = m.addVar(vtype='B')
B = m.addVar(vtype='B')
C = m.addVar(vtype='B')
m.addCons(A >= B+C-1)
m.addCons(B >= 1)
m.addCons(C >= 1)

m.setObjective(3)
m.solveConcurrent()

Expected behavior The solver should run without error. Also, A should be 1 in the solution.

System

Additional context When tried make test, SCIP showed error on some of tests.

Joao-Dionisio commented 3 months ago

Hey @adover134! Does Mark's answer in #883 solve your problem?

adover134 commented 2 months ago

Hello @Joao-Dionisio. As I mentioned in my question, I installed with master branch. This was what Mark's answer suggested.

Joao-Dionisio commented 2 months ago

Mark suggested installing the master branch of SCIP, not PySCIPOpt

adover134 commented 2 months ago

I installed the recent tarball of scipoptsuite from https://scipopt.org/#download, is it different with main branch of SCIP?

Edit: I checked the github. It seems tarball is not up-to-date, since master branch was updated only two days ago. I should try it next time.

adover134 commented 2 months ago

I thought I overwrote the folder, but seems not. I will try once again after remove the original folder and replace with the cloned master branch.

adover134 commented 2 months ago

Thanks, @Joao-Dionisio. I confused cp and mv in linux shell. Now it works.

adover134 commented 2 months ago

I thought this was solved since it could solve very basic one. However, when I tried a big model which has around 15k constraints, I could not get output on console. Also, I tried to use optimize() this time, but also not showing any output. There must be a kind of output problem on compiling with TPI=tny. Also, when solver seemed to be stopped, it took not much time but timed out with jupyter notebook kernel.

Joao-Dionisio commented 2 months ago

Hey @adover134! Glad you could solve your original problem. Can you please create a new issue with your new problem? ANd also, can you share what you're trying to run? That way I can run it locally and see if I can figure out anything. Depending on the problem, 15k constraints might be huge, and a reason for the output not showing.

adover134 commented 2 months ago

I can open new issue, but cannot upload the model since it is directly related to my research. Also, I can say that when I compiled with scipsuite tarball, it showed output even with almost 20k constraints.

Opt-Mucca commented 2 months ago

@adover134 Sorry for not answering this quickly. Happy to know that the problem is actually fixed in SCIP master! My gut feeling for your current issue with not seeing output is that SCIP is just taking a while when solving your problem. You can increase the amount of information that you would say the commands: model.setParam("display/verblevel", 5) If you're not getting output after the root node then SCIP is likely taking ages to process each node, and the command: model.setParam("display/freq", 10) This will output info at every 10 nodes instead of 100 (default). Aside from all this info: If you're getting output from the SCIP tarball and none when using PySCIPOpt then this is most probably an issue and you should definitely open an issue.

Thanks for handling this @Joao-Dionisio !

adover134 commented 2 months ago

If you are okay, then please wait some minutes while I open current problem as new issue. Thank you.