public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: "Ser, Simon" <simon.ser@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] benchmarks/gem_wsim: Randomise random seed
Date: Fri, 17 May 2019 13:59:40 +0100	[thread overview]
Message-ID: <f168add9-199d-5670-c4dc-f0ec28914c0e@linux.intel.com> (raw)
In-Reply-To: <d3a0ad3da08f7cb2d73a117efee8c446e8498a40.camel@intel.com>


On 17/05/2019 11:55, Ser, Simon wrote:
> On Thu, 2019-05-16 at 19:58 +0100, Chris Wilson wrote:
>> To avoid hitting the same rut on each benchmark run, start with a new
>> random seed. To allow hitting the same rut again, let it be specified
>> by the user.
>>
>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>>   benchmarks/gem_wsim.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
>> index 48568ce40..cf2a44746 100644
>> --- a/benchmarks/gem_wsim.c
>> +++ b/benchmarks/gem_wsim.c
>> @@ -2282,8 +2282,9 @@ int main(int argc, char **argv)
>>   	igt_require(fd);
>>   
>>   	init_clocks();
>> +	srand(time(NULL));
> 
> Maybe the seed used for the run should be printed to stderr, so that's
> it's easy to re-run a failure?

Sounds right. But I wouldn't say stderr and would make it conditional on 
verbosity level:

if (verbose)
	printf(...)

Chris, would you like me to take over this jobby of fixing and improving 
random seeding/handling? If you got too much on your plate..

Regards,

Tvrtko

> 
>> -	while ((c = getopt(argc, argv, "hqv2RSHxGdc:n:r:w:W:a:t:b:p:")) != -1) {
>> +	while ((c = getopt(argc, argv, "hqv2RSHxGdc:n:r:w:W:a:t:b:p:s:")) != -1) {
>>   		switch (c) {
>>   		case 'W':
>>   			if (master_workload >= 0) {
>> @@ -2300,6 +2301,9 @@ int main(int argc, char **argv)
>>   		case 'p':
>>   			prio = atoi(optarg);
>>   			break;
>> +		case 's':
>> +			srand(atoi(optarg));
>> +			break;
>>   		case 'a':
>>   			if (append_workload_arg) {
>>   				if (verbose)
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2019-05-17 12:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16 18:58 [igt-dev] [PATCH i-g-t] benchmarks/gem_wsim: Randomise random seed Chris Wilson
2019-05-16 19:37 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-05-17  1:50 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-05-17  8:28 ` [igt-dev] [Intel-gfx] [PATCH i-g-t] " Tvrtko Ursulin
2019-05-17  8:37   ` Chris Wilson
2019-05-17 10:32     ` Tvrtko Ursulin
2019-05-17 10:55 ` [igt-dev] " Ser, Simon
2019-05-17 12:59   ` Tvrtko Ursulin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f168add9-199d-5670-c4dc-f0ec28914c0e@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=simon.ser@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox