Commit 4a7fd13c authored by Quentin Khan's avatar Quentin Khan

Added doc to AlgoLoaderCostZones, AlgoLoaderThreadBalance and PerfTestUtils

parent 45a02075
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
#include "BalanceTree/FCostZones.hpp" #include "BalanceTree/FCostZones.hpp"
/** /**
* \brief Algorithm loader for the CostZones algorithm. * \brief Algorithm loader for FFmmAlgorithmThreadBalanced.
*
* See FAlgoLoader documentation.
* *
* \warning : This loader requires that the KernelLoader supply a type definition * \warning : This loader requires that the KernelLoader supply a type definition
* for a `CostKernelClass` * for a `CostKernelClass`
...@@ -25,6 +27,9 @@ ...@@ -25,6 +27,9 @@
template <class _TreeLoader, template<typename> class _KernelLoader> template <class _TreeLoader, template<typename> class _KernelLoader>
class AlgoLoaderCostZones : public FAlgoLoader<_TreeLoader, _KernelLoader> { class AlgoLoaderCostZones : public FAlgoLoader<_TreeLoader, _KernelLoader> {
public: public:
// Types definitions
/// The TreeLoader type that is used.
using TreeLoader = _TreeLoader; using TreeLoader = _TreeLoader;
using KernelLoader = _KernelLoader<TreeLoader>; using KernelLoader = _KernelLoader<TreeLoader>;
...@@ -63,7 +68,7 @@ public: ...@@ -63,7 +68,7 @@ public:
/// Computes the tree cells costs then runs the costzones and FMM algorithms. /// Computes the tree cells costs then runs the costzones and FMM algorithms.
void run() { void run() {
// The tree loader holds the tree structure
OctreeClass* p_tree = &(_treeLoader._tree); OctreeClass* p_tree = &(_treeLoader._tree);
// Compute tree cells costs // Compute tree cells costs
...@@ -75,6 +80,7 @@ public: ...@@ -75,6 +80,7 @@ public:
std::cout << "Generating tree cost: " << this->time.elapsed() << "s.\n"; std::cout << "Generating tree cost: " << this->time.elapsed() << "s.\n";
_infostring << "costgen:" << this->time.elapsed() << " "; _infostring << "costgen:" << this->time.elapsed() << " ";
// Compute cost zones
FCostZones<OctreeClass, CellClass> costzones(p_tree, omp_get_max_threads()); FCostZones<OctreeClass, CellClass> costzones(p_tree, omp_get_max_threads());
this->time.tic(); this->time.tic();
...@@ -83,6 +89,7 @@ public: ...@@ -83,6 +89,7 @@ public:
std::cout << "Generating cost zones: " << this->time.elapsed() << "s.\n"; std::cout << "Generating cost zones: " << this->time.elapsed() << "s.\n";
_infostring << "zonegen:" << this->time.elapsed() << " "; _infostring << "zonegen:" << this->time.elapsed() << " ";
// Execute FFM algorithm
this->time.tic(); this->time.tic();
_algo = std::unique_ptr<FMMClass>( _algo = std::unique_ptr<FMMClass>(
new FMMClass(p_tree, &(_kernelLoader._kernel), new FMMClass(p_tree, &(_kernelLoader._kernel),
......
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
#include "Core/FFmmAlgorithmThreadBalance.hpp" #include "Core/FFmmAlgorithmThreadBalance.hpp"
/**
* \brief An algorithm loader for FFmmAlgorithmBalance
*
* See FAlgoLoader documentation.
*/
template <class _TreeLoader, template<typename> class _KernelLoader> template <class _TreeLoader, template<typename> class _KernelLoader>
class AlgoLoaderThreadBalance : public FAlgoLoader<_TreeLoader, _KernelLoader> { class AlgoLoaderThreadBalance : public FAlgoLoader<_TreeLoader, _KernelLoader> {
public: public:
......
...@@ -47,9 +47,7 @@ struct FPerfTestParams { ...@@ -47,9 +47,7 @@ struct FPerfTestParams {
*/ */
class FTreeLoader { class FTreeLoader {
public: public:
/// A timer /// A timer used to time the loadTree method.
/** Is used to time the loadTree method.
*/
FTic time; FTic time;
protected: protected:
...@@ -135,7 +133,8 @@ class FKernelLoader { ...@@ -135,7 +133,8 @@ class FKernelLoader {
/// The tree loader that was used (see FTreeLoader). /// The tree loader that was used (see FTreeLoader).
using TreeLoader = _TreeLoader; using TreeLoader = _TreeLoader;
public: public:
FTic time; /// A timer
FTic time;
}; };
/** /**
...@@ -169,8 +168,16 @@ class FAlgoLoader { ...@@ -169,8 +168,16 @@ class FAlgoLoader {
public: public:
/// A timer. /// A timer.
FTic time; FTic time;
/// Method that runs the algorithm. /// Method that runs the algorithm.
virtual void run() = 0; virtual void run() = 0;
/// Additionnal information for specific algorithm loader.
/**
* The string should be formated as a key:value list separated by spaces.
* For instance : "key1:value1 key2:value2 ". It may be a good idea to add a
* space at the end of the string.
*/
virtual std::string getRunInfoString() const { virtual std::string getRunInfoString() const {
return ""; return "";
} }
......
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