Skip to content

Commit

Permalink
add --no-pulse flag to disable
Browse files Browse the repository at this point in the history
  • Loading branch information
daejunpark committed Nov 20, 2024
1 parent c0785fd commit ec1117a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
21 changes: 11 additions & 10 deletions src/halmos/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,16 +735,17 @@ def future_callback(future_model):
)

# display assertion solving progress
with Status("solving:") as status:
while True:
if args.early_exit and len(counterexamples) > 0:
break
done = sum(fm.done() for fm in future_models)
total = len(future_models)
if done == total:
break
status.update(f"solving: {done} / {total}")
time.sleep(1)
if not args.no_pulse or args.early_exit:
with Status("solving:") as status:
while True:
if args.early_exit and len(counterexamples) > 0:
break
done = sum(fm.done() for fm in future_models)
total = len(future_models)
if done == total:
break
status.update(f"solving: {done} / {total}")
time.sleep(1)

if args.early_exit:
thread_pool.shutdown(wait=False, cancel_futures=True)
Expand Down
6 changes: 6 additions & 0 deletions src/halmos/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,12 @@ class Config:
short="st",
)

no_pulse: bool = arg(
help="disable progress display",
global_default=False,
group=debugging,
)

debug: bool = arg(
help="run in debug mode",
global_default=False,
Expand Down
2 changes: 1 addition & 1 deletion src/halmos/sevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2667,7 +2667,7 @@ def finalize(ex: Exec):
step_id += 1

# display progress
if step_id % PULSE_INTERVAL == 0:
if not self.options.no_pulse and step_id % PULSE_INTERVAL == 0:
elapsed = timer() - stack.start_time
speed = step_id / elapsed

Expand Down

0 comments on commit ec1117a

Please sign in to comment.