Commit 1176253b authored by Quentin Khan's avatar Quentin Khan

FAdaptiveSequential: use FAlgorithmTimers to time algorithm steps

parent d1bb2d68
......@@ -5,15 +5,17 @@
#include <cmath> // Used to round box differences
#include <functional>
#include <map>
#include <vector>
#include "Core/FCoreCommon.hpp"
#include "Containers/FTreeCoordinate.hpp"
#include "Utils/FAlgorithmTimers.hpp"
#include "FTimer.hpp"
template<class _Tree, class _Kernel>
class FAdaptiveSequential : public FAlgorithmInterface {
class FAdaptiveSequential : public FAlgorithmInterface, public FAlgorithmTimers {
public:
using tree_t = _Tree;
using kernel_t = _Kernel;
......@@ -25,9 +27,6 @@ private:
tree_t& _tree;
kernel_t& _kernel;
FTimer timer;
template<typename K, typename Ret, typename... Args>
using has_setup = typename std::enable_if<
std::is_same<Ret, decltype(std::declval<K>().setup(std::declval<Args>()...))>::value
......@@ -90,58 +89,66 @@ public:
if(operations & FFmmP2M) {
// 1. source to up, P2M
auto S2U = std::bind(&FAdaptiveSequential::source_to_up, this);
timer.time(S2U);
std::cout << " P2M: " << timer.last().count() << std::endl;
Timers["P2M"].tic();
this->source_to_up();;
Timers["P2M"].tac();
std::cout << " P2M: " << Timers["P2M"].elapsed() << std::endl;
}
if(operations & FFmmM2M) {
// 2. up to up, M2M
auto U2U = std::bind(&FAdaptiveSequential::up_to_up, this);
timer.time(U2U);
std::cout << " M2M: " << timer.last().count() << std::endl;
Timers["M2M"].tic();
this->up_to_up();
Timers["M2M"].tac();
std::cout << " M2M: " << Timers["M2M"].elapsed() << std::endl;
}
if(operations & FFmmM2L) {
// 3a V-list, M2L
auto VLS = std::bind(&FAdaptiveSequential::v_list_step, this);
timer.time(VLS);
std::cout << " M2L: " << timer.last().count() << std::endl;
Timers["M2L"].tic();
this->v_list_step();
Timers["M2L"].tac();
std::cout << " M2L: " << Timers["M2L"].elapsed() << std::endl;
}
if(operations & FFmmP2L) {
// 3b X-list, P2L
auto XLS = std::bind(&FAdaptiveSequential::x_list_step, this);
timer.time(XLS);
std::cout << " P2L: " << timer.last().count() << std::endl;
Timers["P2L"].tic();
this->x_list_step();
Timers["P2L"].tac();
std::cout << " P2L: " << Timers["P2L"].elapsed() << std::endl;
}
if(operations & FFmmL2L) {
// 4. down to down, L2L
auto D2D = std::bind(&FAdaptiveSequential::down_to_down, this);
timer.time(D2D);
std::cout << " L2L: " << timer.last().count() << std::endl;
Timers["L2L"].tic();
this->down_to_down();
Timers["L2L"].tac();
std::cout << " L2L: " << Timers["L2L"].elapsed() << std::endl;
}
if(operations & FFmmM2P) {
// 5a W-list, M2P
auto WLS = std::bind(&FAdaptiveSequential::w_list_step, this);
timer.time(WLS);
std::cout << " M2P: " << timer.last().count() << std::endl;
Timers["M2P"].tic();
this->w_list_step();
Timers["M2P"].tac();
std::cout << " M2P: " << Timers["M2P"].elapsed() << std::endl;
}
if(operations & FFmmL2P) {
// 5b down to target, L2P
auto D2T = std::bind(&FAdaptiveSequential::down_to_target, this);
timer.time(D2T);
std::cout << " L2P: " << timer.last().count() << std::endl;
Timers["L2P"].tic();
this->down_to_target();
Timers["L2P"].tac();
std::cout << " L2P: " << Timers["L2P"].elapsed() << std::endl;
}
if(operations & FFmmP2P) {
// A. U-list, P2P
auto ULS = std::bind(&FAdaptiveSequential::u_list_step, this);
timer.time(ULS);
std::cout << " P2P: " << timer.last().count() << std::endl;
Timers["P2P"].tic();
this->u_list_step();
Timers["P2P"].tac();
std::cout << " P2P: " << Timers["P2P"].elapsed() << std::endl;
}
}
......
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