Inlined llnl.util.multiproc.execute (abstraction was not very useful)

This commit is contained in:
Massimiliano Culpo 2019-01-08 11:09:06 +01:00
parent 675f944a3a
commit 477ce206c2
No known key found for this signature in database
GPG Key ID: D1ADB1014FF1118C
2 changed files with 1 additions and 22 deletions

View File

@ -32,26 +32,6 @@ def _deferred_call():
return _impl
def invoke(f):
return f()
def execute(command_list, map_fn=map, transformation=invoke):
"""Execute a list of packaged commands and return their result.
Args:
command_list: list of commands to be executed
map_fn: object that execute each command. Must have the
same semantic as ``map``
transformation: callable invoked on each item to construct
the output list
Returns:
List of results
"""
return map_fn(transformation, command_list)
class Barrier:
"""Simple reusable semaphore barrier.

View File

@ -9,7 +9,6 @@
import multiprocessing.pool
import os
import llnl.util.multiproc
from llnl.util.lang import list_modules
import spack.paths
@ -196,7 +195,7 @@ def find_compilers(*paths):
tags.extend(t), commands.extend(c)
tp = multiprocessing.pool.ThreadPool()
compiler_versions = llnl.util.multiproc.execute(commands, tp.map)
compiler_versions = tp.map(lambda x: x(), commands)
tp.close()
return spack.compiler.make_compiler_list(tags, compiler_versions)