diff --git a/examples/IsolatedGalaxy/IsolatedGalaxy_starformation/isolated_galaxy.yml b/examples/IsolatedGalaxy/IsolatedGalaxy_starformation/isolated_galaxy.yml index e96d3520a08e12228774f13d7d0740afc009669d..1bf7689b995074e53109627d84a837980a95bcc7 100644 --- a/examples/IsolatedGalaxy/IsolatedGalaxy_starformation/isolated_galaxy.yml +++ b/examples/IsolatedGalaxy/IsolatedGalaxy_starformation/isolated_galaxy.yml @@ -35,9 +35,9 @@ Statistics: # Parameters related to the initial conditions InitialConditions: - file_name: lowres8.hdf5 # The file to read - periodic: 0 # Are we running with periodic ICs? - stars_smoothing_length: 0.5 + file_name: fid.hdf5 # The file to read + periodic: 0 # Are we running with periodic ICs? + stars_smoothing_length: 0.5 # Parameters for the hydrodynamics scheme SPH: diff --git a/src/cell.h b/src/cell.h index 40d525c7fd49a5ffd858fc5b28e8ca69b17d6b3c..c11cbbc741bb47e2683d949772d0e3f1712f54a4 100644 --- a/src/cell.h +++ b/src/cell.h @@ -496,8 +496,10 @@ struct cell { /*! The drift task for sparts */ struct task *drift; + /*! Implicit tasks marking the entry of the stellar physics block of tasks */ struct task *stars_in; + /*! Implicit tasks marking the exit of the stellar physics block of tasks */ struct task *stars_out; /*! Max smoothing length in this cell. */ @@ -1042,12 +1044,9 @@ cell_need_rebuild_for_hydro_pair(const struct cell *ci, const struct cell *cj) { /* Is the cut-off radius plus the max distance the parts in both cells have */ /* moved larger than the cell size ? */ /* Note ci->dmin == cj->dmin */ - /*return*/ - if (kernel_gamma * max(ci->hydro.h_max, cj->hydro.h_max) + ci->hydro.dx_max_part + cj->hydro.dx_max_part > cj->dmin) { - // error("Need rebuild hydro!"); return 1; } return 0; @@ -1065,12 +1064,9 @@ cell_need_rebuild_for_stars_pair(const struct cell *ci, const struct cell *cj) { /* Is the cut-off radius plus the max distance the parts in both cells have */ /* moved larger than the cell size ? */ /* Note ci->dmin == cj->dmin */ - /* return */ - if (kernel_gamma * max(ci->stars.h_max, cj->hydro.h_max) + ci->stars.dx_max_part + cj->hydro.dx_max_part > cj->dmin) { - // error("Need rebuild stars!"); return 1; } return 0; diff --git a/src/error.h b/src/error.h index 181a32c78b4ef09708eeade002157157895ddde5..d384ec56ba0dc3562160d94911e3e3d3bb786211 100644 --- a/src/error.h +++ b/src/error.h @@ -54,7 +54,7 @@ extern int engine_rank; fprintf(stderr, "[%04i] %s %s:%s():%i: " s "\n", engine_rank, \ clocks_get_timesincestart(), __FILE__, __FUNCTION__, __LINE__, \ ##__VA_ARGS__); \ - swift_abort(1); \ + MPI_Abort(MPI_COMM_WORLD, -1); \ }) #else #define error(s, ...) \ diff --git a/src/runner.c b/src/runner.c index b07d8cd546f39b55883fa01a17d003c4eeeb8669..035e1ab3f3720be807a3ea8df71de726615c9c1c 100644 --- a/src/runner.c +++ b/src/runner.c @@ -558,11 +558,6 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) { /* Copy the properties of the gas particle to the star particle */ star_formation_copy_properties(p, xp, sp, e, sf_props, cosmo, with_cosmology); - - message( - "STAR FORMED!!!! c->ID=%d super->ID=%d c->depth=%d" - "c->maxdepth=%d", - c->cellID, c->super->cellID, c->depth, c->maxdepth); } } else { /* Are we not star-forming? */ @@ -576,11 +571,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) { } /* Loop over particles */ } + /* If we formed any stars, the star sorts are now invalid. We need to + * re-compute them. */ if ((c == c->hydro.super) && (current_stars_count != c->stars.count)) { - message( - "Emergency sort! c->ID=%d c->depth=%d c->maxdepth=%d c=%p c->super=%p", - c->cellID, c->depth, c->maxdepth, c, c->hydro.super); - cell_clear_stars_sort_flags(c, /*is_super=*/1); runner_do_stars_sort(r, c, 0x1FFF, /*cleanup=*/0, /*timer=*/0); } @@ -2775,11 +2768,10 @@ void runner_do_end_grav_force(struct runner *r, struct cell *c, int timer) { e->total_nr_gparts, e->s->nr_gparts, e->count_inhibited_gparts); } } - } #endif + } } } - if (timer) TIMER_TOC(timer_end_grav_force); } @@ -2793,7 +2785,6 @@ void runner_do_end_grav_force(struct runner *r, struct cell *c, int timer) { */ void runner_do_recv_part(struct runner *r, struct cell *c, int clear_sorts, int timer) { - #ifdef WITH_MPI const struct part *restrict parts = c->hydro.parts; @@ -2862,7 +2853,7 @@ void runner_do_recv_part(struct runner *r, struct cell *c, int clear_sorts, if (timer) TIMER_TOC(timer_dorecv_part); #else - error("SWIFT was not compiled with MPI support."); + error("SWIFT was not compiled with MPI support."); #endif } @@ -2936,7 +2927,7 @@ void runner_do_recv_gpart(struct runner *r, struct cell *c, int timer) { if (timer) TIMER_TOC(timer_dorecv_gpart); #else - error("SWIFT was not compiled with MPI support."); + error("SWIFT was not compiled with MPI support."); #endif } @@ -3022,7 +3013,7 @@ void runner_do_recv_spart(struct runner *r, struct cell *c, int clear_sorts, if (timer) TIMER_TOC(timer_dorecv_spart); #else - error("SWIFT was not compiled with MPI support."); + error("SWIFT was not compiled with MPI support."); #endif } @@ -3373,6 +3364,6 @@ void runner_do_logger(struct runner *r, struct cell *c, int timer) { if (timer) TIMER_TOC(timer_logger); #else - error("Logger disabled, please enable it during configuration"); + error("Logger disabled, please enable it during configuration"); #endif } diff --git a/src/runner_doiact_stars.h b/src/runner_doiact_stars.h index 4fa18328bca4014967921872b7fa9c3e63c078f7..f1210acad8b0e47a815b62d3c2d9c64cdd051931 100644 --- a/src/runner_doiact_stars.h +++ b/src/runner_doiact_stars.h @@ -1413,10 +1413,7 @@ void DOSUB_PAIR1_STARS(struct runner *r, struct cell *ci, struct cell *cj, if (!(cj->stars.sorted & (1 << sid)) || cj->stars.dx_max_sort_old > cj->dmin * space_maxreldx) { - error( - "Interacting unsorted cell (sparts)." - "c->stars.count=%d c->cellID=%d", - cj->stars.count, cj->cellID); + error("Interacting unsorted cell (sparts)."); } } diff --git a/src/scheduler.c b/src/scheduler.c index e3f4462252a18f15b7bf25f73bee163fd84570af..6f96b0ea93672b03a7ebd6874c3c9dbf7b618a74 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -100,9 +100,7 @@ static void scheduler_extend_unlocks(struct scheduler *s) { void scheduler_addunlock(struct scheduler *s, struct task *ta, struct task *tb) { #ifdef SWIFT_DEBUG_CHECKS - if (ta == NULL) - error("Unlocking task is NULL. tb=%s/%s", taskID_names[tb->type], - subtaskID_names[tb->subtype]); + if (ta == NULL) error("Unlocking task is NULL."); if (tb == NULL) error("Unlocked task is NULL."); #endif @@ -2095,6 +2093,9 @@ void scheduler_reweight(struct scheduler *s, int verbose) { case task_type_end_hydro_force: cost = wscale * count_i; break; + case task_type_end_grav_force: + cost = wscale * gcount_i; + break; case task_type_kick1: cost = wscale * count_i + wscale * gcount_i; break; diff --git a/src/scheduler.h b/src/scheduler.h index bc87f27f73c3760f4292f0f5bf6534e995b4abee..3fb1c2e43bddd73a08edd40c9c2969ea20ee6d39 100644 --- a/src/scheduler.h +++ b/src/scheduler.h @@ -121,9 +121,6 @@ struct scheduler { __attribute__((always_inline)) INLINE static void scheduler_activate( struct scheduler *s, struct task *t) { - /* if(t->type == task_type_stars_sort) */ - /* message("Activating stars sort!!!"); */ - if (atomic_cas(&t->skip, 1, 0)) { t->wait = 0; int ind = atomic_inc(&s->active_count); diff --git a/src/space.c b/src/space.c index a9bf4ceb832a92d085853895335e5b5428330961..0d7621d4809662ec513c2717722d13871540470e 100644 --- a/src/space.c +++ b/src/space.c @@ -331,11 +331,9 @@ void space_regrid(struct space *s, int verbose) { const struct cell *c = &s->cells_top[s->local_cells_with_particles_top[k]]; if (c->hydro.h_max > h_max) { - message("hydro h_max=%e", c->hydro.h_max); h_max = c->hydro.h_max; } if (c->stars.h_max > h_max) { - message("stars h_max=%e", c->stars.h_max); h_max = c->stars.h_max; } } diff --git a/src/stars/Default/stars_iact.h b/src/stars/Default/stars_iact.h index 56cd570d6c1338c340ac809ae5302c66de723c85..994ff98d01920124081598d7e6758c929c6d0b2f 100644 --- a/src/stars/Default/stars_iact.h +++ b/src/stars/Default/stars_iact.h @@ -78,8 +78,6 @@ runner_iact_nonsym_stars_feedback(float r2, const float *dx, float hi, float hj, /* Get the time derivative for h. */ si->feedback.h_dt -= mj * dvdr * ri / rhoj * wi_dr; - // message("Feedback!"); - #ifdef DEBUG_INTERACTIONS_STARS /* Update ngb counters */ if (si->num_ngb_force < MAX_NUM_OF_NEIGHBOURS_STARS) diff --git a/tools/task_plots/analyse_tasks.py b/tools/task_plots/analyse_tasks.py index e897424a95be8937073bd16adf108fa4fa1456ad..fc9df0e4797cfb16e883df551af30dc0d3244edc 100755 --- a/tools/task_plots/analyse_tasks.py +++ b/tools/task_plots/analyse_tasks.py @@ -76,9 +76,10 @@ TASKTYPES = [ "ghost_out", "extra_ghost", "drift_part", + "drift_spart", "drift_gpart", "drift_gpart_out", - "end_force", + "hydro_end_force", "kick1", "kick2", "timestep", @@ -90,9 +91,12 @@ TASKTYPES = [ "grav_down_in", "grav_down", "grav_mesh", + "grav_end_force", "cooling", "star_formation", "logger", + "stars_in", + "stars_out", "stars_ghost_in", "stars_ghost", "stars_ghost_out", diff --git a/tools/task_plots/plot_tasks.py b/tools/task_plots/plot_tasks.py index 12fd4d241a268c9d45fd72f5cdda2727221ba94d..54f34b2f828895d894b84253e366173827c03158 100755 --- a/tools/task_plots/plot_tasks.py +++ b/tools/task_plots/plot_tasks.py @@ -161,9 +161,10 @@ TASKTYPES = [ "ghost_out", "extra_ghost", "drift_part", + "drift_spart", "drift_gpart", "drift_gpart_out", - "end_force", + "hydro_end_force", "kick1", "kick2", "timestep", @@ -175,9 +176,12 @@ TASKTYPES = [ "grav_down_in", "grav_down", "grav_mesh", + "grav_end_force", "cooling", "star_formation", "logger", + "stars_in", + "stars_out", "stars_ghost_in", "stars_ghost", "stars_ghost_out", @@ -232,6 +236,8 @@ FULLTYPES = [ "send/tend", "recv/gpart", "send/gpart", + "recv/spart", + "send/spart", "self/stars_density", "pair/stars_density", "sub_self/stars_density",