Commit 73ed13b4 authored by Berenger Bramas's avatar Berenger Bramas
Browse files

Add module to ensure processes compare within 0 ; nb_cell_levels[IDXC_Z]-1

parent e7f16b81
Pipeline #101705 passed with stages
in 36 minutes and 3 seconds
......@@ -443,15 +443,15 @@ public:
{
int dest_proc = (my_rank+1)%nb_processes_involved;
while(dest_proc != my_rank
&& (my_top_z_cell_level == first_cell_level_proc(dest_proc)
|| (my_top_z_cell_level+1)%nb_cell_levels[IDXC_Z] == first_cell_level_proc(dest_proc))){
DEBUG_MSG("looking at dest_proc = %d\n", dest_proc);
&& (my_top_z_cell_level%nb_cell_levels[IDXC_Z] == first_cell_level_proc(dest_proc)%nb_cell_levels[IDXC_Z]
|| (my_top_z_cell_level+1)%nb_cell_levels[IDXC_Z] == first_cell_level_proc(dest_proc)%nb_cell_levels[IDXC_Z])){
// Find if we have to send 1 or 2 cell levels
int nb_levels_to_send = 1;
if(my_nb_cell_levels > 1 // I have more than one level
&& (my_top_z_cell_level-1+2)%nb_cell_levels[IDXC_Z] <= last_cell_level_proc(dest_proc)){
nb_levels_to_send += 1;
}
DEBUG_MSG("looking at dest_proc = %d ; nb_levels_to_send = %d\n", dest_proc, nb_levels_to_send);
NeighborDescriptor descriptor;
descriptor.destProc = dest_proc;
......@@ -467,15 +467,15 @@ public:
int src_proc = (my_rank-1+nb_processes_involved)%nb_processes_involved;
while(src_proc != my_rank
&& (last_cell_level_proc(src_proc) == my_down_z_cell_level
|| (last_cell_level_proc(src_proc)+1)%nb_cell_levels[IDXC_Z] == my_down_z_cell_level)){
DEBUG_MSG("looking at src_proc = %d\n", src_proc);
&& (last_cell_level_proc(src_proc)%nb_cell_levels[IDXC_Z] == my_down_z_cell_level%nb_cell_levels[IDXC_Z]
|| (last_cell_level_proc(src_proc)+1)%nb_cell_levels[IDXC_Z] == my_down_z_cell_level%nb_cell_levels[IDXC_Z])){
// Find if we have to send 1 or 2 cell levels
int nb_levels_to_recv = 1;
if(my_nb_cell_levels > 1 // I have more than one level
&& first_cell_level_proc(src_proc) <= (my_down_z_cell_level-1+2)%nb_cell_levels[IDXC_Z]){
&& first_cell_level_proc(src_proc)%nb_cell_levels[IDXC_Z] <= (my_down_z_cell_level-1+2)%nb_cell_levels[IDXC_Z]){
nb_levels_to_recv += 1;
}
DEBUG_MSG("looking at src_proc = %d ; nb_levels_to_recv = %d\n", src_proc, nb_levels_to_recv);
NeighborDescriptor descriptor;
descriptor.destProc = src_proc;
......
Supports Markdown
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