Skip to content

Commit

Permalink
Centralizing timers in profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevendeo committed Oct 5, 2023
1 parent 4176382 commit b94c7ff
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 77 deletions.
11 changes: 2 additions & 9 deletions src/bin/common/signals_profiling.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@

open AltErgoLib

let timers = Timers.empty ()

let get_timers () = timers

let init_sigterm_6 () =
(* what to do with Ctrl+C ? *)
Sys.set_signal Sys.sigint(*-6*)
Expand All @@ -58,7 +54,7 @@ let init_sigterm_11_9 () =
(Sys.Signal_handle
(fun _ ->
Profiling.print true (Steps.get_steps ())
timers (Options.Output.get_fmt_diagnostic ());
(Options.Output.get_fmt_diagnostic ());
exit 1
)
)
Expand All @@ -71,7 +67,7 @@ let init_sigterm_21 () =
Sys.set_signal Sys.sigprof (*-21*)
(Sys.Signal_handle
(fun _ ->
Profiling.print false (Steps.get_steps ()) timers
Profiling.print false (Steps.get_steps ())
(Options.Output.get_fmt_diagnostic ());
)
)
Expand All @@ -84,10 +80,7 @@ let init_sigalarm () =

let init_profiling () =
if Options.get_profiling () then begin
Timers.reset timers;
assert (Options.get_timers());
Timers.set_timer_start (Timers.start timers);
Timers.set_timer_pause (Timers.pause timers);
Profiling.init ();
end

Expand Down
3 changes: 0 additions & 3 deletions src/bin/common/signals_profiling.mli
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
(* *)
(**************************************************************************)

(** Return a timer *)
val get_timers : unit -> AltErgoLib.Timers.t

(** Initialise signals handler for system signals *)
val init_signals : unit -> unit

Expand Down
1 change: 0 additions & 1 deletion src/bin/common/solving_loop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ let main () =
if Options.get_profiling() then
Profiling.print true
(Steps.get_steps ())
(Signals_profiling.get_timers ())
(Options.Output.get_fmt_diagnostic ());
(* If the status of the SAT environment is inconsistent,
we have to drop the partial model in order to prevent
Expand Down
Loading

0 comments on commit b94c7ff

Please sign in to comment.