|
20 | 20 | # or visit www.oracle.com if you need additional information or have any
|
21 | 21 | # questions.
|
22 | 22 | #
|
23 |
| - |
24 |
| -import argparse |
25 |
| - |
26 | 23 | import mx
|
27 | 24 | import mx_benchmark
|
28 | 25 | import mx_espresso
|
29 | 26 |
|
30 | 27 | from mx_benchmark import GuestVm, JavaVm
|
31 |
| -from mx_sdk_benchmark import ScalaDaCapoBenchmarkSuite |
32 | 28 | from mx_sdk_benchmark import _daCapoScalaConfig
|
33 | 29 |
|
34 | 30 |
|
@@ -187,71 +183,3 @@ def warmupIterations(startup=None, earlyWarmup=None, lateWarmup=None):
|
187 | 183 | "specs" : warmupIterations(1, 1 + _daCapoScalaConfig["specs"] // 3, _daCapoScalaConfig["specs"]),
|
188 | 184 | "tmt" : warmupIterations(1, 1 + _daCapoScalaConfig["tmt"] // 3, _daCapoScalaConfig["tmt"]),
|
189 | 185 | }
|
190 |
| - |
191 |
| -class ScalaDaCapoWarmupBenchmarkSuite(ScalaDaCapoBenchmarkSuite): #pylint: disable=too-many-ancestors |
192 |
| - """Scala DaCapo (warmup) benchmark suite implementation.""" |
193 |
| - |
194 |
| - def daCapoPath(self): |
195 |
| - return mx.distribution("DACAPO_SCALA_WARMUP").path |
196 |
| - |
197 |
| - def name(self): |
198 |
| - return "scala-dacapo-warmup" |
199 |
| - |
200 |
| - def warmupResults(self, results, warmupIterations, metricName="cumulative-warmup"): |
201 |
| - """ |
202 |
| - Postprocess results to add new entries for specific iterations. |
203 |
| - """ |
204 |
| - benchmarkNames = {r["benchmark"] for r in results} |
205 |
| - for benchmark in benchmarkNames: |
206 |
| - if benchmark in warmupIterations: |
207 |
| - entries = [result for result in results if result["metric.name"] == metricName and result["benchmark"] == benchmark] |
208 |
| - if entries: |
209 |
| - for entry in entries: |
210 |
| - for key, iteration in warmupIterations[benchmark].items(): |
211 |
| - if entry["metric.iteration"] == iteration - 1: # scala_dacapo_warmup_iterations is 1-based, JSON output is 0-based |
212 |
| - newEntry = entry.copy() |
213 |
| - newEntry["metric.name"] = key |
214 |
| - results.append(newEntry) |
215 |
| - |
216 |
| - def rules(self, out, benchmarks, bmSuiteArgs): |
217 |
| - super_rules = super(ScalaDaCapoWarmupBenchmarkSuite, self).rules(out, benchmarks, bmSuiteArgs) |
218 |
| - return super_rules + [ |
219 |
| - mx_benchmark.StdOutRule( |
220 |
| - r"===== DaCapo (?P<version>\S+) (?P<benchmark>[a-zA-Z0-9_]+) walltime [0-9]+ : (?P<time>[0-9]+) msec =====", # pylint: disable=line-too-long |
221 |
| - { |
222 |
| - "benchmark": ("<benchmark>", str), |
223 |
| - "bench-suite": self.benchSuiteName(), |
224 |
| - "vm": "jvmci", |
225 |
| - "config.name": "default", |
226 |
| - "config.vm-flags": self.shorten_vm_flags(self.vmArgs(bmSuiteArgs)), |
227 |
| - "metric.name": "walltime", |
228 |
| - "metric.value": ("<time>", int), |
229 |
| - "metric.unit": "ms", |
230 |
| - "metric.type": "numeric", |
231 |
| - "metric.score-function": "id", |
232 |
| - "metric.better": "lower", |
233 |
| - "metric.iteration": ("$iteration", int) |
234 |
| - } |
235 |
| - ) |
236 |
| - ] |
237 |
| - |
238 |
| - def postprocessRunArgs(self, benchname, runArgs): |
239 |
| - parser = argparse.ArgumentParser(add_help=False) |
240 |
| - parser.add_argument("-n", default=None) |
241 |
| - args, remaining = parser.parse_known_args(runArgs) |
242 |
| - result = ['-c', 'WallTimeCallback'] + remaining |
243 |
| - if args.n: |
244 |
| - if args.n.isdigit(): |
245 |
| - result = ["-n", args.n] + result |
246 |
| - else: |
247 |
| - iterations = scala_dacapo_warmup_iterations[benchname]["late-warmup"] |
248 |
| - result = ["-n", str(iterations)] + result |
249 |
| - return result |
250 |
| - |
251 |
| - def run(self, benchmarks, bmSuiteArgs): |
252 |
| - results = super(ScalaDaCapoWarmupBenchmarkSuite, self).run(benchmarks, bmSuiteArgs) |
253 |
| - self.warmupResults(results, scala_dacapo_warmup_iterations, 'walltime') |
254 |
| - # walltime entries are not accepted by the bench server |
255 |
| - return [e for e in results if e["metric.name"] != "walltime"] |
256 |
| - |
257 |
| -mx_benchmark.add_bm_suite(ScalaDaCapoWarmupBenchmarkSuite()) |
0 commit comments