Commit ddbe0e7b authored by Lukas Werner's avatar Lukas Werner
Browse files

Update benchmark.py

parent a118633f
Pipeline #351508 failed with stages
in 6 minutes and 20 seconds
......@@ -11,8 +11,8 @@ import shlex
import re
class MeasureMESAPD:
def __init__(self, numCores, buildFolder):
self.numCores = numCores
def __init__(self, availableCores, buildFolder):
self.availableCores = availableCores
self.buildFolder = buildFolder
self.benchmarkFolder = os.path.join(buildFolder, 'apps', 'benchmarks', 'GranularGas')
......@@ -23,9 +23,11 @@ class MeasureMESAPD:
def measureKernel(self):
json_body = []
numCores = min(8, self.availableCores)
kernelbenchmark_exec = os.path.join(self.benchmarkFolder, 'MESA_PD_KernelBenchmark')
kernelbenchmark_config = os.path.join(self.benchmarkFolder, 'MESA_PD_Benchmark.cfg')
kernelbenchmark_cmd = 'mpirun --use-hwthread-cpus -np '+str(self.numCores)+' '+kernelbenchmark_exec+' '+kernelbenchmark_config
kernelbenchmark_cmd = 'mpirun -np '+str(numCores)+' '+kernelbenchmark_exec+' '+kernelbenchmark_config
print(kernelbenchmark_cmd)
start = time.time()
......@@ -66,7 +68,8 @@ class MeasureMESAPD:
'benchmark': 'MESA_PD_KernelBenchmark'
},
'fields': {
'run_time': run_time
'run_time': run_time,
'num_cores': numCores
}
}
]
......@@ -76,9 +79,11 @@ class MeasureMESAPD:
def measureGranularGas(self):
json_body = []
numCores = min(8, self.availableCores)
granulargas_exec = os.path.join(self.benchmarkFolder, 'MESA_PD_GranularGas')
granulargas_config = os.path.join(self.benchmarkFolder, 'GranularGas.cfg')
granulargas_cmd = 'mpirun --use-hwthread-cpus -np '+str(self.numCores)+' '+granulargas_exec+' '+granulargas_config
granulargas_cmd = 'mpirun -np '+str(numCores)+' '+granulargas_exec+' '+granulargas_config
print(granulargas_cmd)
start = time.time()
......@@ -100,7 +105,8 @@ class MeasureMESAPD:
'benchmark': 'MESA_PD_GranularGas'
},
'fields': {
'run_time': run_time
'run_time': run_time,
'num_cores': numCores
}
}
]
......@@ -145,7 +151,6 @@ def main():
for measurement in json_body:
measurement['time'] = point_time
measurement['fields']['commit'] = commit.hexsha
measurement['fields']['num_cores'] = numCores
measurement['tags']['host'] = host
#print(json_body)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment