Commit 6c4cedd5 authored by Quentin Khan's avatar Quentin Khan

Adaptive algorithms: do not call L2P on empty leaves

parent 186d0ffa
......@@ -264,7 +264,9 @@ public:
// L2P
void down_to_target() {
for(node_t* leaf : _tree.leaves()) {
_kernel.L2P(leaf->getData(), leaf->getParticleContainer());
if(leaf->getParticleContainer()->size() != 0) {
_kernel.L2P(leaf->getData(), leaf->getParticleContainer());
}
}
}
......
......@@ -846,12 +846,14 @@ public:
// L2P
void down_to_target() {
for(node_t* leaf : _tree.leaves()) {
const char* data_dep = get_dependency<dep_t::L>(leaf); (void)data_dep;
const char* pt_dep = get_dependency<dep_t::P_t>(leaf); (void)pt_dep;
#pragma omp task depend(inout: pt_dep[:1]) depend(in: data_dep[:1])
{
const int thread_num = omp_get_thread_num();
this->_kernels[thread_num]->L2P(leaf->getData(), leaf->getParticleContainer());
if(leaf->getParticleContainer()->size() != 0) {
const char* data_dep = get_dependency<dep_t::L>(leaf); (void)data_dep;
const char* pt_dep = get_dependency<dep_t::P_t>(leaf); (void)pt_dep;
#pragma omp task depend(inout: pt_dep[:1]) depend(in: data_dep[:1])
{
const int thread_num = omp_get_thread_num();
this->_kernels[thread_num]->L2P(leaf->getData(), leaf->getParticleContainer());
}
}
}
// #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