Attention une mise à jour du service Gitlab va être effectuée le mardi 18 janvier (et non lundi 17 comme annoncé précédemment) entre 18h00 et 18h30. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 39e41f60 authored by Quentin Khan's avatar Quentin Khan
Browse files

FAdaptiveStarPU: pass symbolic data to P2M, P2L, M2P, L2P; fix P2P

  - The symbolic data is given to allow real kernels to find a cell's
    depth / box.
  - The P2P did not compute the correct indices for the U-list items
parent d69e6a09
......@@ -312,7 +312,8 @@ private:
starpu_task* task = starpu_task_create();
task->cl = &(this->P2M_cl);
task->handles[0] = leaf_handles.multipole;
task->handles[1] = leaf_handles.particles;
task->handles[1] = leaf_handles.symbolic;
task->handles[2] = leaf_handles.particles;
task->cl_arg = this;
task->cl_arg_size = sizeof(this);
......@@ -323,11 +324,13 @@ private:
void init_P2M_codelet() {
starpu_codelet_init(&this->P2M_cl);
this->P2M_cl.name = "P2M";
this->P2M_cl.cpu_funcs[0] = P2M_cpu;
this->P2M_cl.cpu_funcs_name[0] = {const_cast<char*>("P2M task")};
this->P2M_cl.nbuffers = 2; // {0: leaf multipole, 1: leaf particles}
this->P2M_cl.nbuffers = 3; // {0: leaf multipole, 1: leaf symb, 2: leaf particles}
this->P2M_cl.modes[0] = STARPU_RW;
this->P2M_cl.modes[1] = STARPU_R;
this->P2M_cl.modes[2] = STARPU_R;
}
static void P2M_cpu(void** buffers, void* cl_arg) {
......@@ -335,13 +338,17 @@ private:
(typename tree_t::node_t::data_t::multipole_t*)
STARPU_VARIABLE_GET_PTR(buffers[0]);
typename tree_t::node_t::symbolic_data_t* leaf_symb_data =
(typename tree_t::node_t::symbolic_data_t*)
STARPU_VARIABLE_GET_PTR(buffers[1]);
typename tree_t::node_t::particle_container_t* particle_container =
(typename tree_t::node_t::particle_container_t*)
STARPU_VARIABLE_GET_PTR(buffers[1]);
STARPU_VARIABLE_GET_PTR(buffers[2]);
auto algo = (FAdaptiveStarPU<tree_t, kernel_t>*) cl_arg;
kernel_t* ker = get_starpu_worker_kernel(algo);
ker->P2M(leaf_multipole, particle_container);
ker->P2M(leaf_multipole, leaf_symb_data, particle_container);
}
......@@ -542,7 +549,8 @@ private:
starpu_task* task = starpu_task_create();
task->cl = &(this->P2L_cl);
task->handles[0] = this->_data_handles.at(w_item).local_exp;
task->handles[1] = this->_data_handles.at(leaf).particles;
task->handles[1] = this->_data_handles.at(w_item).symbolic;
task->handles[2] = this->_data_handles.at(leaf).particles;
task->cl_arg = this;
task->cl_arg_size = sizeof(this);
......@@ -554,25 +562,31 @@ private:
void init_P2L_codelet() {
starpu_codelet_init(&this->P2L_cl);
this->P2L_cl.name = "P2L";
this->P2L_cl.cpu_funcs[0] = P2L_cpu;
this->P2L_cl.cpu_funcs_name[0] = {const_cast<char*>("P2L task")};
this->P2L_cl.nbuffers = 2; // {0: leaf particles, 1: node local exp}
this->P2L_cl.nbuffers = 3; // {0: leaf particles, 1: node symb, 2: node local exp}
this->P2L_cl.modes[0] = STARPU_RW;
this->P2L_cl.modes[1] = STARPU_R;
this->P2L_cl.modes[2] = STARPU_R;
}
static void P2L_cpu(void** buffers, void* cl_arg) {
typename tree_t::node_t::data_t::local_expansion_t* leaf_local_exp =
typename tree_t::node_t::data_t::local_expansion_t* node_local_exp =
(typename tree_t::node_t::data_t::local_expansion_t*)
STARPU_VARIABLE_GET_PTR(buffers[0]);
typename tree_t::node_t::symbolic_data_t* node_symb_data =
(typename tree_t::node_t::symbolic_data_t*)
STARPU_VARIABLE_GET_PTR(buffers[1]);
typename tree_t::node_t::particle_container_t* particle_container =
(typename tree_t::node_t::particle_container_t*)
STARPU_VARIABLE_GET_PTR(buffers[1]);
STARPU_VARIABLE_GET_PTR(buffers[2]);
auto algo = (FAdaptiveStarPU<tree_t, kernel_t>*) cl_arg;
kernel_t* ker = get_starpu_worker_kernel(algo);
ker->P2L(leaf_local_exp, particle_container);
ker->P2L(node_local_exp, node_symb_data, particle_container);
}
......@@ -682,13 +696,12 @@ private:
starpu_task* task = starpu_task_create();
task->cl = &(this->M2P_cl);
task->handles[0] = this->_data_handles.at(w_item).multipole;
task->handles[1] = this->_data_handles.at(leaf).particles;
task->handles[1] = this->_data_handles.at(w_item).symbolic;
task->handles[2] = this->_data_handles.at(leaf).particles;
task->cl_arg = this;
task->cl_arg_size = sizeof(this);
this->submit_starpu_task(task);
// _kernel.M2P(w_item->getData(), node->getParticleContainer());
}
}
}
......@@ -697,23 +710,28 @@ private:
starpu_codelet_init(&this->M2P_cl);
this->M2P_cl.cpu_funcs[0] = M2P_cpu;
this->M2P_cl.cpu_funcs_name[0] = {const_cast<char*>("M2P task")};
this->M2P_cl.nbuffers = 2; // {0: node multipole, 1: leaf particles}
this->M2P_cl.nbuffers = 3; // {0: node multipole, 1:node symb, 2: leaf particles}
this->M2P_cl.modes[0] = STARPU_R;
this->M2P_cl.modes[1] = STARPU_RW;
this->M2P_cl.modes[1] = STARPU_R;
this->M2P_cl.modes[2] = STARPU_RW;
}
static void M2P_cpu(void** buffers, void* cl_arg) {
typename tree_t::node_t::data_t::multipole_t* leaf_multipole =
typename tree_t::node_t::data_t::multipole_t* node_multipole =
(typename tree_t::node_t::data_t::multipole_t*)
STARPU_VARIABLE_GET_PTR(buffers[0]);
typename tree_t::node_t::symbolic_data_t* node_symb_data =
(typename tree_t::node_t::symbolic_data_t*)
STARPU_VARIABLE_GET_PTR(buffers[1]);
typename tree_t::node_t::particle_container_t* particle_container =
(typename tree_t::node_t::particle_container_t*)
STARPU_VARIABLE_GET_PTR(buffers[1]);
STARPU_VARIABLE_GET_PTR(buffers[2]);
auto algo = (FAdaptiveStarPU<tree_t, kernel_t>*) cl_arg;
kernel_t* ker = get_starpu_worker_kernel(algo);
ker->M2P(leaf_multipole, particle_container);
ker->M2P(node_multipole, node_symb_data, particle_container);
}
......@@ -729,7 +747,8 @@ private:
starpu_task* task = starpu_task_create();
task->cl = &(this->L2P_cl);
task->handles[0] = leaf_handles.local_exp;
task->handles[1] = leaf_handles.particles;
task->handles[1] = leaf_handles.symbolic;
task->handles[2] = leaf_handles.particles;
task->cl_arg = this;
task->cl_arg_size = sizeof(this);
......@@ -741,9 +760,10 @@ private:
starpu_codelet_init(&this->L2P_cl);
this->L2P_cl.cpu_funcs[0] = L2P_cpu;
this->L2P_cl.cpu_funcs_name[0] = {const_cast<char*>("L2P task")};
this->L2P_cl.nbuffers = 2; // {0: leaf local exp, 1: leaf particles}
this->L2P_cl.nbuffers = 3; // {0: leaf local exp, 1: leaf symb, 2: leaf particles}
this->L2P_cl.modes[0] = STARPU_R;
this->L2P_cl.modes[1] = STARPU_RW;
this->L2P_cl.modes[1] = STARPU_R;
this->L2P_cl.modes[2] = STARPU_RW;
}
static void L2P_cpu(void** buffers, void* cl_arg) {
......@@ -751,13 +771,17 @@ private:
(typename tree_t::node_t::data_t::local_expansion_t*)
STARPU_VARIABLE_GET_PTR(buffers[0]);
typename tree_t::node_t::symbolic_data_t* leaf_symb_data =
(typename tree_t::node_t::symbolic_data_t*)
STARPU_VARIABLE_GET_PTR(buffers[1]);
typename tree_t::node_t::particle_container_t* particle_container =
(typename tree_t::node_t::particle_container_t*)
STARPU_VARIABLE_GET_PTR(buffers[1]);
STARPU_VARIABLE_GET_PTR(buffers[2]);
auto algo = (FAdaptiveStarPU<tree_t, kernel_t>*) cl_arg;
kernel_t* ker = get_starpu_worker_kernel(algo);
ker->L2P(leaf_local_exp, particle_container);
ker->L2P(leaf_local_exp, leaf_symb_data, particle_container);
}
......@@ -876,7 +900,7 @@ private:
for(std::size_t i = 3; i < buffer_count; i += 2) {
const symb_data_t* u_item_symb = (symb_data_t*) STARPU_VARIABLE_GET_PTR(buffers[i]);
offset_indices.emplace_back(compute_box_offset_index(*node_symbolic, *u_item_symb, 3));
offset_indices.emplace_back(compute_box_offset_index(*node_symbolic, *u_item_symb, 1));
u_source_particles.emplace_back((container_t*) STARPU_VARIABLE_GET_PTR(buffers[i+1]));
}
......
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