Commit ed76ee30 authored by Quentin Khan's avatar Quentin Khan

FAdaptiveTask: replace binds by lambdas, remove commented code

parent fc61e22b
......@@ -118,59 +118,50 @@ public:
if(operations & FFmmP2P) {
// A. U-list, P2P
auto ULS = std::bind(&FAdaptiveTask::u_list_step, this);
timer.time(ULS);
std::cout << " P2P: " << timer.last().count() << "s" << std::endl;
timer.time([this](){this->u_list_step();});
std::cout << " P2P: " << timer.last().count() << '\n';
}
if(operations & FFmmP2M) {
// 1. source to up, P2M
auto S2U = std::bind(&FAdaptiveTask::source_to_up, this);
timer.time(S2U);
std::cout << " P2M: " << timer.last().count() << "s" << std::endl;
timer.time([this](){this->source_to_up();});
std::cout << " P2M: " << timer.last().count() << '\n';
}
if(operations & FFmmP2L) {
// 3b X-list, P2L
timer.time([this](){this->x_list_step();});
std::cout << " P2L: " << timer.last().count() << '\n';
}
if(operations & FFmmM2M) {
// 2. up to up, M2M
auto U2U = std::bind(&FAdaptiveTask::up_to_up, this);
timer.time(U2U);
std::cout << " M2M: " << timer.last().count() << "s" << '\n';
timer.time([this](){this->up_to_up();});
std::cout << " M2M: " << timer.last().count() << '\n';
}
if(operations & FFmmM2P) {
// 5a W-list, M2P
auto WLS = std::bind(&FAdaptiveTask::w_list_step, this);
timer.time(WLS);
std::cout << " M2P: " << timer.last().count() << "s" << '\n';
timer.time([this](){this->w_list_step();});
std::cout << " M2P: " << timer.last().count() << '\n';
}
if(operations & FFmmM2L) {
// 3a V-list, M2L
auto VLS = std::bind(&FAdaptiveTask::v_list_step, this);
timer.time(VLS);
std::cout << " M2L: " << timer.last().count() << "s" << '\n';
}
if(operations & FFmmP2L) {
// 3b X-list, P2L
auto XLS = std::bind(&FAdaptiveTask::x_list_step, this);
timer.time(XLS);
std::cout << " P2L: " << timer.last().count() << "s" << '\n';
timer.time([this](){this->v_list_step();});
std::cout << " M2L: " << timer.last().count() << '\n';
}
if(operations & FFmmL2L) {
// 4. down to down, L2L
auto D2D = std::bind(&FAdaptiveTask::down_to_down, this);
timer.time(D2D);
std::cout << " L2L: " << timer.last().count() << "s" << '\n';
timer.time([this](){this->down_to_down();});
std::cout << " L2L: " << timer.last().count() << '\n';
}
if(operations & FFmmL2P) {
// 5b down to target, L2P
// 5b down to target, L2P
auto D2T = std::bind(&FAdaptiveTask::down_to_target, this);
timer.time(D2T);
std::cout << " L2P: " << timer.last().count() << "s" << '\n';
timer.time([this](){this->down_to_target();});
std::cout << " L2P: " << timer.last().count() << '\n';
}
std::cout << " task created: "
......@@ -876,36 +867,8 @@ public:
do_inner = false;
}
// #pragma omp task firstprivate(leaf, leaf_source_particle_container, leaf_target_particle_container)
// {
// const int thread_num = omp_get_thread_num();
// // Vectors to be filled after sort and passed to kernel P2P
// std::vector<container_t*> u_item_source_particle_containers;
// std::vector<int> u_item_indices;
// for(node_t* u_item : leaf->U) {
// // Skip empty u_items
// if(u_item == leaf || u_item->getParticleContainer()->size() == 0) {
// continue;
// }
// u_item_source_particle_containers.push_back(u_item->getParticleContainer());
// u_item_indices.push_back(compute_box_offset_index(leaf, u_item, 1));
// }
// // Call P2P on vectors data
// this->_kernels[thread_num]
// ->P2PTask(
// true,
// leaf_target_particle_container,
// u_item_source_particle_containers.data(),
// static_cast<int>(u_item_source_particle_containers.size())
// );
// }
}
#pragma omp taskwait
}
......
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