Commit ae3ab296 authored by incardon's avatar incardon

Refactor performance test

parent 5b11516e
......@@ -30,6 +30,8 @@ set(SuiteSparse_ROOT ${SUITESPARSE_ROOT})
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CUDA_STANDARD 11)
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3")
if (OPENBLAS_ROOT)
set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${OPENBLAS_ROOT}/lib")
......@@ -57,7 +59,7 @@ if(ENABLE_GPU)
endif()
find_package(Boost 1.68.0 COMPONENTS unit_test_framework iostreams program_options)
find_package(Boost 1.68.0 COMPONENTS unit_test_framework iostreams program_options system filesystem)
find_package(MPI)
find_package(PETSc)
find_package(HDF5)
......
openfpm_data @ cbef620d
Subproject commit c7d16222ba51287808f611c280860fcd76281936
Subproject commit cbef620db71cbd6beb13eb11f139f1cdbfce8ae3
openfpm_io @ d7c48264
Subproject commit eafa24bd983173dfd9c4e9c49e88b160096066ff
Subproject commit d7c48264a25f8f7aded163258fb3c182a7397542
......@@ -89,6 +89,11 @@ target_link_libraries(pdata -L${HDF5_ROOT}/lib hdf5 hdf5_hl)
target_link_libraries(pdata -L${LIBHILBERT_LIBRARY_DIRS} ${LIBHILBERT_LIBRARIES})
target_link_libraries(pdata ${PETSC_LIBRARIES})
if (TEST_PERFORMANCE)
target_link_libraries(pdata ${Boost_FILESYSTEM_LIBRARY})
target_link_libraries(pdata ${Boost_SYSTEM_LIBRARY})
endif()
if (TEST_COVERAGE)
target_link_libraries(pdata -lgcov --coverage)
endif()
......
......@@ -2059,7 +2059,8 @@ public:
* \return the selected element
*
*/
template <unsigned int p = 0>inline auto get(grid_dist_g_dx<device_grid> & v1) const -> typename std::add_lvalue_reference<decltype(v1.getSub()->template get<p>(v1.getKey()))>::type
template <unsigned int p = 0>
inline auto get(const grid_dist_g_dx<device_grid> & v1) const -> typename std::add_lvalue_reference<decltype(v1.getSub()->template get<p>(v1.getKey()))>::type
{
#ifdef SE_CLASS2
check_valid(this,8);
......@@ -2075,7 +2076,8 @@ public:
* \return the selected element
*
*/
template <unsigned int p = 0>inline auto get(grid_dist_g_dx<device_grid> & v1) -> typename std::add_lvalue_reference<decltype(v1.getSub()->template get<p>(v1.getKey()))>::type
template <unsigned int p = 0>
inline auto get(const grid_dist_g_dx<device_grid> & v1) -> typename std::add_lvalue_reference<decltype(v1.getSub()->template get<p>(v1.getKey()))>::type
{
#ifdef SE_CLASS2
check_valid(this,8);
......@@ -2091,7 +2093,8 @@ public:
* \return the selected element
*
*/
template <unsigned int p = 0>inline auto get(const grid_dist_lin_dx & v1) const -> typename std::add_lvalue_reference<decltype(loc_grid.get(v1.getSub()).template get<p>(v1.getKey()))>::type
template <unsigned int p = 0>
inline auto get(const grid_dist_lin_dx & v1) const -> typename std::add_lvalue_reference<decltype(loc_grid.get(v1.getSub()).template get<p>(v1.getKey()))>::type
{
#ifdef SE_CLASS2
check_valid(this,8);
......@@ -2107,7 +2110,8 @@ public:
* \return the selected element
*
*/
template <unsigned int p = 0>inline auto get(const grid_dist_lin_dx & v1) -> typename std::add_lvalue_reference<decltype(loc_grid.get(v1.getSub()).template get<p>(v1.getKey()))>::type
template <unsigned int p = 0>
inline auto get(const grid_dist_lin_dx & v1) -> typename std::add_lvalue_reference<decltype(loc_grid.get(v1.getSub()).template get<p>(v1.getKey()))>::type
{
#ifdef SE_CLASS2
check_valid(this,8);
......@@ -2123,7 +2127,8 @@ public:
* \return the selected element
*
*/
template <unsigned int p = 0>inline auto getProp(const grid_dist_key_dx<dim> & v1) const -> decltype(this->template get<p>(v1))
template <unsigned int p = 0>
inline auto getProp(const grid_dist_key_dx<dim> & v1) const -> decltype(this->template get<p>(v1))
{
return this->template get<p>(v1);
}
......@@ -2136,7 +2141,8 @@ public:
* \return the selected element
*
*/
template <unsigned int p = 0>inline auto getProp(const grid_dist_key_dx<dim> & v1) -> decltype(this->template get<p>(v1))
template <unsigned int p = 0>
inline auto getProp(const grid_dist_key_dx<dim> & v1) -> decltype(this->template get<p>(v1))
{
return this->template get<p>(v1);
}
......
......@@ -308,7 +308,7 @@ public:
*
*
*/
inline device_grid * getSub()
inline device_grid * getSub() const
{
return dg;
}
......
......@@ -8,26 +8,21 @@
#ifndef SRC_GRID_GRID_DIST_PERFORMANCE_HPP_
#define SRC_GRID_GRID_DIST_PERFORMANCE_HPP_
#include "../../../openfpm_numerics/src/interpolation/interpolation.hpp"
#include "Grid/grid_dist_id.hpp"
#include "Plot/GoogleChart.hpp"
#include "interpolation/mp4_kernel.hpp"
#define GRID_ITERATOR_TESTS 30
#define GRID_INTERPOLATION_TESTS 30
// Vectors to store the data for 3D
openfpm::vector<double> time_iterator_normal_mean;
openfpm::vector<double> time_iterator_normal_dev;
openfpm::vector<double> time_iterator_stencil_mean;
openfpm::vector<double> time_iterator_stencil_dev;
openfpm::vector<double> time_inte_p2m_mean;
openfpm::vector<double> time_inte_m2p_mean;
openfpm::vector<double> time_inte_p2m_dev;
openfpm::vector<double> time_inte_m2p_dev;
openfpm::vector<size_t> nk_grid_st;
openfpm::vector<size_t> nk_grid_int;
// Property tree
struct report_grid_iterator_test
{
boost::property_tree::ptree graphs;
};
report_grid_iterator_test report_grid_iterator;
BOOST_AUTO_TEST_SUITE( grid_iterator_performance_test )
constexpr int x = 0;
......@@ -39,10 +34,7 @@ constexpr int z = 2;
*
*/
void grid_interpolation_benchmark(openfpm::vector<size_t> & nk_grid,
openfpm::vector<double> & time_interpolation_p2m_mean,
openfpm::vector<double> & time_interpolation_m2p_mean,
openfpm::vector<double> & time_interpolation_p2m_dev,
openfpm::vector<double> & time_interpolation_m2p_dev)
boost::property_tree::ptree & interpolation_graph)
{
for (size_t k = 0 ; k < nk_grid.size() ; k++)
{
......@@ -55,6 +47,23 @@ void grid_interpolation_benchmark(openfpm::vector<size_t> & nk_grid,
size_t tot_part = np*np*np;
std::string base_p2m = "performance.interpolation.p2m(" + std::to_string(k) + ")";
std::string base_m2p = "performance.interpolation.m2p(" + std::to_string(k) + ")";
interpolation_graph.put(base_p2m + ".grid.dim",3);
interpolation_graph.put(base_m2p + ".grid.dim",3);
interpolation_graph.put(base_p2m + ".grid.x",np);
interpolation_graph.put(base_p2m + ".grid.y",np);
interpolation_graph.put(base_p2m + ".grid.z",np);
interpolation_graph.put(base_m2p + ".grid.x",np);
interpolation_graph.put(base_m2p + ".grid.y",np);
interpolation_graph.put(base_m2p + ".grid.z",np);
interpolation_graph.put(base_p2m + ".particles",tot_part);
interpolation_graph.put(base_m2p + ".particles",tot_part);
grid_dist_id<3, float, aggregate<float>> gd(sz,domain,gg);
vector_dist<3,float,aggregate<float>> vd(gd.getDecomposition(),tot_part);
......@@ -95,10 +104,11 @@ void grid_interpolation_benchmark(openfpm::vector<size_t> & nk_grid,
measures.add(tstl.getwct());
}
standard_deviation(measures,mean,dev);
time_interpolation_p2m_mean.add(mean);
time_interpolation_p2m_dev.add(dev);
std::cout << "Time particles to mesh " << time_interpolation_p2m_mean.last() << std::endl;
interpolation_graph.put(base_p2m + ".data.mean",mean);
interpolation_graph.put(base_p2m + ".data.dev",dev);
std::cout << "Time particles to mesh " << mean << std::endl;
measures.clear();
for (size_t j = 0 ; j < GRID_INTERPOLATION_TESTS ; j++)
......@@ -115,10 +125,11 @@ void grid_interpolation_benchmark(openfpm::vector<size_t> & nk_grid,
measures.add(tstl.getwct());
}
standard_deviation(measures,mean,dev);
time_interpolation_m2p_mean.add(mean);
time_interpolation_m2p_dev.add(dev);
std::cout << "Time mesh to particles " << time_interpolation_m2p_mean.last() << std::endl;
interpolation_graph.put(base_m2p + ".data.mean",mean);
interpolation_graph.put(base_m2p + ".data.dev",dev);
std::cout << "Time mesh to particles " << mean << std::endl;
}
}
......@@ -190,10 +201,7 @@ double grid_iterator_benchmark_norm(grid_dist_id<3, float, aggregate<long int>,
*
*/
template<unsigned int dim> void grid_iterator_benchmark(openfpm::vector<size_t> & nk_grid,
openfpm::vector<double> & time_iterator_normal_mean,
openfpm::vector<double> & time_iterator_stencil_mean,
openfpm::vector<double> & time_iterator_normal_dev,
openfpm::vector<double> & time_iterator_stencil_dev)
boost::property_tree::ptree & iterator_graph)
{
std::string str("Testing " + std::to_string(dim) + "D grid iterator stencil and normal");
print_test_v(str,0);
......@@ -207,8 +215,14 @@ template<unsigned int dim> void grid_iterator_benchmark(openfpm::vector<size_t>
//Number of particles
size_t k = nk_grid.get(i);
std::string base = "performance.grid.iterators(" + std::to_string(i) + ")";
iterator_graph.put(base + ".grid.dim",3);
iterator_graph.put(base + ".grid.x",k);
iterator_graph.put(base + ".grid.y",k);
iterator_graph.put(base + ".grid.z",k);
BOOST_TEST_CHECKPOINT( "Testing " << dim << "D vector grid iterator performance k=" << k );
BOOST_TEST_CHECKPOINT( "Testing " << dim << "D grid iterator performance k=" << k );
Box<dim,float> box;
......@@ -245,11 +259,15 @@ template<unsigned int dim> void grid_iterator_benchmark(openfpm::vector<size_t>
double mean;
double dev;
openfpm::vector<double> measures;
for (size_t j = 0 ; j < GRID_ITERATOR_TESTS ; j++)
{measures.add(grid_iterator_benchmark_stencil(g_dist,total));}
standard_deviation(measures,mean,dev);
time_iterator_stencil_mean.add(mean);
time_iterator_stencil_dev.add(dev);
iterator_graph.put(base + ".stencil.data.mean",mean);
iterator_graph.put(base + ".stencil.data.dev",dev);
std::cout << "Size: " << nk_grid.get(i) << " stencil: " << mean << std::endl;
//// NORMAL ////
......@@ -257,155 +275,13 @@ template<unsigned int dim> void grid_iterator_benchmark(openfpm::vector<size_t>
for (size_t j = 0 ; j < GRID_ITERATOR_TESTS ;j++)
{measures.add(grid_iterator_benchmark_norm(g_dist,total));}
standard_deviation(measures,mean,dev);
time_iterator_normal_mean.add(mean);
time_iterator_normal_dev.add(dev);
std::cout << "Size: " << nk_grid.get(i) << " " << total << std::endl;
}
}
}
/*! \brief Function for verlet performance report
*
*/
template<unsigned int dim>
void grid_iterator_performance_write_report(GoogleChart & cg,
openfpm::vector<size_t> & nk_grid,
openfpm::vector<double> & time_iterator_stencil_mean,
openfpm::vector<double> & time_iterator_stencil_dev,
openfpm::vector<double> & time_iterator_normal_mean,
openfpm::vector<double> & time_iterator_normal_dev)
{
std::string file_mean(test_dir);
std::string file_var(test_dir);
file_mean += std::string("/openfpm_pdata/grid_iterator_mean_" + std::to_string(dim) + std::string("_ref"));
file_var += std::string("/openfpm_pdata/grid_iterator_dev_" + std::to_string(dim) + std::string("_ref"));
std::string file_mean_save = std::string("grid_iterator_mean_" + std::to_string(dim) + std::to_string("_ref"));
std::string file_var_save = std::string("grid_iterator_dev_" + std::to_string(dim) + std::to_string("_ref"));
openfpm::vector<size_t> xp = nk_grid;
openfpm::vector<openfpm::vector<openfpm::vector<double>>> yp_mean;
openfpm::vector<openfpm::vector<openfpm::vector<double>>> yp_dev;
iterator_graph.put(base + ".normal.data.mean",mean);
iterator_graph.put(base + ".normal.data.dev",dev);
openfpm::vector<std::string> names;
openfpm::vector<std::string> gnames;
/* yp_mean.add();
yp_dev.add();
yp_mean.last().add(time_iterator_stencil_mean);
yp_mean.last().add(time_iterator_normal_mean);
yp_dev.last().add(time_iterator_stencil_dev);
yp_dev.last().add(time_iterator_normal_dev);*/
yp_mean.resize(1);
yp_dev.resize(1);
for (size_t i = 0 ; i < yp_mean.size() ; i++)
{
yp_mean.get(i).resize(time_iterator_stencil_mean.size());
yp_dev.get(i).resize(time_iterator_stencil_dev.size());
for (size_t j = 0 ; j < yp_mean.get(i).size() ; j++)
{
yp_mean.get(i).get(j).resize(2);
yp_dev.get(i).get(j).resize(2);
yp_mean.get(i).get(j).get(0) = time_iterator_stencil_mean.get(j);
yp_mean.get(i).get(j).get(1) = time_iterator_normal_mean.get(j);
yp_dev.get(i).get(j).get(0) = time_iterator_stencil_dev.get(j);
yp_dev.get(i).get(j).get(1) = time_iterator_normal_dev.get(j);
}
}
gnames.add("Grid iterators performance for stencil");
names.add("Stencil specialized iterator");
names.add("Normal iterator");
std::string y_string = std::string("Time seconds");
std::string x_string = std::string("Number of grid poins");
StandardPerformanceGraph(file_mean,
file_var,
file_mean_save,
file_var_save,
cg,
xp,
yp_mean,
yp_dev,
names,
gnames,
x_string,
y_string,
true);
}
/*! \brief Function for verlet performance report
*
*/
template<unsigned int dim>
void grid_m2p_performance_write_report(GoogleChart & cg,
openfpm::vector<size_t> & nk_grid,
openfpm::vector<double> & time_m2p_mean,
openfpm::vector<double> & time_m2p_dev)
{
std::string file_mean(test_dir);
std::string file_var(test_dir);
file_mean += std::string("/openfpm_pdata/grid_m2p_mean_" + std::to_string(dim) + std::string("_ref"));
file_var += std::string("/openfpm_pdata/grid_m2p_dev_" + std::to_string(dim) + std::string("_ref"));
std::string file_mean_save = std::string("grid_m2p_mean_" + std::to_string(dim) + std::to_string("_ref"));
std::string file_var_save = std::string("grid_m2p_dev_" + std::to_string(dim) + std::to_string("_ref"));
openfpm::vector<size_t> xp = nk_grid;
openfpm::vector<openfpm::vector<openfpm::vector<double>>> yp_mean;
openfpm::vector<openfpm::vector<openfpm::vector<double>>> yp_dev;
openfpm::vector<std::string> names;
openfpm::vector<std::string> gnames;
yp_mean.resize(1);
yp_dev.resize(1);
for (size_t i = 0 ; i < yp_mean.size() ; i++)
{
yp_mean.get(i).resize(time_iterator_stencil_mean.size());
yp_dev.get(i).resize(time_iterator_stencil_dev.size());
for (size_t j = 0 ; j < yp_mean.get(i).size() ; j++)
{
yp_mean.get(i).get(j).resize(1);
yp_dev.get(i).get(j).resize(1);
yp_mean.get(i).get(j).get(0) = time_m2p_mean.get(j);
yp_dev.get(i).get(j).get(0) = time_m2p_dev.get(j);
std::cout << "Size: " << nk_grid.get(i) << " normal: " << mean << std::endl;
}
}
gnames.add("Grid m2p performance");
names.add("Mesh to particle performance");
std::string y_string = std::string("Time seconds");
std::string x_string = std::string("Number of grid poins");
StandardPerformanceGraph(file_mean,
file_var,
file_mean_save,
file_var_save,
cg,
xp,
yp_mean,
yp_dev,
names,
gnames,
x_string,
y_string,
true);
}
......@@ -418,10 +294,7 @@ BOOST_AUTO_TEST_CASE( grid_interpolation_benchmark_test )
//Benchmark test for 2D and 3D
grid_interpolation_benchmark(nk_grid_int,
time_inte_p2m_mean,
time_inte_m2p_mean,
time_inte_p2m_dev,
time_inte_m2p_dev);
report_grid_iterator.graphs);
}
BOOST_AUTO_TEST_CASE( grid_iterator_benchmark_test )
......@@ -432,36 +305,58 @@ BOOST_AUTO_TEST_CASE( grid_iterator_benchmark_test )
//Benchmark test for 2D and 3D
grid_iterator_benchmark<3>(nk_grid_st,
time_iterator_normal_mean,
time_iterator_stencil_mean,
time_iterator_normal_dev,
time_iterator_stencil_dev);
report_grid_iterator.graphs);
}
BOOST_AUTO_TEST_CASE(grid_iterator_performance_write_report_final)
{
GoogleChart cg;
report_grid_iterator.graphs.put("graphs.graph(0).type","line");
report_grid_iterator.graphs.add("graphs.graph(0).title","Grid iterators performance for stencil");
report_grid_iterator.graphs.add("graphs.graph(0).x.title","Number of grid points");
report_grid_iterator.graphs.add("graphs.graph(0).y.title","Time seconds");
report_grid_iterator.graphs.add("graphs.graph(0).y.data(0).source","performance.grid.iterators(#).normal.data.mean");
report_grid_iterator.graphs.add("graphs.graph(0).x.data(0).source","performance.grid.iterators(#).grid.x");
report_grid_iterator.graphs.add("graphs.graph(0).y.data(0).title","Normal iterator");
report_grid_iterator.graphs.add("graphs.graph(0).y.data(1).source","performance.grid.iterators(#).stencil.data.mean");
report_grid_iterator.graphs.add("graphs.graph(0).x.data(1).source","performance.grid.iterators(#).grid.x");
report_grid_iterator.graphs.add("graphs.graph(0).y.data(1).title","Stencil specialized iterator");
report_grid_iterator.graphs.add("graphs.graph(0).options.log_y","true");
report_grid_iterator.graphs.put("graphs.graph(1).type","line");
report_grid_iterator.graphs.add("graphs.graph(1).title","Grid p2m performance");
report_grid_iterator.graphs.add("graphs.graph(1).x.title","Number of grid points");
report_grid_iterator.graphs.add("graphs.graph(1).y.title","Time seconds");
report_grid_iterator.graphs.add("graphs.graph(1).y.data(0).source","performance.interpolation.p2m(#).data.mean");
report_grid_iterator.graphs.add("graphs.graph(1).y.data(0).title","Interpolation p2m");
report_grid_iterator.graphs.add("graphs.graph(1).x.data(0).source","performance.interpolation.p2m(#).grid.x");
report_grid_iterator.graphs.add("graphs.graph(1).options.log_y","true");
report_grid_iterator.graphs.put("graphs.graph(2).type","line");
report_grid_iterator.graphs.add("graphs.graph(2).title","Grid m2p performance");
report_grid_iterator.graphs.add("graphs.graph(2).x.title","Number of grid points");
report_grid_iterator.graphs.add("graphs.graph(2).y.title","Time seconds");
report_grid_iterator.graphs.add("graphs.graph(2).x","performance.interpolation.m2p(#).grid.x");
report_grid_iterator.graphs.add("graphs.graph(2).y.data(0).source","performance.interpolation.m2p(#).data.mean");
report_grid_iterator.graphs.add("graphs.graph(2).y.data(0).title","Interpolation m2p");
report_grid_iterator.graphs.add("graphs.graph(2).x.data(0).source","performance.interpolation.m2p(#).grid.x");
report_grid_iterator.graphs.add("graphs.graph(2).options.log_y","true");
boost::property_tree::xml_writer_settings<std::string> settings(' ', 4);
boost::property_tree::write_xml("grid_performance.xml", report_grid_iterator.graphs,std::locale(),settings);
//Write report for 2D and 3D
grid_iterator_performance_write_report<3>(cg,
nk_grid_st,
time_iterator_stencil_mean,
time_iterator_stencil_dev,
time_iterator_normal_mean,
time_iterator_normal_dev);
GoogleChart cg;
std::string file_xml_ref(test_dir);
file_xml_ref += std::string("/openfpm_pdata/grid_performance_ref.xml");
grid_m2p_performance_write_report<3>(cg,
nk_grid_int,
time_inte_m2p_mean,
time_inte_m2p_dev);
StandardXMLPerformanceGraph("grid_performance.xml",file_xml_ref,cg);
if (create_vcluster().getProcessUnitID() == 0)
{
addUpdtateTime(cg);
cg.write("grid_iterator_performance.html");
cg.write("grid_performance.html");
}
}
......
......@@ -14,7 +14,16 @@
#include "vector_dist_performance_util.hpp"
#include "cl_comp_performance_graph.hpp"
BOOST_AUTO_TEST_SUITE( celllist_comp_reorder_performance_test )
// Property tree
struct report_cell_list_func_tests
{
boost::property_tree::ptree graphs;
};
report_cell_list_func_tests report_cl_funcs;
BOOST_AUTO_TEST_SUITE( celllist_getCellList_calc_forces_performance_test )
///////////////////// INPUT DATA //////////////////////
......@@ -51,7 +60,7 @@ openfpm::vector<openfpm::vector<double>> time_create_hilb_2_dev;
/*! \brief Function for random cell list test
*
*/
template<unsigned int dim> void cell_list_comp_reorder_random_benchmark(size_t cl_k_start,
template<unsigned int dim> void cell_list_getCellList_calc_force_benchmark(size_t cl_k_start,
size_t cl_k_min,
openfpm::vector<float> & cl_r_cutoff,
openfpm::vector<size_t> & cl_n_particles,
......@@ -60,6 +69,8 @@ template<unsigned int dim> void cell_list_comp_reorder_random_benchmark(size_t c
openfpm::vector<openfpm::vector<double>> & cl_time_create_rand_mean,
openfpm::vector<openfpm::vector<double>> & cl_time_create_rand_dev)
{
report_cl_funcs.graphs.put("performance.celllist.dim",std::to_string(dim));
cl_time_rand_mean.resize(cl_r_cutoff.size());
cl_time_create_rand_mean.resize(cl_r_cutoff.size());
cl_time_rand_dev.resize(cl_r_cutoff.size());
......@@ -83,11 +94,17 @@ template<unsigned int dim> void cell_list_comp_reorder_random_benchmark(size_t c
//Counter number for amounts of particles
size_t k_count = 1 + log2(k/cl_k_min);
report_cl_funcs.graphs.put("performance.celllist.getCellList" + std::to_string(dim) + "D(" + std::to_string(r) + ").rcut",r_cut);
int c = 0;
//For different number of particles
for (size_t k_int = k ; k_int >= cl_k_min ; k_int/=2 )
{
BOOST_TEST_CHECKPOINT( "Testing " << dim << "D vector with a random cell list k=" << k_int );
report_cl_funcs.graphs.put("performance.celllist.getCellList" + std::to_string(dim) + "D(" + std::to_string(r) + ").npart(" + std::to_string(c) + ").n",k_int);
if (cl_n_particles.size() < k_count)
cl_n_particles.add(k_int);
......@@ -120,13 +137,18 @@ template<unsigned int dim> void cell_list_comp_reorder_random_benchmark(size_t c
openfpm::vector<double> measures;
for (size_t n = 0 ; n < N_STAT_TEST; n++)
{
measures.add(benchmark_get_celllist(NN,vd,r_cut));
}
standard_deviation(measures,sum_cl_mean,sum_cl_dev);
//Average total time
cl_time_create_rand_mean.get(r).add(sum_cl_mean);
cl_time_create_rand_dev.get(r).add(sum_cl_dev);
report_cl_funcs.graphs.put("performance.celllist.getCellList" + std::to_string(dim) + "D(" + std::to_string(r) + ").npart(" + std::to_string(c) + ").mean",sum_cl_mean);
report_cl_funcs.graphs.put("performance.celllist.getCellList" + std::to_string(dim) + "D(" + std::to_string(r) + ").npart(" + std::to_string(c) + ").dev",sum_cl_dev);
//Calculate forces
double sum_fr_mean = 0;
......@@ -134,14 +156,19 @@ template<unsigned int dim> void cell_list_comp_reorder_random_benchmark(size_t c
measures.clear();
for (size_t l = 0 ; l < N_STAT_TEST; l++)
measures.add(benchmark_calc_forces<dim>(NN,vd,r_cut));
{measures.add(benchmark_calc_forces<dim>(NN,vd,r_cut));}
standard_deviation(measures,sum_fr_mean,sum_fr_dev);
cl_time_rand_mean.get(r).add(sum_fr_mean);
cl_time_rand_dev.get(r).add(sum_fr_dev);
report_cl_funcs.graphs.put("performance.celllist.calc_forces" + std::to_string(dim) + "D(" + std::to_string(r) + ").npart(" + std::to_string(c) + ").mean",sum_fr_mean);
report_cl_funcs.graphs.put("performance.celllist.calc_forces" + std::to_string(dim) + "D(" + std::to_string(r) + ").npart(" + std::to_string(c) + ").dev",sum_fr_dev);
if (v_cl.getProcessUnitID() == 0)
std::cout << "Cut-off = " << r_cut << ", Particles = " << k_int << ". Time to create a cell-list: " << sum_cl_mean << " dev: " << sum_cl_dev << " time to calculate forces: " << sum_fr_mean << " dev: " << sum_fr_dev << std::endl;
c++;
}
}
}
......@@ -150,7 +177,7 @@ template<unsigned int dim> void cell_list_comp_reorder_random_benchmark(size_t c
/*! \brief Function for hilb cell list test