Skip to content
Snippets Groups Projects
Commit 43d8be2d authored by Peter W. Draper's avatar Peter W. Draper
Browse files

After repartitioning don't check if all cells have been drifted

Post repartition we can have cells if a bad state if they have previously been inactive on a rank (so they hold particles, but the cell data do not match)
parent ec28f9d0
Branches
Tags
2 merge requests!304Star particle infrastructure,!303MPI send/recv fixes for inactive cells
......@@ -2291,15 +2291,16 @@ void engine_rebuild(struct engine *e) {
* @param drift_all Whether to drift particles before rebuilding or not. Will
* not be necessary if all particles have already been
* drifted (before repartitioning for instance).
* @param deferskip Whether to defer the skip until after the rebuild.
* Needed after a repartition.
* @param postrepart If we have just repartitioned, if so we need to defer the
* skip until after the rebuild and not check the if all
* cells have been drifted.
*/
void engine_prepare(struct engine *e, int drift_all, int deferskip) {
void engine_prepare(struct engine *e, int drift_all, int postrepart) {
TIMER_TIC;
/* Unskip active tasks and check for rebuild */
if (!deferskip) engine_unskip(e);
if (!postrepart) engine_unskip(e);
/* Run through the tasks and mark as skip or not. */
int rebuild = e->forcerebuild;
......@@ -2320,13 +2321,15 @@ void engine_prepare(struct engine *e, int drift_all, int deferskip) {
if (drift_all) engine_drift_all(e);
#ifdef SWIFT_DEBUG_CHECKS
/* Check that all cells have been drifted to the current time */
space_check_drift_point(e->s, e->ti_current);
/* Check that all cells have been drifted to the current time, unless
* we have just repartitioned, that can include cells that have not
* previously been active on this rank. */
if (!postrepart) space_check_drift_point(e->s, e->ti_current);
#endif
engine_rebuild(e);
}
if (deferskip) engine_unskip(e);
if (postrepart) engine_unskip(e);
/* Re-rank the tasks every now and then. */
if (e->tasks_age % engine_tasksreweight == 1) {
......
......@@ -225,7 +225,7 @@ void engine_init(struct engine *e, struct space *s,
const struct cooling_function_data *cooling,
struct sourceterms *sourceterms);
void engine_launch(struct engine *e, int nr_runners);
void engine_prepare(struct engine *e, int drift_all, int deferskip);
void engine_prepare(struct engine *e, int drift_all, int postrepart);
void engine_print(struct engine *e);
void engine_init_particles(struct engine *e, int flag_entropy_ICs);
void engine_step(struct engine *e);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment