Callbacks - how to query number of calls and time spent in user callbacks?
AnsweredHi,
are the number of user-callback calls and the total time spent in user callbacks stored as model attributes so that I can easily query them?
Or is it only possible to obtain these values by defining private counter/clock variables that I increase in my callback function?
Thank you! Best, Pia
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Pia,
Or is it only possible to obtain these values by defining private counter/clock variables that I increase in my callback function?
Yes, currently it is only possible via private counter/clock variables which have to be increased in your callback function.
Alternatively, you could read the log message via the MESSAGE callback and filter it for the number of callbacks.
Best regards,
Jaromił0 -
Alright, thanks for the quick response!
Best, Pia
0 -
Hi Jaromił Najman,
Are there plans to make the time spent in user-callbacks available as a model attribute? It's a bit of a workaround having to approximate it with my own clock variable.
Best, Niels
0 -
Hi Niels,
There are currently no plans on implementing these attributes in the next release. However, the plans may change in the future.
Best regards,
Jaromił0 -
Hi Jaromił,
Thanks for your quick response! A shame, but understandable. I'll make do with my own counters for now.
Best, Niels
0
Post is closed for comments.
Comments
6 comments