Skip to content
Snippets Groups Projects
Commit c4af3c0d authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Corrected documentation and removed MPI exception.

parent bdfd6679
No related branches found
No related tags found
1 merge request!292Drift on demand
...@@ -30,11 +30,9 @@ ...@@ -30,11 +30,9 @@
/** /**
* @brief Check that a cell been drifted to the current time. * @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 c The #cell.
* @param e The #engine containing information about the current time. * @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( __attribute__((always_inline)) INLINE static int cell_is_drifted(
const struct cell *c, const struct engine *e) { const struct cell *c, const struct engine *e) {
...@@ -55,6 +53,7 @@ __attribute__((always_inline)) INLINE static int cell_is_drifted( ...@@ -55,6 +53,7 @@ __attribute__((always_inline)) INLINE static int cell_is_drifted(
* *
* @param c The #cell. * @param c The #cell.
* @param e The #engine containing information about the current time. * @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( __attribute__((always_inline)) INLINE static int cell_is_active(
const struct cell *c, const struct engine *e) { const struct cell *c, const struct engine *e) {
...@@ -73,6 +72,7 @@ __attribute__((always_inline)) INLINE static int cell_is_active( ...@@ -73,6 +72,7 @@ __attribute__((always_inline)) INLINE static int cell_is_active(
* *
* @param c The #cell. * @param c The #cell.
* @param e The #engine containing information about the current time. * @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( __attribute__((always_inline)) INLINE static int cell_is_all_active(
const struct cell *c, const struct engine *e) { const struct cell *c, const struct engine *e) {
...@@ -91,6 +91,7 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active( ...@@ -91,6 +91,7 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active(
* *
* @param p The #part. * @param p The #part.
* @param e The #engine containing information about the current time. * @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( __attribute__((always_inline)) INLINE static int part_is_active(
const struct part *p, const struct engine *e) { const struct part *p, const struct engine *e) {
...@@ -109,6 +110,7 @@ __attribute__((always_inline)) INLINE static int part_is_active( ...@@ -109,6 +110,7 @@ __attribute__((always_inline)) INLINE static int part_is_active(
* *
* @param gp The #gpart. * @param gp The #gpart.
* @param e The #engine containing information about the current time. * @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( __attribute__((always_inline)) INLINE static int gpart_is_active(
const struct gpart *gp, const struct engine *e) { const struct gpart *gp, const struct engine *e) {
......
...@@ -2684,7 +2684,7 @@ int engine_is_done(struct engine *e) { ...@@ -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. * @param e The #engine.
*/ */
...@@ -2699,6 +2699,11 @@ void engine_unskip(struct engine *e) { ...@@ -2699,6 +2699,11 @@ void engine_unskip(struct engine *e) {
clocks_getunit()); clocks_getunit());
} }
/**
* @brief Drift *all* particles forward to the current time.
*
* @param e The #engine.
*/
void engine_drift_all(struct engine *e) { void engine_drift_all(struct engine *e) {
const ticks tic = getticks(); const ticks tic = getticks();
......
...@@ -757,7 +757,7 @@ static void runner_do_unskip(struct cell *c, struct engine *e) { ...@@ -757,7 +757,7 @@ static void runner_do_unskip(struct cell *c, struct engine *e) {
if (forcerebuild) atomic_inc(&e->forcerebuild); if (forcerebuild) atomic_inc(&e->forcerebuild);
} }
/* Not drifting, but may still need to recurse for task un-skipping. */ /* Recurse */
if (c->split) { if (c->split) {
for (int k = 0; k < 8; k++) { for (int k = 0; k < 8; k++) {
if (c->progeny[k] != NULL) { if (c->progeny[k] != NULL) {
...@@ -783,11 +783,7 @@ void runner_do_unskip_mapper(void *map_data, int num_elements, ...@@ -783,11 +783,7 @@ void runner_do_unskip_mapper(void *map_data, int num_elements,
for (int ind = 0; ind < num_elements; ind++) { for (int ind = 0; ind < num_elements; ind++) {
struct cell *c = &cells[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); if (c != NULL) runner_do_unskip(c, e);
#endif
} }
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment