diff --git a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp index efa101633ab..3b7c02b2790 100644 --- a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp +++ b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp @@ -74,10 +74,29 @@ struct IWPValue { } }; +template +struct IWPGradient { + typedef typename GeomTraits::FT FT; + typedef typename GeomTraits::Vector_3 Vector; + + Vector operator()(const typename GeomTraits::Point_3& point) const { + const FT alpha = 5.01; + // const float alpha = 1.01; + const FT x = alpha * (point.x() + 1) * M_PI; + const FT y = alpha * (point.y() + 1) * M_PI; + const FT z = alpha * (point.z() + 1) * M_PI; + + const FT gx = M_PI * alpha * sin(x) * (cos(y) * (cos(z) - 1.0) - cos(z)); + const FT gy = M_PI * alpha * sin(y) * (cos(x) * (cos(z) - 1.0) - cos(z)); + const FT gz = M_PI * alpha * sin(z) * (cos(x) * (cos(y) - 1.0) - cos(y)); + return Vector(gx, gy, gz); + } +}; + template struct Implicit_iwp { - typedef CGAL::Isosurfacing::Implicit_domain, SphereGradient> Domain; + typedef CGAL::Isosurfacing::Implicit_domain, IWPGradient> Domain; typedef typename GeomTraits::Vector_3 Vector; Implicit_iwp(const std::size_t N) : res(2.0 / N, 2.0 / N, 2.0 / N) {} @@ -92,7 +111,7 @@ struct Implicit_iwp { private: IWPValue val; - SphereGradient grad; + IWPGradient grad; Vector res; }; diff --git a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_threads.py b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_threads.py index bd6c0e83750..feecb1988cb 100644 --- a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_threads.py +++ b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark_threads.py @@ -6,14 +6,15 @@ algorithm = "ALGO_MARCHING_CUBES" tag = "TAG_PARALLEL" min_threads = 1 max_threads = 12 -cells = 300 +n = 300 +cells = n ** 3 build(scenario, kernel, algorithm, tag) data = [] for t in range(min_threads, max_threads): - time = execute(cells, t) + time = execute(n, t) data.append([scenario, kernel, algorithm, tag, t, cells, time]) diff --git a/Isosurfacing_3/benchmark/Isosurfacing_3/graphs.py b/Isosurfacing_3/benchmark/Isosurfacing_3/graphs.py index 725919c181e..b19e961f231 100644 --- a/Isosurfacing_3/benchmark/Isosurfacing_3/graphs.py +++ b/Isosurfacing_3/benchmark/Isosurfacing_3/graphs.py @@ -44,20 +44,26 @@ if latex_export: plt.rcParams['font.size'] = "17" -data = pd.read_csv("threads_implicit.csv") -add_threads_graph(data, "implicit") +data = pd.read_csv("implicit_iwp_mc.csv") +add_threads_graph(data, "mc") -data = pd.read_csv("threads_grid.csv") -add_threads_graph(data, "grid") +#data = pd.read_csv("threads_grid.csv") +#add_threads_graph(data, "grid") -plt.xticks(np.arange(1, max(data["threads"]) + 0.1, 1)) +xt = np.arange(0, min(max(data["threads"]), 9) + 0.1, 2) +if max(data["threads"]) > 10: + print("more") + xt = np.concatenate((xt, np.arange(10, max(data["threads"]) + 0.1, 2))) + +print(xt) +plt.xticks(xt) plot_graph("perf_threads.svg", "", False, "performance [10^3 cubes/s]", "cores") -data = pd.read_csv("size_implicit.csv") -add_size_graph(data, "implicit") - -data = pd.read_csv("size_grid.csv") -add_size_graph(data, "grid") - -plot_graph("perf_size.svg", "", True, "performance [10^3 cubes/s]", "cubes") +#data = pd.read_csv("size_implicit.csv") +#add_size_graph(data, "implicit") +# +#data = pd.read_csv("size_grid.csv") +#add_size_graph(data, "grid") +# +#plot_graph("perf_size.svg", "", True, "performance [10^3 cubes/s]", "cubes")