scipopt / PySCIPOpt

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

If compile SCIPOpt suite using git repository of every projects, output does not come out to console in real time #896

Open adover134 opened 2 months ago

adover134 commented 2 months ago

Describe the bug https://github.com/scipopt/PySCIPOpt/issues/887#issue-2505564663 This is extension from the link.

I installed Ubuntu server 24.04. I downloaded SCIPsuite tarball from the following link. https://www.scipopt.org/index.php#download

I unzipped tarball, then removed gcg, soplex, papilo, zimpl, scip folders. Then I cloned up-to-date version of each folders from git hub.

I installed Ipopt by cloning from git hub. This is because MUMPS was required by PySCIPOpt.

After installing Ipopt, I installed SCIPsuite with TPI=tny option. Then I installed PySCIPOpt by cloning git repository.

After successful(?) installation, I tried to solve my model. However, when I was not using redirectOutput(), the console did not showed output in real time.

To Reproduce I used master branch of each projects given by scipopt.

Expected behavior The output should be printed on terminal (console) in real time while not using redirectOutput().

Screenshots image

System

Additional context I used m.setParam('display/dualbound/active', 0). However, it worked as m.setParam('display/nnodes/active', 0) and also not showing completion percentage. This one is more easy to fix, right?

Joao-Dionisio commented 2 months ago

Hey, @adover134! Wait, is the output not showing in your screenshot? Or is that you only showing the desired output? In your code snippet you are using redirectOutput.

adover134 commented 2 months ago

Hello, @Joao-Dionisio. If not use redirectOutput(), then The console does not show something important; just save the file per some minutes. I cannot take the picture of it right now, because I am running the model. The purpose of uploading screenshot is, I wanted to show you that the output does not shows number of nodes and completion percentage but showing dualbounds when I deactivated only showing dualbound.

Joao-Dionisio commented 2 months ago

I understand you not wanting to share your code on a public forum, but would it be possible to invite me to a google colab or something, where I would be able to run the code? My email is up201606210[at]up[dot]pt

You could then kick me out as soon as you want, of course

adover134 commented 2 months ago

The console I am saying is the terminal which is running the jupyter notebook. And I think this problem is not related to model. This happens with any model on the same environment. You do not need the specific model to test it.

adover134 commented 2 months ago

Before I send or not, I want to try some other models once again. I will send it if it happens on some more models.

Opt-Mucca commented 2 months ago

I haven't used Jupyter for some time, but I would say that it is a feature of the notebook. Take this with a grain of salt though. By default the output should be directed to the terminal, i.e., where the jupyter notebook is called from. It would then be jupyter's responsibility on whether they capture this information and redirect it to the output of the cell. Maybe this isn't even possible? By calling redirectOutput you're redirecting it to Python's buffer, which the notebook obviously knows how to handle. I don't currently see this as an issue unless someone can correct my understanding.

adover134 commented 2 months ago

@Opt-Mucca, sorry that I saw it right now. I will explain what I was saying. First, this is the example image of right output when not setting any SCIP parameters and not using redirectOutput(). I took this from terminal of windows OS using Jupyter. This was using SCIP version 9.1.0. image As you can see in this image, output is normally printed on terminal even using Jupyter. However, images in the previous issues I wrote, which are took from Ubuntu, shows no table output. You can check the First image from here. https://github.com/scipopt/PySCIPOpt/issues/887#issue-2505564663 Almost half of a day was passed, but not showed any output on terminal. This can be critical for people who want to solve a bit huge MILP model using SCIP. Since Jupyter normally runs on local server, if redirectOutput() is necessary, it will be hard to solve huge model due to maximum memory of web browser.

Also you can see that this table shows many columns. This was when using optimize(), not solveConcurrent(). When using solveConcurrent(), it shows only 5 columns; time, memory, dualboud, primalboud and gap. I did not set any parameters to hide columns.

Opt-Mucca commented 1 month ago

I think I need a summary of the problem. I will write what I understand currently.

adover134 commented 1 month ago

@Opt-Mucca, I will answer what happened on your questions.

If this is not enough, please let me know what information I need to check.