diff options
author | Julian Lettner <jlettner@apple.com> | 2019-10-16 23:25:46 +0000 |
---|---|---|
committer | Julian Lettner <jlettner@apple.com> | 2019-10-16 23:25:46 +0000 |
commit | 640d6de4293a2883513cc84c535bb7de9f882e1c (patch) | |
tree | 548b00bb9db731a085eb7c1d1d76310f2a2a8e7a | |
parent | bb98234931f94b2a1caa03ba22e35db4cbb0860d (diff) | |
download | bcm5719-llvm-640d6de4293a2883513cc84c535bb7de9f882e1c.tar.gz bcm5719-llvm-640d6de4293a2883513cc84c535bb7de9f882e1c.zip |
[lit] Do not create semaphores when we do not need them
Parallelism groups and semaphores are only required for parallel
execution.
llvm-svn: 375055
-rw-r--r-- | llvm/utils/lit/lit/run.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/utils/lit/lit/run.py b/llvm/utils/lit/lit/run.py index d08da9b11de..6d1cc7c9207 100644 --- a/llvm/utils/lit/lit/run.py +++ b/llvm/utils/lit/lit/run.py @@ -19,11 +19,6 @@ class Run(object): def __init__(self, lit_config, tests): self.lit_config = lit_config self.tests = tests - # Set up semaphores to limit parallelism of certain classes of tests. - self.parallelism_semaphores = { - k : NopSemaphore() if v is None else - multiprocessing.BoundedSemaphore(v) - for k, v in lit_config.parallelism_groups.items()} def execute_tests(self, progress_callback, workers, max_time): """ @@ -76,14 +71,18 @@ class Run(object): if max_time: deadline = time.time() + max_time + semaphores = { + k: NopSemaphore() if v is None else + multiprocessing.BoundedSemaphore(v) for k, v in + self.lit_config.parallelism_groups.items()} + # Start a process pool. Copy over the data shared between all test runs. # FIXME: Find a way to capture the worker process stderr. If the user # interrupts the workers before we make it into our task callback, they # will each raise a KeyboardInterrupt exception and print to stderr at # the same time. pool = multiprocessing.Pool(workers, lit.worker.initializer, - (self.lit_config, - self.parallelism_semaphores)) + (self.lit_config, semaphores)) # Install a console-control signal handler on Windows. if lit.util.win32api is not None: |