diff --git a/src/active.h b/src/active.h index df7cbd6a63cccbfcf915de0008debe3e0cab8621..e34ba0961ccf9555a3588332cd182563c934cd4e 100644 --- a/src/active.h +++ b/src/active.h @@ -30,11 +30,9 @@ /** * @brief Check that a cell been drifted to the current time. * - * Only used for debugging. Calls error() if the cell has not - * been drifted. Does nothing if SWIFT_DEBUG_CHECKS is not defined. - * * @param c The #cell. * @param e The #engine containing information about the current time. + * @return 1 if the #cell has been drifted to the current time, 0 otherwise. */ __attribute__((always_inline)) INLINE static int cell_is_drifted( const struct cell *c, const struct engine *e) { @@ -55,6 +53,7 @@ __attribute__((always_inline)) INLINE static int cell_is_drifted( * * @param c The #cell. * @param e The #engine containing information about the current time. + * @param 1 if the #cell contains at least an active particle, 0 otherwise. */ __attribute__((always_inline)) INLINE static int cell_is_active( const struct cell *c, const struct engine *e) { @@ -73,6 +72,7 @@ __attribute__((always_inline)) INLINE static int cell_is_active( * * @param c The #cell. * @param e The #engine containing information about the current time. + * @param 1 if all particles in a #cell are active, 0 otherwise. */ __attribute__((always_inline)) INLINE static int cell_is_all_active( const struct cell *c, const struct engine *e) { @@ -91,6 +91,7 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active( * * @param p The #part. * @param e The #engine containing information about the current time. + * @return 1 if the #part is active, 0 otherwise. */ __attribute__((always_inline)) INLINE static int part_is_active( const struct part *p, const struct engine *e) { @@ -109,6 +110,7 @@ __attribute__((always_inline)) INLINE static int part_is_active( * * @param gp The #gpart. * @param e The #engine containing information about the current time. + * @return 1 if the #gpart is active, 0 otherwise. */ __attribute__((always_inline)) INLINE static int gpart_is_active( const struct gpart *gp, const struct engine *e) { diff --git a/src/engine.c b/src/engine.c index fb14f07b987c29227ed4e442cd0e088d2de5b261..fb5f24eb45f8de7488d4dafcf75cdb48f5ccfd2b 100644 --- a/src/engine.c +++ b/src/engine.c @@ -2684,7 +2684,7 @@ int engine_is_done(struct engine *e) { } /** - * @brief Drift particles using the current engine drift policy. + * @brief Unskip all the tasks that act on active cells at this time. * * @param e The #engine. */ @@ -2699,6 +2699,11 @@ void engine_unskip(struct engine *e) { clocks_getunit()); } +/** + * @brief Drift *all* particles forward to the current time. + * + * @param e The #engine. + */ void engine_drift_all(struct engine *e) { const ticks tic = getticks(); diff --git a/src/runner.c b/src/runner.c index 11e66b0e6bfb14b07a8247cfec07e5ed4783a5e4..24003d960729814ceeb9b5e67ecd7c765d4215b9 100644 --- a/src/runner.c +++ b/src/runner.c @@ -757,7 +757,7 @@ static void runner_do_unskip(struct cell *c, struct engine *e) { if (forcerebuild) atomic_inc(&e->forcerebuild); } - /* Not drifting, but may still need to recurse for task un-skipping. */ + /* Recurse */ if (c->split) { for (int k = 0; k < 8; k++) { if (c->progeny[k] != NULL) { @@ -783,11 +783,7 @@ void runner_do_unskip_mapper(void *map_data, int num_elements, for (int ind = 0; ind < num_elements; ind++) { struct cell *c = &cells[ind]; -#ifdef WITH_MPI - if (c != NULL) runner_do_unskip(c, e); -#else if (c != NULL) runner_do_unskip(c, e); -#endif } } /**