From ec1117a898ae6f6eeec2aa2567fac6bf657e1174 Mon Sep 17 00:00:00 2001 From: Daejun Park Date: Wed, 20 Nov 2024 15:15:21 -0800 Subject: [PATCH] add --no-pulse flag to disable --- src/halmos/__main__.py | 21 +++++++++++---------- src/halmos/config.py | 6 ++++++ src/halmos/sevm.py | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/halmos/__main__.py b/src/halmos/__main__.py index 0f110b87..4c9fa159 100644 --- a/src/halmos/__main__.py +++ b/src/halmos/__main__.py @@ -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) diff --git a/src/halmos/config.py b/src/halmos/config.py index 6d4a796a..3e6d366b 100644 --- a/src/halmos/config.py +++ b/src/halmos/config.py @@ -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, diff --git a/src/halmos/sevm.py b/src/halmos/sevm.py index 98cc2e72..8442a2a1 100644 --- a/src/halmos/sevm.py +++ b/src/halmos/sevm.py @@ -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