1#ifndef VECTOR_DIST_GG_MAP_PERFORMANCE_HPP_
3#include "Vector/vector_dist.hpp"
4#include "data_type/aggregate.hpp"
5#include "Plot/GoogleChart.hpp"
11 boost::property_tree::ptree graphs;
19size_t k_start = 100000;
25BOOST_AUTO_TEST_SUITE( vector_gg_map_performance_test )
31template<
unsigned int dim>
36 for (
size_t i = 0; i < dim; i++)
45 for (
size_t i = 0; i < dim; i++)
50 auto & dec = vd.getDecomposition();
55 for (
size_t i = 0 ; i < v_cl.
size() ; i++)
60 auto & nn_box = dec.getNearSubdomains(i);
62 if (nn_box.size() != 0)
66 vd_initialize_box_nomap<dim>(vd,nn_box.get(0),v_cl,start,stop);
89template<
unsigned int dim>
90void vector_gg_map_benchmark(
size_t cl_k_start,
94 std::string str(
"Testing " + std::to_string(dim) +
"D vector, no-order, map ghost_get");
101 if (v_cl.
size() != 3)
108 size_t k_count = 1 + log2(k/cl_k_min);
113 for (
size_t k_int = k ; k_int >= cl_k_min ; k_int/=2 )
115 BOOST_TEST_CHECKPOINT(
"Testing " << dim <<
"D vector without an Hilbert curve reordering k=" << k_int );
117 report_ggm.graphs.put(
"performance.map_" + std::to_string(dim) +
"D.npart(" + std::to_string(c) +
").n",k_int);
119 if (cl_n_particles.
size() < k_count)
120 {cl_n_particles.add(k_int);}
123 double sum_map_mean = 0.0;
124 double sum_map_dev = 0.0;
125 for (
size_t h = 0 ; h < N_STAT_TEST; h++)
126 {measures.add(benchmark_map<dim>(k_int,v_cl));}
127 standard_deviation(measures,sum_map_mean,sum_map_dev);
129 report_ggm.graphs.put(
"performance.map_" + std::to_string(dim) +
"D.npart(" + std::to_string(c) +
").mean",sum_map_mean);
130 report_ggm.graphs.put(
"performance.map_" + std::to_string(dim) +
"D.npart(" + std::to_string(c) +
").dev",sum_map_dev);
139BOOST_AUTO_TEST_CASE( vector_dist_map_test )
142 vector_gg_map_benchmark<3>(k_start,k_min,n_particles);
143 vector_gg_map_benchmark<2>(k_start,k_min,n_particles);
147BOOST_AUTO_TEST_CASE(vector_dist_gg_map_performance_write_report)
151 report_ggm.graphs.put(
"graphs.graph.type",
"line");
152 report_ggm.graphs.add(
"graphs.graph.title",
"Map performance");
153 report_ggm.graphs.add(
"graphs.graph.x.title",
"number of particles");
154 report_ggm.graphs.add(
"graphs.graph.y.title",
"Time seconds");
155 report_ggm.graphs.add(
"graphs.graph.y.data(0).source",
"performance.map_3D.npart(#).mean");
156 report_ggm.graphs.add(
"graphs.graph.x.data(0).source",
"performance.map_3D.npart(#).n");
157 report_ggm.graphs.add(
"graphs.graph.y.data(0).title",
"Map function");
158 report_ggm.graphs.add(
"graphs.graph.options.log_y",
"false");
160 if (create_vcluster().rank() == 0)
162 boost::property_tree::xml_writer_settings<std::string> settings(
' ', 4);
163 boost::property_tree::write_xml(
"particles_map_performance.xml", report_ggm.graphs,std::locale(),settings);
165 std::string file_xml_ref(test_dir);
166 file_xml_ref += std::string(
"/openfpm_pdata/particles_map_performance_ref.xml");
170 StandardXMLPerformanceGraph(
"particles_map_performance.xml",file_xml_ref,cg);
172 addUpdateTime(cg,create_vcluster().size(),
"pdata",
"particles_map_performance");
174 if (create_vcluster().getProcessUnitID() == 0)
175 {cg.
write(
"particles_map_performance.html");}
179BOOST_AUTO_TEST_SUITE_END()
This class represent an N-dimensional box.
__device__ __host__ void setHigh(int i, T val)
set the high interval of the box
__device__ __host__ void setLow(int i, T val)
set the low interval of the box
Small class to produce graph with Google chart in HTML.
void write(std::string file)
It write the graphs on file in html format using Google charts.
size_t rank()
Get the process unit id.
size_t size()
Get the total number of processors.
size_t getProcessingUnits()
Get the total number of processors.
Implementation of VCluster class.
Implementation of 1-D std::vector like structure.
Class for cpu time benchmarking.
void stop()
Stop the timer.
void start()
Start the timer.
double getwct()
Return the elapsed real time.