Commit bb5ea549 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Better threshold for maximal distance a particle can have moved from its cell when using MPI

parent 573af0fd
...@@ -370,11 +370,11 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted( ...@@ -370,11 +370,11 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
const float shift_threshold_x = const float shift_threshold_x =
2. * ci->width[0] + max(ci->dx_max_part, cj->dx_max_part); 2. * ci->width[0] + 2. * max(ci->dx_max_part, cj->dx_max_part);
const float shift_threshold_y = const float shift_threshold_y =
2. * ci->width[1] + max(ci->dx_max_part, cj->dx_max_part); 2. * ci->width[1] + 2. * max(ci->dx_max_part, cj->dx_max_part);
const float shift_threshold_z = const float shift_threshold_z =
2. * ci->width[2] + max(ci->dx_max_part, cj->dx_max_part); 2. * ci->width[2] + 2. * max(ci->dx_max_part, cj->dx_max_part);
/* Make sure that particle positions have been shifted correctly. */ /* Make sure that particle positions have been shifted correctly. */
for (int i = 0; i < ci_cache_count; i++) { for (int i = 0; i < ci_cache_count; i++) {
......
...@@ -811,11 +811,11 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid, ...@@ -811,11 +811,11 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
/* Some constants used to checks that the parts are in the right frame */ /* Some constants used to checks that the parts are in the right frame */
const float shift_threshold_x = const float shift_threshold_x =
2. * ci->width[0] + max(ci->dx_max_part, cj->dx_max_part); 2. * ci->width[0] + 2. * max(ci->dx_max_part, cj->dx_max_part);
const float shift_threshold_y = const float shift_threshold_y =
2. * ci->width[1] + max(ci->dx_max_part, cj->dx_max_part); 2. * ci->width[1] + 2. * max(ci->dx_max_part, cj->dx_max_part);
const float shift_threshold_z = const float shift_threshold_z =
2. * ci->width[2] + max(ci->dx_max_part, cj->dx_max_part); 2. * ci->width[2] + 2. * max(ci->dx_max_part, cj->dx_max_part);
#endif /* SWIFT_DEBUG_CHECKS */ #endif /* SWIFT_DEBUG_CHECKS */
...@@ -1114,11 +1114,11 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) { ...@@ -1114,11 +1114,11 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
/* Some constants used to checks that the parts are in the right frame */ /* Some constants used to checks that the parts are in the right frame */
const float shift_threshold_x = const float shift_threshold_x =
2. * ci->width[0] + max(ci->dx_max_part, cj->dx_max_part); 2. * ci->width[0] + 2. * max(ci->dx_max_part, cj->dx_max_part);
const float shift_threshold_y = const float shift_threshold_y =
2. * ci->width[1] + max(ci->dx_max_part, cj->dx_max_part); 2. * ci->width[1] + 2. * max(ci->dx_max_part, cj->dx_max_part);
const float shift_threshold_z = const float shift_threshold_z =
2. * ci->width[2] + max(ci->dx_max_part, cj->dx_max_part); 2. * ci->width[2] + 2. * max(ci->dx_max_part, cj->dx_max_part);
#endif /* SWIFT_DEBUG_CHECKS */ #endif /* SWIFT_DEBUG_CHECKS */
......
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