Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

User callback interrupt (HighsCallbackDataIn%user_interrupt, Fortran syntax) does not seem to work for release 1.7.0 #1660

Open
jeffreydeankelly2 opened this issue Mar 9, 2024 · 6 comments
Assignees
Labels

Comments

@jeffreydeankelly2
Copy link

Installed version 1.7.0.

Everything works great for our set of MIP problems but when the user callback sets the HighsCallbackDataIn data structure item user_interrupt to some non-zero value after a user interrupt event (Control-C), HiGHS does not terminate. It keeps going without gracefully exiting.

When we print/write the HighsCallbackDataIn%user_interrupt value (Fortran syntax) before the interrupt event, its value is zero (0) and after the event the value of HighsCallbackDataIn%user_interrupt is set to one (1).

On subsequent calls to the user callback the value of HighsCallbackDataIn%user_interrupt = 1 as expected but there is no graceful termination.

@jajhall
Copy link
Sponsor Member

jajhall commented Mar 9, 2024

Not all callback permit an interrupt.

Which one are you setting to be "on"?

@jeffreydeankelly2
Copy link
Author

jeffreydeankelly2 commented Mar 9, 2024 via email

@jajhall
Copy link
Sponsor Member

jajhall commented Mar 10, 2024

kHighsCallbackMipImprovingSolution doesn't allow an interrupt: if you set HighsCallbackDataIn%user_interrupt value then it is ignored. Note that the improving solution callback may not be called often, so it's not a great source of interrupt. It could be argued that it should still be a point where an interrupt can be forced, though...

We need to document which callbacks permit interrupt

You need kCallbackMipInterrupt. This is called frequently

@jajhall jajhall closed this as completed Mar 10, 2024
@jeffreydeankelly2
Copy link
Author

jeffreydeankelly2 commented Mar 11, 2024 via email

@jajhall
Copy link
Sponsor Member

jajhall commented Mar 11, 2024

Since we have a C++ unit test for this interrupt,

TEST_CASE("highs-callback-mip-interrupt", "[highs-callback]") {

I'm wondering whether there's a problem when using the callback from Fortran - and possibly C

I'll investigate, but I can't do it for a few days, as I've got teaching issues to address

@jajhall jajhall reopened this Mar 11, 2024
@jeffreydeankelly2
Copy link
Author

jeffreydeankelly2 commented Mar 11, 2024 via email

@jajhall jajhall self-assigned this Mar 12, 2024
@jajhall jajhall added the bug label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants