Redistribute gparts
Initial version of engine_redistribute()
which sends around the gparts as well as the parts + preserves their links.
@nnrw56 what do you think ?
I'll need to update some bits later to take into account your changes to the MPI_types and the new version of space_part_sort()
Merge request reports
Activity
213 int current_dest = dest[0]; 214 size_t count_this_dest = 0; 215 for (size_t k = 0; k < s->nr_parts; ++k) { 216 if (s->parts[k].gpart != NULL) { 217 218 /* As the addresses will be invalidated by the communications, we will */ 219 /* instead store the absolute index from the start of the sub-array */ 220 /* of particles to be sent to a given node. */ 221 /* Recall that gparts without partners have a negative id. */ 222 /* We will restore the pointers on the receiving node later on. */ 223 if (dest[k] != current_dest) { 224 current_dest = dest[k]; 225 count_this_dest = 0; 226 } 227 228 s->parts[k].gpart->id = count_this_dest; Added 1 commit:
- 78c2c26e - Missing increment
213 int current_dest = dest[0]; 214 size_t count_this_dest = 0; 215 for (size_t k = 0; k < s->nr_parts; ++k) { 216 if (s->parts[k].gpart != NULL) { 217 218 /* As the addresses will be invalidated by the communications, we will */ 219 /* instead store the absolute index from the start of the sub-array */ 220 /* of particles to be sent to a given node. */ 221 /* Recall that gparts without partners have a negative id. */ 222 /* We will restore the pointers on the receiving node later on. */ 223 if (dest[k] != current_dest) { 224 current_dest = dest[k]; 225 count_this_dest = 0; 226 } 227 228 s->parts[k].gpart->id = count_this_dest; LGTM, all yours @pdraper!
Reassigned to @pdraper
mentioned in commit 95b97ce3
mentioned in issue #130 (closed)
Please register or sign in to reply