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

Clean wrapping of Knitro callbacks in Julia #138

Merged
merged 5 commits into from
Dec 17, 2019
Merged

Conversation

frapac
Copy link
Collaborator

@frapac frapac commented Dec 16, 2019

This PR cleans the wrapping of Knitro callbacks. The wrappers are now using directly the information form the C objects rather than querying it from the Julia object KNITRO.Model.
Furthermore:

  • we fix a bug in branch&bound, when using MINLPTests (in this case, Knitro copies the original model and adds new variables and constraints to handle new cuts)
  • we now handle user interruption (CTRL+C) for all callbacks, not just evaluation callbacks
  • we add missing methods to add primal and dual initial starts

Important notice: This PR adds a breaking change in the way user data are handled inside the callbacks. To fetch the user data, the user now has to write in the callbacks:

function eval_function(kc, cb, evalRequest, evalResult, userParams)
    my_data = userParams
    ...
end

instead of:

function eval_function(kc, cb, evalRequest, evalResult, userParams)
    my_data = userParams[:data]
    ...
end

Second important notice: This PR does not allow to resolve #93

@frapac frapac merged commit 1e299a4 into master Dec 17, 2019
@frapac frapac deleted the fp/clean_callbacks branch December 17, 2019 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Segfault when using multithreaded instances of KNITRO
1 participant