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)
This commit is contained in:
Harmen Stoppels 2021-10-19 20:33:17 +02:00 committed by GitHub
parent bc99d8a2fd
commit e7c7f44bb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1141,10 +1141,14 @@ def _concretize_separately(self, tests=False):
# processes try to write the config file in parallel # processes try to write the config file in parallel
_ = spack.compilers.get_compiler_config() _ = 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 # Solve the environment in parallel on Linux
start = time.time() start = time.time()
max_processes = min( max_processes = min(
max(len(arguments), 1), # Number of specs len(arguments), # Number of specs
16 # Cap on 16 cores 16 # Cap on 16 cores
) )
@ -1161,7 +1165,7 @@ def _concretize_separately(self, tests=False):
) )
finish = time.time() finish = time.time()
tty.msg('Environment concretized in {0} sec.'.format(finish - start)) tty.msg('Environment concretized in %.2f seconds.' % (finish - start))
results = [] results = []
for abstract, concrete in zip(root_specs, concretized_root_specs): for abstract, concrete in zip(root_specs, concretized_root_specs):
self._add_concrete_spec(abstract, concrete) self._add_concrete_spec(abstract, concrete)