[Piglit] [PATCH] Allow one 'non-concurrent' test to run in parallel with concurrent tests again

Jason Ekstrand jason at jlekstrand.net
Wed Aug 20 13:42:10 PDT 2014


On Aug 19, 2014 8:13 PM, "Michel Dänzer" <michel at daenzer.net> wrote:
>
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> This reverts commit acb824ddc53c446124d88e37db610a4f8c59d56c.
>
> This decreases the runtime of the gpu.py profile from around 15 minutes to
> around 12 minutes on my machine, with no change in results.

Do you use a compositing window manager?  If so, then each window gets its
own front buffer and you can use the -c option and run all the tests in
parallel without problems.  If you are not running a compositor then there
could be a problem if the concurrent test pops up a window on top of the
non-concurrent test.  In this case the concurrent test's window would
destroy the front buffer of the nom-concurrent test.

This will only work if we can guarantee that the non-concurrent test
doesn't pop up any windows.

--Jason Ekstrand
>
> If in the future there are tests which really can't run in parallel with
any
> other tests, a new category should be added for them.
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>  framework/profile.py | 29 +++++++++++++++--------------
>  1 file changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/framework/profile.py b/framework/profile.py
> index 5428890..1bb2b50 100644
> --- a/framework/profile.py
> +++ b/framework/profile.py
> @@ -189,8 +189,6 @@ class TestProfile(object):
>          self._pre_run_hook()
>          framework.exectest.Test.OPTS = opts
>
> -        chunksize = 1
> -
>          self._prepare_test_list(opts)
>          log = Log(len(self.test_list), opts.verbose)
>
> @@ -203,30 +201,33 @@ class TestProfile(object):
>              name, test = pair
>              test.execute(name, log, json_writer, self.dmesg)
>
> -        def run_threads(pool, testlist):
> -            """ Open a pool, close it, and join it """
> -            pool.imap(test, testlist, chunksize)
> -            pool.close()
> -            pool.join()
> -
>          # Multiprocessing.dummy is a wrapper around Threading that
provides a
>          # multiprocessing compatible API
>          #
>          # The default value of pool is the number of virtual processor
cores
>          single = multiprocessing.dummy.Pool(1)
>          multi = multiprocessing.dummy.Pool()
> +        chunksize = 1
>
>          if opts.concurrent == "all":
> -            run_threads(multi, self.test_list.iteritems())
> +            multi.imap(test, self.test_list.iteritems(), chunksize)
>          elif opts.concurrent == "none":
> -            run_threads(single, self.test_list.iteritems())
> +            single.imap(test, self.test_list.iteritems(), chunksize)
>          else:
>              # Filter and return only thread safe tests to the threaded
pool
> -            run_threads(multi, (x for x in self.test_list.iteritems()
> -                                if x[1].run_concurrent))
> +            multi.imap(test, (x for x in self.test_list.iteritems()
> +                              if x[1].run_concurrent), chunksize)
>              # Filter and return the non thread safe tests to the single
pool
> -            run_threads(single, (x for x in self.test_list.iteritems()
> -                                 if not x[1].run_concurrent))
> +            single.imap(test, (x for x in self.test_list.iteritems()
> +                               if not x[1].run_concurrent), chunksize)
> +
> +        # Close and join the pools
> +        # If we don't close and the join the pools the script will exit
before
> +        # the pools finish running
> +        multi.close()
> +        single.close()
> +        multi.join()
> +        single.join()
>
>          log.summary()
>
> --
> 2.1.0
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140820/54552200/attachment.html>


More information about the Piglit mailing list