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;
}
......
......@@ -9,18 +9,10 @@
#include "vector_dist_performance_util.hpp"
#include "Plot/GoogleChart.hpp"
#include <boost/property_tree/xml_parser.hpp>
#include <boost/foreach.hpp>
#include "util/performance/performance_util.hpp"
void addUpdtateTime(GoogleChart & cg)
{
time_t t = time(0); // get time now
struct tm * now = localtime( & t );
std::stringstream str;
str << "<h3>Updated: " << now->tm_mday << "/" << now->tm_mon + 1 << "/" << now->tm_year+1900 << " " << now->tm_hour << ":" << now->tm_min << ":" << now->tm_sec << std::endl;
cg.addHTML(str.str());
}
/*! \brief Draw a standard performance graph
*
......
......@@ -8,6 +8,7 @@
#ifndef SRC_VECTOR_VECTOR_DIST_PERFORMANCE_UTIL_HPP_
#define SRC_VECTOR_VECTOR_DIST_PERFORMANCE_UTIL_HPP_
#include <boost/property_tree/ptree.hpp>
#include "Plot/GoogleChart.hpp"
#include "vector_dist_performance_common.hpp"
......@@ -15,86 +16,6 @@
#define N_VERLET_TEST 3
#define N_STAT_TEST 30
static inline void warning_set(int & warning_level, double mean, double mean_ref, double sigma)
{
int warning_level_candidate;
if (mean - mean_ref < -2.0*sigma )
warning_level_candidate = -1;
else if (mean - mean_ref < 2.0*sigma)
warning_level_candidate = 0;
else if (mean - mean_ref < 3.0*sigma)
warning_level_candidate = 1;
else
warning_level_candidate = 2;
if (warning_level_candidate > warning_level)
warning_level = warning_level_candidate;
}
static inline void addchartarea(std::string & chart_area, int lvl)
{
std::string color;
if (lvl == -1)
{
chart_area = std::string(",chartArea: {\
backgroundColor: {\
stroke: '#00FF00',\
strokeWidth: 6\
}\
}");
}
else if (lvl == 0)
{
// NOTHING TO DO
}
else if (lvl == 1)
{
chart_area = std::string(",chartArea: {\
backgroundColor: {\
stroke: '#FFFF00',\
strokeWidth: 6\
}\
}");
}
else if (lvl == 2)
{
chart_area = std::string(",chartArea: {\
backgroundColor: {\
stroke: '#FF0000',\
strokeWidth: 6\
}\
}");
}
}
void addUpdtateTime(GoogleChart & cg);
/*! \brief Standard deviation
*
* \param measures set of measures
* \param mean the mean of the measures
*
* \return the standard deviation
*
*/
static inline void standard_deviation(openfpm::vector<double> measures, double & mean, double & dev)
{
mean = 0;
for (size_t i = 0 ; i < measures.size() ; i++)
mean += measures.get(i);
mean /= measures.size();
dev = 0;
for (size_t i = 0 ; i < measures.size() ; i++)
dev += (measures.get(i) - mean)*(measures.get(i) - mean);
dev = sqrt(dev / (measures.size() - 1));
}
/*! \brief Benchmark particles' forces time
*
......@@ -146,7 +67,8 @@ template<typename V> double benchmark_reorder(V & vd, size_t m)
*
* \return real time
*/
template<typename T, typename V> double benchmark_get_celllist(T & NN, V & vd, float r_cut)
template<typename T, typename V>
double benchmark_get_celllist(T & NN, V & vd, float r_cut)
{
// Cell list timer
timer t;
......@@ -290,5 +212,4 @@ extern void StandardPerformanceGraph(std::string file_mean,
std::string y_string,
bool use_log);
#endif /* SRC_VECTOR_VECTOR_DIST_PERFORMANCE_UTIL_HPP_ */
......@@ -8,6 +8,8 @@
#ifndef SRC_VECTOR_VECTOR_DIST_VERLET_PERFORMANCE_TESTS_HPP_
#define SRC_VECTOR_VECTOR_DIST_VERLET_PERFORMANCE_TESTS_HPP_
#include "util/stat/common_statistics.hpp"
/*! \brief Print a string about the test
*
* \param test string to print
......
......@@ -26,16 +26,18 @@
extern const char * test_dir;
// XML report
boost::property_tree::ptree pt;
#ifdef PERFORMANCE_TEST
#include "../../openfpm_numerics/src/interpolation/interpolation.hpp"
#include "Grid/grid_dist_id.hpp"
#include "Plot/GoogleChart.hpp"
#include "interpolation/mp4_kernel.hpp"
#include "Vector/performance/vector_dist_performance_util.hpp"
#include "util/performance/performance_util.hpp"
BOOST_AUTO_TEST_SUITE( performance )
#include "Vector/performance/verlet_performance_tests.hpp"
#include "Vector/performance/cell_list_part_reorder.hpp"
#include "Vector/performance/cell_list_comp_reorder.hpp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment