smarr/ReBench

Make invocation number accessible in command line.

smarr opened this issue · 2 comments

smarr commented

Currently we allow access to the set number of iterations in the command line, and can say command: Harness -i=%(iterations)s, we can't do the same for invocations since that doesn't really make sense.

But, sometimes it would be useful to have the current invocation number like command: Harness -i=%(invocation)s to have a counter, perhaps because the benchmark generates some output and it's easier to handle if things go into numbered files.

smarr commented

run_id identity?

That's not a problem if we replace the format string with itself during the first string interpolation:

>>> s = "1234--%(inv)s--%(bar)s--4321"
>>> s % {'bar': 66, 'inv': '%(inv)s'}
'1234--%(inv)s--66--4321'
>>> s % {'bar': 66, 'inv': '%(inv)s'} % {'inv': 4}
'1234--4--66--4321'