comparison mx/commands.py @ 4480:7d6490436b57

Add Scala DaCapo benchs
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 07 Feb 2012 15:59:29 +0100
parents 0312460af9fc
children 7903b6c28f9c
comparison
equal deleted inserted replaced
4476:00efac2934d3 4480:7d6490436b57
216 if not sanitycheck.getDacapo(test, n, dacapoArgs).test('graal', opts=vmOpts): 216 if not sanitycheck.getDacapo(test, n, dacapoArgs).test('graal', opts=vmOpts):
217 failed.append(test) 217 failed.append(test)
218 218
219 if len(failed) != 0: 219 if len(failed) != 0:
220 mx.abort('DaCapo failures: ' + str(failed)) 220 mx.abort('DaCapo failures: ' + str(failed))
221
222
223 def scaladacapo(args):
224 """run one or all Scala DaCapo benchmarks
225
226 Scala DaCapo options are distinguished from VM options by a '@' prefix.
227 For example, '@--iterations @5' will pass '--iterations 5' to the
228 DaCapo harness."""
229
230 numTests = {}
231
232 if len(args) > 0:
233 level = getattr(sanitycheck.SanityCheckLevel, args[0], None)
234 if level is not None:
235 del args[0]
236 for (bench, ns) in sanitycheck.dacapoScalaSanityWarmup.items():
237 if ns[level] > 0:
238 numTests[bench] = ns[level]
239 else:
240 while len(args) != 0 and args[0][0] not in ['-', '@']:
241 n = 1
242 if args[0].isdigit():
243 n = int(args[0])
244 assert len(args) > 1 and args[1][0] not in ['-', '@'] and not args[1].isdigit()
245 bm = args[1]
246 del args[0]
247 else:
248 bm = args[0]
249
250 del args[0]
251 if bm not in sanitycheck.dacapoScalaSanityWarmup.keys():
252 mx.abort('unknown benchmark: ' + bm + '\nselect one of: ' + str(sanitycheck.dacapoScalaSanityWarmup.keys()))
253 numTests[bm] = n
254
255 if len(numTests) is 0:
256 for bench in sanitycheck.dacapoScalaSanityWarmup.keys():
257 numTests[bench] = 1
258
259 # Extract DaCapo options
260 dacapoArgs = [(arg[1:]) for arg in args if arg.startswith('@')]
261
262 # The remainder are VM options
263 vmOpts = [arg for arg in args if not arg.startswith('@')]
264
265 failed = []
266 for (test, n) in numTests.items():
267 if not sanitycheck.getScalaDacapo(test, n, dacapoArgs).test('graal', opts=vmOpts):
268 failed.append(test)
269
270 if len(failed) != 0:
271 mx.abort('Scala DaCapo failures: ' + str(failed))
221 272
222 def _jdk(build='product', create=False): 273 def _jdk(build='product', create=False):
223 """ 274 """
224 Get the JDK into which Graal is installed, creating it first if necessary. 275 Get the JDK into which Graal is installed, creating it first if necessary.
225 """ 276 """
569 dacapos = [a[7:] for a in args if a.startswith('dacapo:')] 620 dacapos = [a[7:] for a in args if a.startswith('dacapo:')]
570 for dacapo in dacapos: 621 for dacapo in dacapos:
571 if dacapo not in sanitycheck.dacapoSanityWarmup.keys(): 622 if dacapo not in sanitycheck.dacapoSanityWarmup.keys():
572 mx.abort('Unknown dacapo : ' + dacapo) 623 mx.abort('Unknown dacapo : ' + dacapo)
573 benchmarks += [sanitycheck.getDacapo(dacapo, sanitycheck.dacapoSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark])] 624 benchmarks += [sanitycheck.getDacapo(dacapo, sanitycheck.dacapoSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark])]
625
626 if ('scaladacapo' in args or 'all' in args):
627 benchmarks += sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Benchmark)
628 else:
629 dacapos = [a[7:] for a in args if a.startswith('scaladacapo:')]
630 for dacapo in dacapos:
631 if dacapo not in sanitycheck.dacapoScalaSanityWarmup.keys():
632 mx.abort('Unknown dacapo : ' + dacapo)
633 benchmarks += [sanitycheck.getScalaDacapo(dacapo, sanitycheck.dacapoScalaSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark])]
574 634
575 #Bootstrap 635 #Bootstrap
576 if ('bootstrap' in args or 'all' in args): 636 if ('bootstrap' in args or 'all' in args):
577 benchmarks += sanitycheck.getBootstraps() 637 benchmarks += sanitycheck.getBootstraps()
578 #SPECjvm2008 638 #SPECjvm2008
602 commands = { 662 commands = {
603 'build': [build, '[-options]'], 663 'build': [build, '[-options]'],
604 'clean': [clean, ''], 664 'clean': [clean, ''],
605 'copyrightcheck': [copyrightcheck, ''], 665 'copyrightcheck': [copyrightcheck, ''],
606 'dacapo': [dacapo, '[[n] benchmark] [VM options|@DaCapo options]'], 666 'dacapo': [dacapo, '[[n] benchmark] [VM options|@DaCapo options]'],
607 'specjvm2008': [specjvm2008, ''], 667 'scaladacapo': [scaladacapo, '[[n] benchmark] [VM options|@Scala DaCapo options]'],
668 'specjvm2008': [specjvm2008, '[VM options|@specjvm2008 options]'],
608 'example': [example, '[-v] example names...'], 669 'example': [example, '[-v] example names...'],
609 'gate' : [gate, ''], 670 'gate' : [gate, ''],
610 'bench' : [bench, '[-vm vm] [-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'], 671 'bench' : [bench, '[-vm vm] [-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'],
611 'unittest' : [unittest, '[filters...]'], 672 'unittest' : [unittest, '[filters...]'],
612 'vm': [vm, '[-options] class [args...]'] 673 'vm': [vm, '[-options] class [args...]']