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-2021 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 scipopt.org. */
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 Leona 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 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /**@addtogroup PublicTimingMethods
45  *
46  * @{
47  */
48 
49 /** gets current time of day in seconds (standard time zone)
50  *
51  * @return the current time of day in seconds (standard time zone).
52  */
55  SCIP* scip /**< SCIP data structure */
56  );
57 
58 /** creates a clock using the default clock type
59  *
60  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
61  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
62  */
65  SCIP* scip, /**< SCIP data structure */
66  SCIP_CLOCK** clck /**< pointer to clock timer */
67  );
68 
69 /** creates a clock counting the CPU user seconds
70  *
71  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
72  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
73  */
76  SCIP* scip, /**< SCIP data structure */
77  SCIP_CLOCK** clck /**< pointer to clock timer */
78  );
79 
80 /** creates a clock counting the wall clock seconds
81  *
82  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
83  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
84  */
87  SCIP* scip, /**< SCIP data structure */
88  SCIP_CLOCK** clck /**< pointer to clock timer */
89  );
90 
91 /** frees a clock
92  *
93  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
94  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
95  */
98  SCIP* scip, /**< SCIP data structure */
99  SCIP_CLOCK** clck /**< pointer to clock timer */
100  );
101 
102 /** resets the time measurement of a clock to zero and completely stops the clock
103  *
104  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
105  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
106  */
109  SCIP* scip, /**< SCIP data structure */
110  SCIP_CLOCK* clck /**< clock timer */
111  );
112 
113 /** starts the time measurement of a clock
114  *
115  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
116  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
117  */
120  SCIP* scip, /**< SCIP data structure */
121  SCIP_CLOCK* clck /**< clock timer */
122  );
123 
124 /** stops the time measurement of a clock
125  *
126  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
127  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
128  */
131  SCIP* scip, /**< SCIP data structure */
132  SCIP_CLOCK* clck /**< clock timer */
133  );
134 
135 /** enables or disables all statistic clocks of SCIP concerning plugin statistics,
136  * LP execution time, strong branching time, etc.
137  *
138  * Method reads the value of the parameter timing/statistictiming. In order to disable statistic timing,
139  * set the parameter to FALSE.
140  *
141  * @note: The (pre-)solving time clocks which are relevant for the output during (pre-)solving
142  * are not affected by this method
143  *
144  * @see: For completely disabling all timing of SCIP, consider setting the parameter timing/enabled to FALSE
145  *
146  * @pre This method can be called if SCIP is in one of the following stages:
147  * - \ref SCIP_STAGE_PROBLEM
148  * - \ref SCIP_STAGE_TRANSFORMING
149  * - \ref SCIP_STAGE_TRANSFORMED
150  * - \ref SCIP_STAGE_INITPRESOLVE
151  * - \ref SCIP_STAGE_PRESOLVING
152  * - \ref SCIP_STAGE_EXITPRESOLVE
153  * - \ref SCIP_STAGE_PRESOLVED
154  * - \ref SCIP_STAGE_INITSOLVE
155  * - \ref SCIP_STAGE_SOLVING
156  * - \ref SCIP_STAGE_SOLVED
157  * - \ref SCIP_STAGE_EXITSOLVE
158  * - \ref SCIP_STAGE_FREETRANS
159  *
160  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
161  */
164  SCIP* scip /**< SCIP data structure */
165  );
166 
167 /** starts the current solving time
168  *
169  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
170  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
171  *
172  * @pre This method can be called if SCIP is in one of the following stages:
173  * - \ref SCIP_STAGE_PROBLEM
174  * - \ref SCIP_STAGE_TRANSFORMING
175  * - \ref SCIP_STAGE_TRANSFORMED
176  * - \ref SCIP_STAGE_INITPRESOLVE
177  * - \ref SCIP_STAGE_PRESOLVING
178  * - \ref SCIP_STAGE_EXITPRESOLVE
179  * - \ref SCIP_STAGE_PRESOLVED
180  * - \ref SCIP_STAGE_INITSOLVE
181  * - \ref SCIP_STAGE_SOLVING
182  * - \ref SCIP_STAGE_SOLVED
183  * - \ref SCIP_STAGE_EXITSOLVE
184  * - \ref SCIP_STAGE_FREETRANS
185  *
186  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
187  */
190  SCIP* scip /**< SCIP data structure */
191  );
192 
193 /** stops the current solving time in seconds
194  *
195  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
196  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
197  *
198  * @pre This method can be called if SCIP is in one of the following stages:
199  * - \ref SCIP_STAGE_PROBLEM
200  * - \ref SCIP_STAGE_TRANSFORMING
201  * - \ref SCIP_STAGE_TRANSFORMED
202  * - \ref SCIP_STAGE_INITPRESOLVE
203  * - \ref SCIP_STAGE_PRESOLVING
204  * - \ref SCIP_STAGE_EXITPRESOLVE
205  * - \ref SCIP_STAGE_PRESOLVED
206  * - \ref SCIP_STAGE_INITSOLVE
207  * - \ref SCIP_STAGE_SOLVING
208  * - \ref SCIP_STAGE_SOLVED
209  * - \ref SCIP_STAGE_EXITSOLVE
210  * - \ref SCIP_STAGE_FREETRANS
211  *
212  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
213  */
216  SCIP* scip /**< SCIP data structure */
217  );
218 
219 /** gets the measured time of a clock in seconds
220  *
221  * @return the measured time of a clock in seconds.
222  */
225  SCIP* scip, /**< SCIP data structure */
226  SCIP_CLOCK* clck /**< clock timer */
227  );
228 
229 /** sets the measured time of a clock to the given value in seconds
230  *
231  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
232  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
233  */
236  SCIP* scip, /**< SCIP data structure */
237  SCIP_CLOCK* clck, /**< clock timer */
238  SCIP_Real sec /**< time in seconds to set the clock's timer to */
239  );
240 
241 /** gets the current total SCIP time in seconds, possibly accumulated over several problems.
242  *
243  * @return the current total SCIP time in seconds, ie. the total time since the SCIP instance has been created
244  */
247  SCIP* scip /**< SCIP data structure */
248  );
249 
250 /** gets the current solving time in seconds
251  *
252  * @return the current solving time in seconds.
253  *
254  * @pre This method can be called if SCIP is in one of the following stages:
255  * - \ref SCIP_STAGE_PROBLEM
256  * - \ref SCIP_STAGE_TRANSFORMING
257  * - \ref SCIP_STAGE_TRANSFORMED
258  * - \ref SCIP_STAGE_INITPRESOLVE
259  * - \ref SCIP_STAGE_PRESOLVING
260  * - \ref SCIP_STAGE_EXITPRESOLVE
261  * - \ref SCIP_STAGE_PRESOLVED
262  * - \ref SCIP_STAGE_INITSOLVE
263  * - \ref SCIP_STAGE_SOLVING
264  * - \ref SCIP_STAGE_SOLVED
265  *
266  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
267  */
270  SCIP* scip /**< SCIP data structure */
271  );
272 
273 /** gets the current reading time in seconds
274  *
275  * @return the current reading time in seconds.
276  *
277  * @pre This method can be called if SCIP is in one of the following stages:
278  * - \ref SCIP_STAGE_PROBLEM
279  * - \ref SCIP_STAGE_TRANSFORMING
280  * - \ref SCIP_STAGE_TRANSFORMED
281  * - \ref SCIP_STAGE_INITPRESOLVE
282  * - \ref SCIP_STAGE_PRESOLVING
283  * - \ref SCIP_STAGE_EXITPRESOLVE
284  * - \ref SCIP_STAGE_PRESOLVED
285  * - \ref SCIP_STAGE_INITSOLVE
286  * - \ref SCIP_STAGE_SOLVING
287  * - \ref SCIP_STAGE_SOLVED
288  *
289  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
290  */
293  SCIP* scip /**< SCIP data structure */
294  );
295 
296 /** gets the current presolving time in seconds
297  *
298  * @return the current presolving time in seconds.
299  *
300  * @pre This method can be called if SCIP is in one of the following stages:
301  * - \ref SCIP_STAGE_INITPRESOLVE
302  * - \ref SCIP_STAGE_PRESOLVING
303  * - \ref SCIP_STAGE_EXITPRESOLVE
304  * - \ref SCIP_STAGE_PRESOLVED
305  * - \ref SCIP_STAGE_INITSOLVE
306  * - \ref SCIP_STAGE_SOLVING
307  * - \ref SCIP_STAGE_SOLVED
308  *
309  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
310  */
313  SCIP* scip /**< SCIP data structure */
314  );
315 
316 /** gets the time need to solve the first LP in the root node
317  *
318  * @return the solving time for the first LP in the root node in seconds.
319  *
320  * @pre This method can be called if SCIP is in one of the following stages:
321  * - \ref SCIP_STAGE_TRANSFORMING
322  * - \ref SCIP_STAGE_TRANSFORMED
323  * - \ref SCIP_STAGE_INITPRESOLVE
324  * - \ref SCIP_STAGE_PRESOLVING
325  * - \ref SCIP_STAGE_EXITPRESOLVE
326  * - \ref SCIP_STAGE_PRESOLVED
327  * - \ref SCIP_STAGE_INITSOLVE
328  * - \ref SCIP_STAGE_SOLVING
329  * - \ref SCIP_STAGE_SOLVED
330  *
331  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
332  */
335  SCIP* scip /**< SCIP data structure */
336  );
337 
338 /**@} */
339 
340 #ifdef __cplusplus
341 }
342 #endif
343 
344 #endif
SCIP_EXPORT SCIP_RETCODE SCIPresetClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip_timing.c:135
SCIP_EXPORT SCIP_RETCODE SCIPstopSolvingTime(SCIP *scip)
Definition: scip_timing.c:285
SCIP_EXPORT SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip_timing.c:67
#define SCIP_EXPORT
Definition: def.h:100
SCIP_EXPORT SCIP_Real SCIPgetReadingTime(SCIP *scip)
Definition: scip_timing.c:387
SCIP_EXPORT SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip_timing.c:360
SCIP_EXPORT SCIP_Real SCIPgetPresolvingTime(SCIP *scip)
Definition: scip_timing.c:424
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
type definitions for return codes for SCIP methods
SCIP_EXPORT SCIP_Real SCIPgetFirstLPTime(SCIP *scip)
Definition: scip_timing.c:450
SCIP_EXPORT SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip_timing.c:301
SCIP_EXPORT SCIP_RETCODE SCIPcreateCPUClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip_timing.c:84
SCIP_EXPORT SCIP_RETCODE SCIPenableOrDisableStatisticTiming(SCIP *scip)
Definition: scip_timing.c:209
type definitions for SCIP&#39;s main datastructure
SCIP_EXPORT SCIP_Real SCIPgetTotalTime(SCIP *scip)
Definition: scip_timing.c:333
SCIP_EXPORT SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip_timing.c:169
type definitions for clocks and timing issues
SCIP_EXPORT SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip_timing.c:118
#define SCIP_Real
Definition: def.h:163
SCIP_EXPORT SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip_timing.c:152
SCIP_EXPORT SCIP_Real SCIPgetTimeOfDay(SCIP *scip)
Definition: scip_timing.c:53
SCIP_EXPORT SCIP_RETCODE SCIPsetClockTime(SCIP *scip, SCIP_CLOCK *clck, SCIP_Real sec)
Definition: scip_timing.c:316
common defines and data types used in all packages of SCIP
SCIP_EXPORT SCIP_RETCODE SCIPcreateWallClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip_timing.c:101
SCIP_EXPORT SCIP_RETCODE SCIPstartSolvingTime(SCIP *scip)
Definition: scip_timing.c:252