Commit ef919f19 authored by Quentin Khan's avatar Quentin Khan

PerfTestUtils: private repo config

PerfTest: private repo config
PerfTest: added FFmmAlgorithmSectionTask support
AlgoLoaderSectionTask: created
parent 87ff6caa
// ==== CMAKE ====
// Keep in private GIT
// @SCALFMM_PRIVATE
#ifndef _ALGOLOADERSECTIONTASK_HPP_
#define _ALGOLOADERSECTIONTASK_HPP_
#include <memory>
#include "PerfTestUtils.hpp"
#include "Core/FFmmAlgorithmSectionTask.hpp"
template <class _TreeLoader, template<typename> class _KernelLoader>
class AlgoLoaderSectionTask : public FAlgoLoader<_TreeLoader, _KernelLoader> {
public:
using TreeLoader = _TreeLoader;
using KernelLoader = _KernelLoader<TreeLoader>;
using FReal = typename TreeLoader::FReal;
using CellClass = typename TreeLoader::CellClass;
using ContainerClass = typename TreeLoader::ContainerClass;
using LeafClass = typename TreeLoader::LeafClass;
using OctreeClass = typename TreeLoader::OctreeClass;
using KernelClass = typename KernelLoader::KernelClass;
using FMMClass = FFmmAlgorithmSectionTask<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass>;
TreeLoader& _treeLoader;
KernelLoader& _kernelLoader;
std::unique_ptr<FMMClass> _algo;
AlgoLoaderSectionTask(FPerfTestParams& /*params*/,
TreeLoader& treeLoader,
KernelLoader& kernelLoader) :
_treeLoader(treeLoader),
_kernelLoader(kernelLoader),
_algo(nullptr) {
}
void run() {
_algo = std::unique_ptr<FMMClass>(
new FMMClass(&(_treeLoader._tree), &(_kernelLoader._kernel)));
_algo->execute();
}
};
#endif
// ==== CMAKE ====
// Keep in private GIT
// @SCALFMM_PRIVATE
/**
* \file
......@@ -25,6 +29,7 @@
#include "AlgoLoaderThread.hpp"
#include "AlgoLoaderTask.hpp"
#include "AlgoLoaderSectionTask.hpp"
#include "AlgoLoaderCostZones.hpp"
/**
......@@ -48,6 +53,23 @@ void runperf(FPerfTestParams& params)
KernelLoader<TreeLoader> kernelLoader(params, treeLoader);
AlgoLoader<TreeLoader, KernelLoader> algoLoader(params, treeLoader, kernelLoader);
algoLoader.run();
auto& algo = *(algoLoader._algo);
std::cout << "@@ "
<< "algo:" << params.algo << " "
<< "file:" << params.filename.substr(params.filename.find_last_of('/')+1) << " "
<< "particles:" << treeLoader._loader.getNumberOfParticles() << " "
<< "threads:" << params.nbThreads << " "
<< "height:" << params.treeHeight << " "
<< "subheight:" << params.subTreeHeight << " "
<< algoLoader.getRunInfoString()
<< "P2M:" << algo.getTime(FAlgorithmTimers::P2MTimer) << " "
<< "M2M:" << algo.getTime(FAlgorithmTimers::M2MTimer) << " "
<< "M2L:" << algo.getTime(FAlgorithmTimers::M2LTimer) << " "
<< "L2L:" << algo.getTime(FAlgorithmTimers::L2LTimer) << " "
<< "P2PL2P:" << algo.getTime(FAlgorithmTimers::NearTimer) << " "
<< std::endl;
}
int main (int argc, char** argv)
......@@ -82,6 +104,8 @@ int main (int argc, char** argv)
runperf<TreeLoaderFCheb<>, KernelLoaderFChebSym, AlgoLoaderTask>(params);
} else if ( "costzones" == params.algo ) {
runperf<TreeLoaderFCheb<>, KernelLoaderFChebSym, AlgoLoaderCostZones>(params);
} else if ( "sectiontask" == params.algo ) {
runperf<TreeLoaderFCheb<>, KernelLoaderFChebSym, AlgoLoaderSectionTask>(params);
} else {
std::cout << "Unknown algorithm: " << params.algo << std::endl;
}
......
// ==== CMAKE ====
// Keep in private GIT
// @SCALFMM_PRIVATE
#ifndef _PERFTESTUTILS_HPP_
#define _PERFTESTUTILS_HPP_
......@@ -167,6 +171,9 @@ public:
FTic time;
/// Method that runs the algorithm.
virtual void run() = 0;
virtual std::string getRunInfoString() const {
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