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

Marek Olšák maraeo at gmail.com
Thu Aug 21 01:57:54 PDT 2014


Hi Michel,

I recommend using the -c option. It will force concurrency for all
tests. With that, I don't care which tests aren't concurrent by
default.

Marek

On Wed, Aug 20, 2014 at 5:13 AM, 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.
>
> 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


More information about the Piglit mailing list