Merge branch 'gsoc2022-isosurface' of https://github.com/JulyCode/cgal into gsoc2022-isosurface

This commit is contained in:
Daniel Zint 2022-09-13 17:49:46 +02:00
commit 24572ba783
4 changed files with 51 additions and 17 deletions

View File

@ -267,4 +267,6 @@ int main(int argc, char* argv[]) {
}
std::cout << "internal timer: " << ms << std::endl;
std::cout << "internal polygons: " << polygons.size() << std::endl;
std::cout << "internal points: " << points.size() << std::endl;
}

View File

@ -1,12 +1,12 @@
from benchmark_util import *
scenario = "SCENARIO_GRID_SPHERE"
kernel = "KERNEL_SIMPLE_CARTESIAN_FLOAT"
algorithm = "ALGO_DUAL_CONTOURING"
scenario = "SCENARIO_IMPLICIT_IWP"
kernel = "KERNEL_SIMPLE_CARTESIAN_DOUBLE"
algorithm = "ALGO_MARCHING_CUBES"
tag = "TAG_SEQUENTIAL"
threads = 1
exponent = 1.2
min_cells = 1000000
min_cells = 100000
max_cells = 100000000
build(scenario, kernel, algorithm, tag)
@ -17,11 +17,11 @@ c = min_cells
while c < max_cells:
n = int(c ** (1.0 / 3.0))
time = execute(n, threads)
data.append([scenario, kernel, algorithm, tag, threads, int(c), time])
res = execute(n, threads, 5)
data.append([scenario, kernel, algorithm, tag, threads, int(c), res["time"], res["polygons"], res["points"]])
c *= exponent
df = pd.DataFrame(data, columns=["scenario", "kernel", "algorithm", "tag", "threads", "cells", "time"])
df = pd.DataFrame(data, columns=["scenario", "kernel", "algorithm", "tag", "threads", "cells", "time", "polygons", "points"])
df.to_csv("benchmark_size.csv")

View File

@ -1,12 +1,12 @@
from benchmark_util import *
scenario = "SCENARIO_IMPLICIT_SPHERE"
scenario = "SCENARIO_IMPLICIT_IWP"
kernel = "KERNEL_SIMPLE_CARTESIAN_DOUBLE"
algorithm = "ALGO_MARCHING_CUBES"
tag = "TAG_PARALLEL"
min_threads = 1
max_threads = 12
n = 300
max_threads = 26
n = 500
cells = n ** 3
build(scenario, kernel, algorithm, tag)
@ -14,10 +14,10 @@ build(scenario, kernel, algorithm, tag)
data = []
for t in range(min_threads, max_threads):
time = execute(n, t)
res = execute(n, t, times=5)
data.append([scenario, kernel, algorithm, tag, t, cells, time])
data.append([scenario, kernel, algorithm, tag, t, cells, res["time"], res["bandwidth"]])
df = pd.DataFrame(data, columns=["scenario", "kernel", "algorithm", "tag", "threads", "cells", "time"])
df = pd.DataFrame(data, columns=["scenario", "kernel", "algorithm", "tag", "threads", "cells", "time", "bandwidth"])
df.to_csv("benchmark_threads.csv")

View File

@ -27,15 +27,47 @@ def build(scenario, kernel, algorithm, tag):
run(["make", "-C", "build"])
def execute(n, threads, times=1):
time = 0
measurements = {"time" : 0, "polygons" : 0, "points" : 0, "bandwidth" : 0, "transfer" : 0, "performance" : 0, "clock" : 0, "intensity" : 0}
for i in range(times):
process = run(["likwid-perfctr", "-g", "MEM_DP", "-C", "S0:0-" + str(threads - 1), "./build/benchmark", "-N", str(n)], False)
for line in process.stdout.readlines():
print(line, end='')
m = re.search(r'internal timer:\s*(\d*)', line)
m = re.search(r'internal timer:\s*(\d+)', line)
if m is not None:
time += int(m.group(1))
measurements["time"] += int(m.group(1))
m = re.search(r'internal polygons:\s*(\d+)', line)
if m is not None:
measurements["polygons"] += int(m.group(1))
m = re.search(r'internal points:\s*(\d+)', line)
if m is not None:
measurements["points"] += int(m.group(1))
m = re.search(r'Memory bandwidth.*\s+(\d+(\.\d+)?) |\s*$', line)
if m is not None:
measurements["bandwidth"] += int(m.group(1))
m = re.search(r'Memory data volume.*\s+(\d+(\.\d+)?) |\s*$', line)
if m is not None:
measurements["transfer"] += int(m.group(1))
m = re.search(r'DP.*\s+(\d+(\.\d+)?) |\s*$', line)
if m is not None:
measurements["performance"] += int(m.group(1))
m = re.search(r'Clock.*\s+(\d+(\.\d+)?) |\s*$', line)
if m is not None:
measurements["clock"] += int(m.group(1))
m = re.search(r'Operational intensity.*\s+(\d+(\.\d+)?) |\s*$', line)
if m is not None:
measurements["intensity"] += int(m.group(1))
return time / times
for key, value in measurements:
measurements[key] = value / times
return measurements