Scippy

SCIP

Solving Constraint Integer Programs

scip_timing.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_timing.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for timing
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Thorsten Koch
22  * @author Alexander Martin
23  * @author Marc Pfetsch
24  * @author Kati Wolter
25  * @author Gregor Hendel
26  * @author Robert Lion Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_TIMING_H__
32 #define __SCIP_SCIP_TIMING_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_clock.h"
37 #include "scip/type_retcode.h"
38 #include "scip/type_scip.h"
39 
40 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
41  * this structure except the interface methods in scip.c.
42  * In optimized mode, the structure is included in scip.h, because some of the methods
43  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
44  * Additionally, the internal "set.h" is included, such that the defines in set.h are
45  * available in optimized mode.
46  */
47 #ifdef NDEBUG
48 #include "scip/struct_scip.h"
49 #include "scip/struct_stat.h"
50 #include "scip/set.h"
51 #include "scip/tree.h"
52 #include "scip/misc.h"
53 #include "scip/var.h"
54 #include "scip/cons.h"
55 #include "scip/solve.h"
56 #include "scip/debug.h"
57 #endif
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 /**@addtogroup PublicTimingMethods
64  *
65  * @{
66  */
67 
68 /** gets current time of day in seconds (standard time zone)
69  *
70  * @return the current time of day in seconds (standard time zone).
71  */
72 extern
74  SCIP* scip /**< SCIP data structure */
75  );
76 
77 /** creates a clock using the default clock type
78  *
79  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
80  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
81  */
82 extern
84  SCIP* scip, /**< SCIP data structure */
85  SCIP_CLOCK** clck /**< pointer to clock timer */
86  );
87 
88 /** creates a clock counting the CPU user seconds
89  *
90  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
91  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
92  */
93 extern
95  SCIP* scip, /**< SCIP data structure */
96  SCIP_CLOCK** clck /**< pointer to clock timer */
97  );
98 
99 /** creates a clock counting the wall clock seconds
100  *
101  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
102  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
103  */
104 extern
106  SCIP* scip, /**< SCIP data structure */
107  SCIP_CLOCK** clck /**< pointer to clock timer */
108  );
109 
110 /** frees a clock
111  *
112  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
113  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
114  */
115 extern
117  SCIP* scip, /**< SCIP data structure */
118  SCIP_CLOCK** clck /**< pointer to clock timer */
119  );
120 
121 /** resets the time measurement of a clock to zero and completely stops the clock
122  *
123  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
124  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
125  */
126 extern
128  SCIP* scip, /**< SCIP data structure */
129  SCIP_CLOCK* clck /**< clock timer */
130  );
131 
132 /** starts the time measurement of a clock
133  *
134  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
135  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
136  */
137 extern
139  SCIP* scip, /**< SCIP data structure */
140  SCIP_CLOCK* clck /**< clock timer */
141  );
142 
143 /** stops the time measurement of a clock
144  *
145  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
146  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
147  */
148 extern
150  SCIP* scip, /**< SCIP data structure */
151  SCIP_CLOCK* clck /**< clock timer */
152  );
153 
154 /** enables or disables all statistic clocks of SCIP concerning plugin statistics,
155  * LP execution time, strong branching time, etc.
156  *
157  * Method reads the value of the parameter timing/statistictiming. In order to disable statistic timing,
158  * set the parameter to FALSE.
159  *
160  * @note: The (pre-)solving time clocks which are relevant for the output during (pre-)solving
161  * are not affected by this method
162  *
163  * @see: For completely disabling all timing of SCIP, consider setting the parameter timing/enabled to FALSE
164  *
165  * @pre This method can be called if SCIP is in one of the following stages:
166  * - \ref SCIP_STAGE_PROBLEM
167  * - \ref SCIP_STAGE_TRANSFORMING
168  * - \ref SCIP_STAGE_TRANSFORMED
169  * - \ref SCIP_STAGE_INITPRESOLVE
170  * - \ref SCIP_STAGE_PRESOLVING
171  * - \ref SCIP_STAGE_EXITPRESOLVE
172  * - \ref SCIP_STAGE_PRESOLVED
173  * - \ref SCIP_STAGE_INITSOLVE
174  * - \ref SCIP_STAGE_SOLVING
175  * - \ref SCIP_STAGE_SOLVED
176  * - \ref SCIP_STAGE_EXITSOLVE
177  * - \ref SCIP_STAGE_FREETRANS
178  *
179  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
180  */
181 extern
183  SCIP* scip /**< SCIP data structure */
184  );
185 
186 /** starts the current solving time
187  *
188  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
189  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
190  *
191  * @pre This method can be called if SCIP is in one of the following stages:
192  * - \ref SCIP_STAGE_PROBLEM
193  * - \ref SCIP_STAGE_TRANSFORMING
194  * - \ref SCIP_STAGE_TRANSFORMED
195  * - \ref SCIP_STAGE_INITPRESOLVE
196  * - \ref SCIP_STAGE_PRESOLVING
197  * - \ref SCIP_STAGE_EXITPRESOLVE
198  * - \ref SCIP_STAGE_PRESOLVED
199  * - \ref SCIP_STAGE_INITSOLVE
200  * - \ref SCIP_STAGE_SOLVING
201  * - \ref SCIP_STAGE_SOLVED
202  * - \ref SCIP_STAGE_EXITSOLVE
203  * - \ref SCIP_STAGE_FREETRANS
204  *
205  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
206  */
207 extern
209  SCIP* scip /**< SCIP data structure */
210  );
211 
212 /** stops the current solving time in seconds
213  *
214  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
215  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
216  *
217  * @pre This method can be called if SCIP is in one of the following stages:
218  * - \ref SCIP_STAGE_PROBLEM
219  * - \ref SCIP_STAGE_TRANSFORMING
220  * - \ref SCIP_STAGE_TRANSFORMED
221  * - \ref SCIP_STAGE_INITPRESOLVE
222  * - \ref SCIP_STAGE_PRESOLVING
223  * - \ref SCIP_STAGE_EXITPRESOLVE
224  * - \ref SCIP_STAGE_PRESOLVED
225  * - \ref SCIP_STAGE_INITSOLVE
226  * - \ref SCIP_STAGE_SOLVING
227  * - \ref SCIP_STAGE_SOLVED
228  * - \ref SCIP_STAGE_EXITSOLVE
229  * - \ref SCIP_STAGE_FREETRANS
230  *
231  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
232  */
233 extern
235  SCIP* scip /**< SCIP data structure */
236  );
237 
238 /** gets the measured time of a clock in seconds
239  *
240  * @return the measured time of a clock in seconds.
241  */
242 extern
244  SCIP* scip, /**< SCIP data structure */
245  SCIP_CLOCK* clck /**< clock timer */
246  );
247 
248 /** sets the measured time of a clock to the given value in seconds
249  *
250  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
251  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
252  */
253 extern
255  SCIP* scip, /**< SCIP data structure */
256  SCIP_CLOCK* clck, /**< clock timer */
257  SCIP_Real sec /**< time in seconds to set the clock's timer to */
258  );
259 
260 /** gets the current total SCIP time in seconds, possibly accumulated over several problems.
261  *
262  * @return the current total SCIP time in seconds, ie. the total time since the SCIP instance has been created
263  */
264 extern
266  SCIP* scip /**< SCIP data structure */
267  );
268 
269 /** gets the current solving time in seconds
270  *
271  * @return the current solving time in seconds.
272  *
273  * @pre This method can be called if SCIP is in one of the following stages:
274  * - \ref SCIP_STAGE_PROBLEM
275  * - \ref SCIP_STAGE_TRANSFORMING
276  * - \ref SCIP_STAGE_TRANSFORMED
277  * - \ref SCIP_STAGE_INITPRESOLVE
278  * - \ref SCIP_STAGE_PRESOLVING
279  * - \ref SCIP_STAGE_EXITPRESOLVE
280  * - \ref SCIP_STAGE_PRESOLVED
281  * - \ref SCIP_STAGE_INITSOLVE
282  * - \ref SCIP_STAGE_SOLVING
283  * - \ref SCIP_STAGE_SOLVED
284  *
285  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
286  */
287 extern
289  SCIP* scip /**< SCIP data structure */
290  );
291 
292 /** gets the current reading time in seconds
293  *
294  * @return the current reading time in seconds.
295  *
296  * @pre This method can be called if SCIP is in one of the following stages:
297  * - \ref SCIP_STAGE_PROBLEM
298  * - \ref SCIP_STAGE_TRANSFORMING
299  * - \ref SCIP_STAGE_TRANSFORMED
300  * - \ref SCIP_STAGE_INITPRESOLVE
301  * - \ref SCIP_STAGE_PRESOLVING
302  * - \ref SCIP_STAGE_EXITPRESOLVE
303  * - \ref SCIP_STAGE_PRESOLVED
304  * - \ref SCIP_STAGE_INITSOLVE
305  * - \ref SCIP_STAGE_SOLVING
306  * - \ref SCIP_STAGE_SOLVED
307  *
308  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
309  */
310 extern
312  SCIP* scip /**< SCIP data structure */
313  );
314 
315 /** gets the current presolving time in seconds
316  *
317  * @return the current presolving time in seconds.
318  *
319  * @pre This method can be called if SCIP is in one of the following stages:
320  * - \ref SCIP_STAGE_INITPRESOLVE
321  * - \ref SCIP_STAGE_PRESOLVING
322  * - \ref SCIP_STAGE_EXITPRESOLVE
323  * - \ref SCIP_STAGE_PRESOLVED
324  * - \ref SCIP_STAGE_INITSOLVE
325  * - \ref SCIP_STAGE_SOLVING
326  * - \ref SCIP_STAGE_SOLVED
327  *
328  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
329  */
330 extern
332  SCIP* scip /**< SCIP data structure */
333  );
334 
335 /** gets the time need to solve the first LP in the root node
336  *
337  * @return the solving time for the first LP in the root node in seconds.
338  *
339  * @pre This method can be called if SCIP is in one of the following stages:
340  * - \ref SCIP_STAGE_TRANSFORMING
341  * - \ref SCIP_STAGE_TRANSFORMED
342  * - \ref SCIP_STAGE_INITPRESOLVE
343  * - \ref SCIP_STAGE_PRESOLVING
344  * - \ref SCIP_STAGE_EXITPRESOLVE
345  * - \ref SCIP_STAGE_PRESOLVED
346  * - \ref SCIP_STAGE_INITSOLVE
347  * - \ref SCIP_STAGE_SOLVING
348  * - \ref SCIP_STAGE_SOLVED
349  *
350  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
351  */
352 extern
354  SCIP* scip /**< SCIP data structure */
355  );
356 
357 /**@} */
358 
359 #ifdef __cplusplus
360 }
361 #endif
362 
363 #endif
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip_timing.c:436
internal methods for branch and bound tree
SCIP_RETCODE SCIPsetClockTime(SCIP *scip, SCIP_CLOCK *clck, SCIP_Real sec)
Definition: scip_timing.c:392
SCIP_Real SCIPgetReadingTime(SCIP *scip)
Definition: scip_timing.c:463
SCIP_RETCODE SCIPcreateCPUClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip_timing.c:160
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip_timing.c:245
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPenableOrDisableStatisticTiming(SCIP *scip)
Definition: scip_timing.c:285
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip_timing.c:194
SCIP_Real SCIPgetPresolvingTime(SCIP *scip)
Definition: scip_timing.c:500
SCIP_RETCODE SCIPcreateWallClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip_timing.c:177
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip_timing.c:143
type definitions for SCIP&#39;s main datastructure
internal miscellaneous methods
internal methods for global SCIP settings
SCIP main data structure.
SCIP_RETCODE SCIPstopSolvingTime(SCIP *scip)
Definition: scip_timing.c:361
internal methods for problem variables
SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip_timing.c:377
SCIP_RETCODE SCIPstartSolvingTime(SCIP *scip)
Definition: scip_timing.c:328
methods for debugging
datastructures for problem statistics
SCIP_Real SCIPgetTimeOfDay(SCIP *scip)
Definition: scip_timing.c:129
type definitions for clocks and timing issues
internal methods for main solving loop and node processing
SCIP_RETCODE SCIPresetClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip_timing.c:211
#define SCIP_Real
Definition: def.h:157
internal methods for constraints and constraint handlers
SCIP_Real SCIPgetTotalTime(SCIP *scip)
Definition: scip_timing.c:409
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip_timing.c:228
SCIP_Real SCIPgetFirstLPTime(SCIP *scip)
Definition: scip_timing.c:526