I am trying to get the time taken for Clairvoyant restart to occur in SCIP7.0.0, in order to compare the speed with another numerical method.
In event_estim.c
, I have modified line 2792 to become SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Restart triggered after %d consecutive estimations that the remaining tree will be large. Time taken is %.3f \n", eventhdlrdata->restarthitcounter, SCIPclockGetTime(scip->stat->solvingtime));
However, I get the following error after recompiling SCIP:
src/scip/event_estim.c: In function ‘eventExecEstim’:
src/scip/event_estim.c:2793:50: warning: implicit declaration of function ‘SCIPclockGetTime’; did you mean ‘SCIPsolGetTime’? [-Wimplicit-function-declaration]
eventhdlrdata->restarthitcounter, SCIPclockGetTime(scip->stat->solvingtime));
^~~~~~~~~~~~~~~~
SCIPsolGetTime
src/scip/event_estim.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-unknown-warning-option’
I used SCIPclockGetTime with those arguments because I wanted the current solving time. Could somebody help me please? Thank you for the help.
Short answer: The function you are looking for is SCIPgetSolvingTime(scip)
.
Longer answer: The function SCIPclockGetTime()
is declared in the private header clock.h and should therefore not be directly used in plugins such as this event handler plugin. Instead, you could use SCIPgetClockTime(scip, clockptr)
, (note the difference in the naming, "get" now comes first.) which is a public wrapper around SCIPclockGetTime()
. For accessing the solving time clock, which is the most central clock object in SCIP, you can use the convenience method SCIPgetSolvingTime(scip)
, such that you don't need to dereference scip->stat->solvingtime by yourself.
The reason for this wrapping is that the SCIP core internals can change, for example a new argument may be added to SCIPclockGetTime() in the future, or the solvingtime clock object may be moved to a different location. The public API, which the plugins use, need not be changed in such cases.