From 6d369f9cc56bd13db45f50372754d56769b852a3 Mon Sep 17 00:00:00 2001 From: Bert Vandenbroucke Date: Thu, 9 Dec 2021 09:40:03 +0100 Subject: [PATCH] Moved no neighbour warnings for stars and BH from ghost loop to part_has_no_neighbours() to reduce output frequency. --- src/black_holes/Default/black_holes.h | 5 +++++ src/black_holes/EAGLE/black_holes.h | 5 +++++ src/runner_ghost.c | 10 ---------- src/stars/Basic/stars.h | 5 +++++ src/stars/EAGLE/stars.h | 5 +++++ src/stars/GEAR/stars.h | 5 +++++ 6 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/black_holes/Default/black_holes.h b/src/black_holes/Default/black_holes.h index a65651d6b..9ad243cc8 100644 --- a/src/black_holes/Default/black_holes.h +++ b/src/black_holes/Default/black_holes.h @@ -134,6 +134,11 @@ __attribute__((always_inline)) INLINE static void black_holes_bpart_has_no_neighbours(struct bpart* restrict bp, const struct cosmology* cosmo) { + warning( + "BH particle with ID %lld treated as having no neighbours (h: %g, " + "wcount: %g).", + bp->id, bp->h, bp->density.wcount); + /* Some smoothing length multiples. */ const float h = bp->h; const float h_inv = 1.0f / h; /* 1/h */ diff --git a/src/black_holes/EAGLE/black_holes.h b/src/black_holes/EAGLE/black_holes.h index ce4a1dccf..8fe6222f1 100644 --- a/src/black_holes/EAGLE/black_holes.h +++ b/src/black_holes/EAGLE/black_holes.h @@ -311,6 +311,11 @@ __attribute__((always_inline)) INLINE static void black_holes_bpart_has_no_neighbours(struct bpart* bp, const struct cosmology* cosmo) { + warning( + "BH particle with ID %lld treated as having no neighbours (h: %g, " + "wcount: %g).", + bp->id, bp->h, bp->density.wcount); + /* Some smoothing length multiples. */ const float h = bp->h; const float h_inv = 1.0f / h; /* 1/h */ diff --git a/src/runner_ghost.c b/src/runner_ghost.c index dc28208aa..6de0b59b5 100644 --- a/src/runner_ghost.c +++ b/src/runner_ghost.c @@ -169,11 +169,6 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) { if (sp->density.wcount < 1.e-5 * kernel_root) { /* No neighbours case */ - warning( - "Star particle with ID %lld treated as having no neighbours (h: " - "%g, wcount: %g).", - sp->id, sp->h, sp->density.wcount); - /* Flag that there were no neighbours */ has_no_neighbours = 1; @@ -659,11 +654,6 @@ void runner_do_black_holes_density_ghost(struct runner *r, struct cell *c, if (bp->density.wcount < 1.e-5 * kernel_root) { /* No neighbours case */ - warning( - "BH particle with ID %lld treated as having no neighbours (h: " - "%g, wcount: %g).", - bp->id, bp->h, bp->density.wcount); - /* Flag that there were no neighbours */ has_no_neighbours = 1; diff --git a/src/stars/Basic/stars.h b/src/stars/Basic/stars.h index 45639cbbf..5e1441f00 100644 --- a/src/stars/Basic/stars.h +++ b/src/stars/Basic/stars.h @@ -164,6 +164,11 @@ __attribute__((always_inline)) INLINE static void stars_end_density( __attribute__((always_inline)) INLINE static void stars_spart_has_no_neighbours( struct spart* restrict sp, const struct cosmology* cosmo) { + warning( + "Star particle with ID %lld treated as having no neighbours (h: %g, " + "wcount: %g).", + sp->id, sp->h, sp->density.wcount); + /* Some smoothing length multiples. */ const float h = sp->h; const float h_inv = 1.0f / h; /* 1/h */ diff --git a/src/stars/EAGLE/stars.h b/src/stars/EAGLE/stars.h index 8aff37d88..75ee2a0d1 100644 --- a/src/stars/EAGLE/stars.h +++ b/src/stars/EAGLE/stars.h @@ -228,6 +228,11 @@ __attribute__((always_inline)) INLINE static void stars_end_density( __attribute__((always_inline)) INLINE static void stars_spart_has_no_neighbours( struct spart* restrict sp, const struct cosmology* cosmo) { + warning( + "Star particle with ID %lld treated as having no neighbours (h: %g, " + "wcount: %g).", + sp->id, sp->h, sp->density.wcount); + /* Re-set problematic values */ sp->density.wcount = 0.f; sp->density.wcount_dh = 0.f; diff --git a/src/stars/GEAR/stars.h b/src/stars/GEAR/stars.h index a03827a20..28180b7b8 100644 --- a/src/stars/GEAR/stars.h +++ b/src/stars/GEAR/stars.h @@ -169,6 +169,11 @@ __attribute__((always_inline)) INLINE static void stars_end_density( __attribute__((always_inline)) INLINE static void stars_spart_has_no_neighbours( struct spart* restrict sp, const struct cosmology* cosmo) { + warning( + "Star particle with ID %lld treated as having no neighbours (h: %g, " + "wcount: %g).", + sp->id, sp->h, sp->density.wcount); + /* Re-set problematic values */ sp->density.wcount = 0.f; sp->density.wcount_dh = 0.f; -- GitLab