8 #ifndef OPENFPM_DATA_SRC_GRID_GRID_PERFORMANCE_TESTS_HPP_ 
    9 #define OPENFPM_DATA_SRC_GRID_GRID_PERFORMANCE_TESTS_HPP_ 
   11 #include "grid_util_test.hpp" 
   16 BOOST_AUTO_TEST_CASE(grid_performance_set_obj)
 
   18     size_t sz[] = {128,128,128};
 
   28     std::vector<double> times(N_STAT + 1);
 
   31     for (
size_t j = 0 ; j < 8 ; j++)
 
   33         for (
size_t i = 1 ; i < N_STAT+1 ; i++)
 
   38             auto it = c3.getIterator();
 
   51         std::sort(times.begin(),times.end());
 
   55     testsg.add(
"Grid so");
 
   56     per_timesg.add(times[0]);
 
   60 BOOST_AUTO_TEST_CASE(grid_performance_set_other_grid)
 
   62     size_t sz[] = {128,128,128};
 
   71     std::vector<double> times(N_STAT + 1);
 
   74     for (
size_t j = 0 ; j < 8 ; j++)
 
   76         for (
size_t i = 1 ; i < N_STAT+1 ; i++)
 
   81             auto it = c3.getIterator();
 
   85                 c3.set(it.get(),c1,it.get());
 
   94         std::sort(times.begin(),times.end());
 
   98     testsg.add(
"Grid sog");
 
   99     per_timesg.add(times[0]);
 
  103 BOOST_AUTO_TEST_CASE(grid_performance_set_other_grid_encap)
 
  105     size_t sz[] = {128,128,128};
 
  114     std::vector<double> times(N_STAT + 1);
 
  117     for (
size_t j = 0 ; j < 8 ; j++)
 
  119         for (
size_t i = 1 ; i < N_STAT+1 ; i++)
 
  124             auto it = c3.getIterator();
 
  128                 c3.set(it.get(),c1.get_o(it.get()));
 
  137         std::sort(times.begin(),times.end());
 
  141     testsg.add(
"Grid soge");
 
  142     per_timesg.add(times[0]);
 
  145 BOOST_AUTO_TEST_CASE(grid_performance_duplicate)
 
  147     size_t sz[] = {128,128,128};
 
  155     std::vector<double> times(N_STAT_SMALL + 1);
 
  158     for (
size_t j = 0 ; j < 8 ; j++)
 
  160         for (
size_t i = 1 ; i < N_STAT_SMALL+1 ; i++)
 
  171         std::sort(times.begin(),times.end());
 
  175     testsg.add(
"Grid dup");
 
  176     per_timesg.add(times[0]);
 
  181 BOOST_AUTO_TEST_CASE(grid_performance_write_report)
 
  187     std::string per_dir(test_dir);
 
  191     y_ref.load(per_dir + std::string(
"/openfpm_data/ref_timesg"));
 
  193     load_and_combine(per_dir + std::string(
"/openfpm_data/previous_measureg"),y,per_timesg);
 
  198         for (
size_t j = 0; j < y.get(0).
size(); j++)
 
  199             yn.add(
"config " + std::to_string(j));
 
  205     options.
title = std::string(
"Grid Performances");
 
  206     options.
yAxis = std::string(
"Time (seconds)");
 
  207     options.
xAxis = std::string(
"Benchmark");
 
  208     options.
stype = std::string(
"bars");
 
  210     std::stringstream g_test_desc;
 
  211     g_test_desc << 
"<h2>Grid performance test</h2>\n";
 
  212     g_test_desc << 
"<strong>128x128x128 Grid containing a Point_test<float></strong><br>";
 
  213     g_test_desc << 
"<strong>Grid so:</strong> Initialize each element of the grid<br>";
 
  214     g_test_desc << 
"<strong>Grid sog:</strong> Manual copy of two grids<br>";
 
  215     g_test_desc << 
"<strong>Grid soge:</strong> Manual copy of two grids in a different way<br>";
 
  216     g_test_desc << 
"<strong>Grid dup:</strong> Duplication of the grid (Duplication include grid creation time)<br>";
 
  219     cg.addHTML(g_test_desc.str());
 
  220     cg.AddHistGraph(testsg,y,yn,options);
 
  227     speedup_calculate(y_ref_sup,y,y_ref,yn);
 
  229     std::stringstream g_test_spdesc;
 
  230     g_test_spdesc << 
"<h2>Grid speedup</h2>\n";
 
  231     g_test_spdesc << 
"The previous tests are compared with the best performances ever registered, ";
 
  232     g_test_spdesc << 
"the banded area indicate the upper and lower bounds of the best registrered performances.<br>";
 
  233     g_test_spdesc << 
"The lines are the latest 5 tests<br>";
 
  234     g_test_spdesc << 
"<strong>Line inside the area</strong>: The tested configuration has no improvement or degradation in performance<br>";
 
  235     g_test_spdesc << 
"<strong>Line break the upper bound</strong>: The tested configuration has improvement in performance<br>";
 
  236     g_test_spdesc << 
"<strong>Line break the lower bound</strong>: The tested configuration has degradation in performance<br>";
 
  237     g_test_spdesc << 
"<strong>Y axis:</strong> Performance change in percentage from the average of the best registered performances<br>";
 
  240     cg.addHTML(g_test_spdesc.str());
 
  241     cg.AddLinesGraph(testsg,y_ref_sup,yn,options);
 
std::string title
Title of the chart. 
 
double getwct()
Return the elapsed real time. 
 
std::string yAxis
Y axis name. 
 
void start()
Start the timer. 
 
Test structure used for several test. 
 
std::string xAxis
X axis name. 
 
Class for cpu time benchmarking. 
 
void stop()
Stop the timer.