Commit 56191869 authored by Berenger Bramas's avatar Berenger Bramas
Browse files

Ensure that the interval is correct by hard checking with the limite

parent f066e8d5
Pipeline #101779 failed with stages
in 13 minutes and 51 seconds
......@@ -231,8 +231,7 @@ public:
const long double field_section_width_z = spatial_box_width[IDXC_Z]/(long double)(field_grid_dim[IDXC_Z]);
const long int limite = static_cast<long int>((field_section_width_z*(long double)(partition_interval_offset_per_proc[dest_proc+1])
- std::numeric_limits<long double>::epsilon())/cutoff_radius);
if(static_cast<long double>(limite)*cutoff_radius
== field_section_width_z*(long double)(partition_interval_offset_per_proc[dest_proc+1])){
if(limite == nb_cell_levels[IDXC_Z]){
return limite-1;
}
return limite;
......@@ -297,7 +296,9 @@ public:
}
const long int my_top_z_cell_level = last_cell_level_proc(my_rank);
assert(my_top_z_cell_level < nb_cell_levels[IDXC_Z]);
const long int my_down_z_cell_level = first_cell_level_proc(my_rank);
assert(0 <= my_down_z_cell_level);
const long int my_nb_cell_levels = 1+my_top_z_cell_level-my_down_z_cell_level;
current_offset_particles_for_partition[0] = 0;
......@@ -443,8 +444,8 @@ public:
{
int dest_proc = (my_rank+1)%nb_processes_involved;
while(dest_proc != my_rank
&& (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])){
&& (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))){
// 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
......@@ -467,12 +468,12 @@ public:
int src_proc = (my_rank-1+nb_processes_involved)%nb_processes_involved;
while(src_proc != my_rank
&& (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])){
&& (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)){
// 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)%nb_cell_levels[IDXC_Z] <= (my_down_z_cell_level-1+2)%nb_cell_levels[IDXC_Z]){
&& first_cell_level_proc(src_proc) <= (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);
......
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