|
methods for clocks and timing issues
- Author
- Tobias Achterberg
Definition in file clock.c.
#include <assert.h>
#include <sys/times.h>
#include <sys/time.h>
#include <unistd.h>
#include <time.h>
#include "scip/def.h"
#include "scip/pub_message.h"
#include "blockmemshell/memory.h"
#include "scip/set.h"
#include "scip/clock.h"
#include "scip/struct_clock.h"
Go to the source code of this file.
|
static SCIP_Real | cputime2sec (clock_t cputime) |
|
static SCIP_Real | walltime2sec (long sec, long usec) |
|
static void | sec2cputime (SCIP_Real sec, clock_t *cputime) |
|
static void | sec2walltime (SCIP_Real sec, long *wallsec, long *wallusec) |
|
static void | clockSetType (SCIP_CLOCK *clck, SCIP_CLOCKTYPE newtype) |
|
static void | clockUpdateDefaultType (SCIP_CLOCK *clck, SCIP_CLOCKTYPE defaultclocktype) |
|
SCIP_RETCODE | SCIPclockCreate (SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype) |
|
void | SCIPclockFree (SCIP_CLOCK **clck) |
|
void | SCIPclockInit (SCIP_CLOCK *clck, SCIP_CLOCKTYPE clocktype) |
|
void | SCIPclockReset (SCIP_CLOCK *clck) |
|
void | SCIPclockEnable (SCIP_CLOCK *clck) |
|
void | SCIPclockDisable (SCIP_CLOCK *clck) |
|
void | SCIPclockSetType (SCIP_CLOCK *clck, SCIP_CLOCKTYPE clocktype) |
|
void | SCIPclockStart (SCIP_CLOCK *clck, SCIP_SET *set) |
|
void | SCIPclockStop (SCIP_CLOCK *clck, SCIP_SET *set) |
|
SCIP_Bool | SCIPclockIsRunning (SCIP_CLOCK *clck) |
|
SCIP_Real | SCIPclockGetTime (SCIP_CLOCK *clck) |
|
SCIP_Real | SCIPclockGetLastTime (SCIP_CLOCK *clck) |
|
void | SCIPclockSetTime (SCIP_CLOCK *clck, SCIP_Real sec) |
|
SCIP_Real | SCIPclockGetTimeOfDay (void) |
|
static SCIP_Real cputime2sec |
( |
clock_t |
cputime | ) |
|
|
static |
static SCIP_Real walltime2sec |
( |
long |
sec, |
|
|
long |
usec |
|
) |
| |
|
static |
static void sec2cputime |
( |
SCIP_Real |
sec, |
|
|
clock_t * |
cputime |
|
) |
| |
|
static |
converts seconds into CPU clock ticks
- Parameters
-
sec | seconds |
cputime | pointer to store clock ticks for CPU time |
Definition at line 77 of file clock.c.
References NULL.
Referenced by SCIPclockSetTime().
static void sec2walltime |
( |
SCIP_Real |
sec, |
|
|
long * |
wallsec, |
|
|
long * |
wallusec |
|
) |
| |
|
static |
converts wall clock time into seconds
- Parameters
-
sec | seconds |
wallsec | pointer to store seconds counter |
wallusec | pointer to store microseconds counter |
Definition at line 100 of file clock.c.
References NULL.
Referenced by SCIPclockSetTime().
creates a clock and initializes it
- Parameters
-
clck | pointer to clock timer |
clocktype | type of clock |
Definition at line 160 of file clock.c.
References BMSallocMemory, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPclockInit().
Referenced by SCIPbranchruleCreate(), SCIPconflictCreate(), SCIPconflicthdlrCreate(), SCIPconshdlrCreate(), SCIPcreate(), SCIPcreateClock(), SCIPcreateCPUClock(), SCIPcreateWallClock(), SCIPcutpoolCreate(), SCIPeventhdlrCreate(), SCIPheurCreate(), SCIPnodeselCreate(), SCIPpresolCreate(), SCIPpricerCreate(), SCIPpricestoreCreate(), SCIPpropCreate(), SCIPreaderCreate(), SCIPreaderRead(), SCIPrelaxCreate(), SCIPsepaCreate(), and SCIPstatCreate().
frees a clock
- Parameters
-
clck | pointer to clock timer |
Definition at line 175 of file clock.c.
References BMSfreeMemory, and NULL.
Referenced by SCIPbranchruleFree(), SCIPconflictFree(), SCIPconflicthdlrFree(), SCIPconshdlrFree(), SCIPcutpoolFree(), SCIPeventhdlrFree(), SCIPfree(), SCIPfreeClock(), SCIPheurFree(), SCIPnodeselFree(), SCIPpresolFree(), SCIPpricerFree(), SCIPpricestoreFree(), SCIPpropFree(), SCIPreaderFree(), SCIPreaderRead(), SCIPrelaxFree(), SCIPsepaFree(), and SCIPstatFree().
completely stop the clock and reset the clock's counter to zero
- Parameters
-
Definition at line 199 of file clock.c.
References SCIP_Clock::clocktype, SCIP_Clock::cpuclock, SCIP_Clock::data, SCIP_Clock::nruns, NULL, SCIP_CLOCKTYPE_CPU, SCIP_CLOCKTYPE_DEFAULT, SCIP_CLOCKTYPE_WALL, SCIPABORT, SCIPdebugMessage, SCIPerrorMessage, SCIP_WallClock::sec, SCIP_WallClock::usec, SCIP_Clock::usedefault, SCIP_CPUClock::user, and SCIP_Clock::wallclock.
Referenced by clockSetType(), SCIPbranchruleInit(), SCIPclockDisable(), SCIPclockSetType(), SCIPconflicthdlrInit(), SCIPconshdlrInit(), SCIPeventhdlrInit(), SCIPheurInit(), SCIPnodeselInit(), SCIPpresolInit(), SCIPpricerInit(), SCIPpropInit(), SCIPreaderResetReadingTime(), SCIPrelaxInit(), SCIPresetClock(), SCIPsepaInit(), and SCIPstatReset().
starts measurement of time in the given clock
- Parameters
-
clck | clock timer |
set | global SCIP settings |
Definition at line 266 of file clock.c.
References SCIP_Clock::clocktype, clockUpdateDefaultType(), SCIP_Clock::cpuclock, cputime2sec(), SCIP_Clock::data, SCIP_Clock::enabled, SCIP_Clock::lasttime, SCIP_Clock::nruns, NULL, SCIP_CLOCKTYPE_CPU, SCIP_CLOCKTYPE_DEFAULT, SCIP_CLOCKTYPE_WALL, SCIPABORT, SCIPdebugMessage, SCIPerrorMessage, SCIP_WallClock::sec, SCIP_WallClock::usec, SCIP_Clock::usedefault, SCIP_CPUClock::user, SCIP_Clock::wallclock, and walltime2sec().
Referenced by addCurrentSolution(), conflictAddConflictCons(), conflictAnalyzeBoundexceedingLP(), conflictAnalyzeInfeasibleLP(), conflictAnalyzeLP(), lpBarrier(), lpDualSimplex(), lpLexDualSimplex(), lpPrimalSimplex(), nlpSolve(), nodeRepropagate(), performStrongbranchWithPropagation(), presolve(), SCIPbranchruleExecExternSol(), SCIPbranchruleExecLPSol(), SCIPbranchruleExecPseudoSol(), SCIPbranchruleExit(), SCIPbranchruleExitsol(), SCIPbranchruleInit(), SCIPbranchruleInitsol(), SCIPcolGetStrongbranch(), SCIPcolGetStrongbranches(), SCIPconflictAnalyze(), SCIPconflictAnalyzePseudo(), SCIPconflictAnalyzeStrongbranch(), SCIPconflicthdlrExec(), SCIPconflicthdlrExit(), SCIPconflicthdlrExitsol(), SCIPconflicthdlrInit(), SCIPconflicthdlrInitsol(), SCIPconshdlrCheck(), SCIPconshdlrEnforceLPSol(), SCIPconshdlrEnforcePseudoSol(), SCIPconshdlrExit(), SCIPconshdlrExitpre(), SCIPconshdlrExitsol(), SCIPconshdlrInit(), SCIPconshdlrInitLP(), SCIPconshdlrInitpre(), SCIPconshdlrInitsol(), SCIPconshdlrPresolve(), SCIPconshdlrPropagate(), SCIPconshdlrSeparateLP(), SCIPconshdlrSeparateSol(), SCIPconsResolvePropagation(), SCIPcopy(), SCIPcopyOrig(), SCIPcreate(), SCIPcutpoolSeparate(), SCIPeventhdlrExec(), SCIPeventhdlrExit(), SCIPeventhdlrExitsol(), SCIPeventhdlrInit(), SCIPeventhdlrInitsol(), SCIPheurExec(), SCIPheurExit(), SCIPheurExitsol(), SCIPheurInit(), SCIPheurInitsol(), SCIPnodeselExit(), SCIPnodeselExitsol(), SCIPnodeselInit(), SCIPnodeselInitsol(), SCIPnodeselSelect(), SCIPpresolExec(), SCIPpresolExit(), SCIPpresolExitpre(), SCIPpresolInit(), SCIPpresolInitpre(), SCIPpresolve(), SCIPpricerExit(), SCIPpricerExitsol(), SCIPpricerFarkas(), SCIPpricerInit(), SCIPpricerInitsol(), SCIPpricerRedcost(), SCIPpricestoreAddProbVars(), SCIPpropExec(), SCIPpropExit(), SCIPpropExitpre(), SCIPpropExitsol(), SCIPpropInit(), SCIPpropInitpre(), SCIPpropInitsol(), SCIPpropPresol(), SCIPpropResolvePropagation(), SCIPreaderRead(), SCIPrelaxExec(), SCIPrelaxExit(), SCIPrelaxExitsol(), SCIPrelaxInit(), SCIPrelaxInitsol(), SCIPsepaExecLP(), SCIPsepaExecSol(), SCIPsepaExit(), SCIPsepaExitsol(), SCIPsepaInit(), SCIPsepaInitsol(), SCIPsolve(), SCIPsolveCIP(), SCIPstartClock(), and SCIPstartSolvingTime().
stops measurement of time in the given clock
- Parameters
-
clck | clock timer |
set | global SCIP settings |
Definition at line 335 of file clock.c.
References SCIP_Clock::clocktype, SCIP_Clock::cpuclock, SCIP_Clock::data, SCIP_Clock::enabled, SCIP_Clock::nruns, NULL, SCIP_CLOCKTYPE_CPU, SCIP_CLOCKTYPE_DEFAULT, SCIP_CLOCKTYPE_WALL, SCIPABORT, SCIPdebugMessage, SCIPerrorMessage, SCIP_WallClock::sec, SCIP_WallClock::usec, SCIP_Clock::usedefault, SCIP_CPUClock::user, and SCIP_Clock::wallclock.
Referenced by addCurrentSolution(), conflictAddConflictCons(), conflictAnalyzeBoundexceedingLP(), conflictAnalyzeInfeasibleLP(), conflictAnalyzeLP(), lpBarrier(), lpDualSimplex(), lpLexDualSimplex(), lpPrimalSimplex(), nlpSolve(), nodeRepropagate(), performStrongbranchWithPropagation(), presolve(), SCIPbranchruleExecExternSol(), SCIPbranchruleExecLPSol(), SCIPbranchruleExecPseudoSol(), SCIPbranchruleExit(), SCIPbranchruleExitsol(), SCIPbranchruleInit(), SCIPbranchruleInitsol(), SCIPcolGetStrongbranch(), SCIPcolGetStrongbranches(), SCIPconflictAnalyze(), SCIPconflictAnalyzePseudo(), SCIPconflictAnalyzeStrongbranch(), SCIPconflicthdlrExec(), SCIPconflicthdlrExit(), SCIPconflicthdlrExitsol(), SCIPconflicthdlrInit(), SCIPconflicthdlrInitsol(), SCIPconshdlrCheck(), SCIPconshdlrEnforceLPSol(), SCIPconshdlrEnforcePseudoSol(), SCIPconshdlrExit(), SCIPconshdlrExitpre(), SCIPconshdlrExitsol(), SCIPconshdlrInit(), SCIPconshdlrInitLP(), SCIPconshdlrInitpre(), SCIPconshdlrInitsol(), SCIPconshdlrPresolve(), SCIPconshdlrPropagate(), SCIPconshdlrSeparateLP(), SCIPconshdlrSeparateSol(), SCIPconsResolvePropagation(), SCIPcopy(), SCIPcopyOrig(), SCIPcutpoolSeparate(), SCIPeventhdlrExec(), SCIPeventhdlrExit(), SCIPeventhdlrExitsol(), SCIPeventhdlrInit(), SCIPeventhdlrInitsol(), SCIPheurExec(), SCIPheurExit(), SCIPheurExitsol(), SCIPheurInit(), SCIPheurInitsol(), SCIPnodeselExit(), SCIPnodeselExitsol(), SCIPnodeselInit(), SCIPnodeselInitsol(), SCIPnodeselSelect(), SCIPpresolExec(), SCIPpresolExit(), SCIPpresolExitpre(), SCIPpresolInit(), SCIPpresolInitpre(), SCIPpresolve(), SCIPpricerExit(), SCIPpricerExitsol(), SCIPpricerFarkas(), SCIPpricerInit(), SCIPpricerInitsol(), SCIPpricerRedcost(), SCIPpricestoreAddProbVars(), SCIPpropExec(), SCIPpropExit(), SCIPpropExitpre(), SCIPpropExitsol(), SCIPpropInit(), SCIPpropInitpre(), SCIPpropInitsol(), SCIPpropPresol(), SCIPpropResolvePropagation(), SCIPreaderRead(), SCIPrelaxExec(), SCIPrelaxExit(), SCIPrelaxExitsol(), SCIPrelaxInit(), SCIPrelaxInitsol(), SCIPsepaExecLP(), SCIPsepaExecSol(), SCIPsepaExit(), SCIPsepaExitsol(), SCIPsepaInit(), SCIPsepaInitsol(), SCIPsolve(), SCIPsolveCIP(), SCIPstopClock(), and SCIPstopSolvingTime().
gets the used time of this clock in seconds
- Parameters
-
Definition at line 413 of file clock.c.
References SCIP_Clock::clocktype, SCIP_Clock::cpuclock, cputime2sec(), SCIP_Clock::data, SCIP_Clock::lasttime, SCIP_Clock::nruns, NULL, SCIP_CLOCKTYPE_CPU, SCIP_CLOCKTYPE_DEFAULT, SCIP_CLOCKTYPE_WALL, SCIP_Real, SCIPABORT, SCIPdebugMessage, SCIPerrorMessage, SCIP_WallClock::sec, SCIP_WallClock::usec, SCIP_Clock::usedefault, SCIP_CPUClock::user, SCIP_Clock::wallclock, and walltime2sec().
Referenced by clockSetType(), displayRelevantStats(), lpAlgorithm(), lpBarrier(), lpDualSimplex(), lpLexDualSimplex(), lpPrimalSimplex(), printHeuristicStatistics(), printLPStatistics(), printNLPStatistics(), printTime(), printTimingStatistics(), printTreeStatistics(), SCIPbranchruleGetSetupTime(), SCIPbranchruleGetTime(), SCIPconflictGetBoundexceedingLPTime(), SCIPconflictGetGlobalApplTime(), SCIPconflictGetInfeasibleLPTime(), SCIPconflictGetPropTime(), SCIPconflictGetPseudoTime(), SCIPconflictGetStrongbranchTime(), SCIPconflicthdlrGetSetupTime(), SCIPconflicthdlrGetTime(), SCIPconshdlrGetCheckTime(), SCIPconshdlrGetEnfoLPTime(), SCIPconshdlrGetEnfoPSTime(), SCIPconshdlrGetPresolTime(), SCIPconshdlrGetPropTime(), SCIPconshdlrGetRespropTime(), SCIPconshdlrGetSepaTime(), SCIPconshdlrGetSetupTime(), SCIPconshdlrGetStrongBranchPropTime(), SCIPcopy(), SCIPcopyOrig(), SCIPcutpoolGetTime(), SCIPeventhdlrGetSetupTime(), SCIPeventhdlrGetTime(), SCIPgetClockTime(), SCIPgetPresolvingTime(), SCIPgetSolvingTime(), SCIPgetTotalTime(), SCIPheurGetSetupTime(), SCIPheurGetTime(), SCIPnodeselGetSetupTime(), SCIPnodeselGetTime(), SCIPpresolGetSetupTime(), SCIPpresolGetTime(), SCIPpresolve(), SCIPpricerGetSetupTime(), SCIPpricerGetTime(), SCIPpricestoreGetProbPricingTime(), SCIPpropGetPresolTime(), SCIPpropGetRespropTime(), SCIPpropGetSetupTime(), SCIPpropGetStrongBranchPropTime(), SCIPpropGetTime(), SCIPreaderGetReadingTime(), SCIPreaderRead(), SCIPrelaxGetSetupTime(), SCIPrelaxGetTime(), SCIPsepaGetSetupTime(), SCIPsepaGetTime(), SCIPsolveIsStopped(), SCIPstatUpdatePrimalDualIntegral(), solStamp(), and solveNodeInitialLP().
sets the used time of this clock in seconds
- Parameters
-
clck | clock timer |
sec | time in seconds to set the clock's timer to |
Definition at line 503 of file clock.c.
References clockSetType(), SCIP_Clock::clocktype, SCIP_Clock::cpuclock, SCIP_Clock::data, SCIP_Clock::nruns, NULL, SCIP_CLOCKTYPE_CPU, SCIP_CLOCKTYPE_DEFAULT, SCIP_CLOCKTYPE_WALL, SCIPABORT, SCIPdebugMessage, SCIPerrorMessage, SCIP_WallClock::sec, sec2cputime(), sec2walltime(), SCIP_WallClock::usec, SCIP_Clock::usedefault, SCIP_CPUClock::user, and SCIP_Clock::wallclock.
Referenced by clockSetType(), SCIPreaderRead(), SCIPreadProb(), and SCIPsetClockTime().
|