summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2021-10-19 20:33:17 +0200
committerGitHub <noreply@github.com>2021-10-19 18:33:17 +0000
commite7c7f44bb634c5cde0c6cb049bfde5e17b4d6dc1 (patch)
tree86a796d1f1cd23911efbe3343b1bdd88d4c7445a /lib
parentbc99d8a2fd988c34ea7a5c7d6c462977d918a633 (diff)
downloadspack-e7c7f44bb634c5cde0c6cb049bfde5e17b4d6dc1.tar.gz
spack-e7c7f44bb634c5cde0c6cb049bfde5e17b4d6dc1.tar.bz2
spack-e7c7f44bb634c5cde0c6cb049bfde5e17b4d6dc1.tar.xz
spack-e7c7f44bb634c5cde0c6cb049bfde5e17b4d6dc1.zip
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)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/environment/environment.py8
1 files 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)