@@ -352,13 +352,7 @@ def with_host_vm(self, host_vm):
352352 return self .__class__ (self .config_name (), self ._options , host_vm )
353353
354354 def run (self , cwd , args ):
355- ## patch host-vm name
356- name = self .host_vm .name ()
357- name = name .replace ("graalvm-ce-python" , "graalvm-ce" )
358- name = name .replace ("graalvm-ee-python" , "graalvm-ee" )
359- type(host_vm ).name = lambda s : name
360-
361- for idx ,arg in enumerate (args ):
355+ for idx , arg in enumerate (args ):
362356 if "--vm.Xmx" in arg :
363357 mx .log (f"Setting Xmx from { arg } " )
364358 break
@@ -392,14 +386,16 @@ def run(self, cwd, args):
392386 env = os .environ .copy ()
393387 xmxArg = re .compile ("--vm.Xmx([0-9]+)([kKgGmM])" )
394388 pypyGcMax = "8GB"
395- for idx ,arg in enumerate (args ):
389+ for idx , arg in enumerate (args ):
396390 if m := xmxArg .search (arg ):
397- args = args [:idx ] + args [idx + 1 :]
391+ args = args [:idx ] + args [idx + 1 :]
398392 pypyGcMax = f"{ m .group (1 )} { m .group (2 ).upper ()} B"
399393 mx .log (f"Setting PYPY_GC_MAX={ pypyGcMax } via { arg } " )
400394 break
401395 else :
402- mx .log (f"Setting PYPY_GC_MAX={ pypyGcMax } , use --vm.Xmx argument to override it" )
396+ mx .log (
397+ f"Setting PYPY_GC_MAX={ pypyGcMax } , use --vm.Xmx argument to override it"
398+ )
403399 env ["PYPY_GC_MAX" ] = pypyGcMax
404400 return mx .run ([self .interpreter ()] + args , cwd = cwd , env = env )
405401
@@ -424,10 +420,10 @@ def interpreter(self):
424420 return join (home , "bin" , "python" )
425421
426422 def run (self , cwd , args ):
427- for idx ,arg in enumerate (args ):
423+ for idx , arg in enumerate (args ):
428424 if "--vm.Xmx" in arg :
429425 mx .warn (f"Ignoring { arg } , cannot restrict memory on CPython." )
430- args = args [:idx ] + args [idx + 1 :]
426+ args = args [:idx ] + args [idx + 1 :]
431427 break
432428 return mx .run ([self .interpreter ()] + args , cwd = cwd )
433429
@@ -447,9 +443,23 @@ def __iter__(self):
447443 )
448444
449445
450- class PyPerformanceSuite (
451- mx_benchmark .TemporaryWorkdirMixin , mx_benchmark .VmBenchmarkSuite
452- ):
446+ class PySuite (mx_benchmark .TemporaryWorkdirMixin , mx_benchmark .VmBenchmarkSuite ):
447+ def runAndReturnStdOut (self , benchmarks , bmSuiteArgs ):
448+ ret_code , out , dims = super ().runAndReturnStdOut (benchmarks , bmSuiteArgs )
449+
450+ def _replace_host_vm (old , new ):
451+ host_vm = dims .get ("host-vm" )
452+ if host_vm and old in host_vm :
453+ dims ['host-vm' ] = host_vm .replace (old , new )
454+ mx .logv (f"[DEBUG] replace 'host-vm': '{ host_vm } ' -> '{ dims ['host-vm' ]} '" )
455+
456+ _replace_host_vm ('graalvm-ce-python' , 'graalvm-ce' )
457+ _replace_host_vm ('graalvm-ee-python' , 'graalvm-ee' )
458+
459+ return ret_code , out , dims
460+
461+
462+ class PyPerformanceSuite (PySuite ):
453463 VERSION = "1.0.5"
454464
455465 def name (self ):
@@ -513,7 +523,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
513523 return 0 , join (workdir , json_file )
514524
515525
516- class PyPySuite (mx_benchmark . TemporaryWorkdirMixin , mx_benchmark . VmBenchmarkSuite ):
526+ class PyPySuite (PySuite ):
517527 VERSION = "0324a252cf1a"
518528
519529 def name (self ):
@@ -594,7 +604,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
594604 return 0 , join (workdir , json_file )
595605
596606
597- class NumPySuite (mx_benchmark . TemporaryWorkdirMixin , mx_benchmark . VmBenchmarkSuite ):
607+ class NumPySuite (PySuite ):
598608 VERSION = "v1.16.4"
599609 ASV = "0.5.1"
600610 VIRTUALENV = "20.16.3"
0 commit comments