Skip to content

Clean wrapping of Knitro callbacks in Julia#138

Merged
frapac merged 5 commits intomasterfrom
fp/clean_callbacks
Dec 17, 2019
Merged

Clean wrapping of Knitro callbacks in Julia#138
frapac merged 5 commits intomasterfrom
fp/clean_callbacks

Conversation

@frapac
Copy link
Copy Markdown
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