diff --git a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp index 3b7c02b2790..0ea3c9bffd9 100644 --- a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp +++ b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp @@ -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; } diff --git a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_size.py b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_size.py index 218062d6490..c6d2995ae65 100644 --- a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_size.py +++ b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_size.py @@ -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") diff --git a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_threads.py b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_threads.py index feecb1988cb..5b2b46630eb 100644 --- a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_threads.py +++ b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_threads.py @@ -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") diff --git a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_util.py b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_util.py index ed85bcbf6c0..5d207e30e59 100644 --- a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_util.py +++ b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_util.py @@ -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 \ No newline at end of file + for key, value in measurements: + measurements[key] = value / times + + return measurements \ No newline at end of file