Catch SCIP errors / throw Python errors
PySCIPOpt's error management should be improved. There are many situations in which very simple problems resolve in uncaught errors and crash the parent python program.
Here is one simple example: Create an empty model, solve it, call freeReoptSolve, solve again.
from pyscipopt import Model
m = Model()
print('first optimization')
m.optimize()
print('change state')
m.freeReoptSolve()
print('state changed, 2nd optimization')
m.optimize()
print('done')
This goes into a segmentation fault that ends the Python thread. This should rather throw an error in Python with some more explanation on how to avoid it.
Just to be clear: I do not need help with the particular problem mentioned above. I just suggest catching errors and forwarding them to the python error stream.
Throwing the error in Python and showing the original error message would (1) help identify the problem (2) allow making use of Python debugging mode
Hi, that does sound like a useful extension of the code! If you have a workaround for this issue or extended the code base on your side, please feel free to create a merge request and we can have a look to integrate this into the master.
Thanks for letting us know.
I wish I had, but unfortunately, I never dived deep enough into PySCIPOpt's code. Maybe someone can tag this issue as enhancement.