From e7c7f44bb634c5cde0c6cb049bfde5e17b4d6dc1 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Tue, 19 Oct 2021 20:33:17 +0200 Subject: Reduce verbosity of threaded concretization (#26822) 1. Don't use 16 digits of precision for the seconds, round to 2 digits after the comma 2. Don't print if we don't concretize (i.e. `spack concretize` without `-f` doesn't have to tell me it did nothing in `0.00` seconds) --- lib/spack/spack/environment/environment.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py index 5fce76118c..b818f33a7c 100644 --- a/lib/spack/spack/environment/environment.py +++ b/lib/spack/spack/environment/environment.py @@ -1141,10 +1141,14 @@ class Environment(object): # processes try to write the config file in parallel _ = spack.compilers.get_compiler_config() + # Early return if there is nothing to do + if len(arguments) == 0: + return [] + # Solve the environment in parallel on Linux start = time.time() max_processes = min( - max(len(arguments), 1), # Number of specs + len(arguments), # Number of specs 16 # Cap on 16 cores ) @@ -1161,7 +1165,7 @@ class Environment(object): ) finish = time.time() - tty.msg('Environment concretized in {0} sec.'.format(finish - start)) + tty.msg('Environment concretized in %.2f seconds.' % (finish - start)) results = [] for abstract, concrete in zip(root_specs, concretized_root_specs): self._add_concrete_spec(abstract, concrete) -- cgit v1.2.3-60-g2f50