From 0221451f78ac0123b4cf8e2c6571989e3fd0e93b Mon Sep 17 00:00:00 2001 From: William Roper <wjr21@sussex.ac.uk> Date: Mon, 15 Apr 2024 21:02:06 +0000 Subject: [PATCH] Remove deprecated `ti_end_max` --- src/runner_time_integration.c | 52 ++++++----------------------------- src/space_split.c | 25 ++++------------- 2 files changed, 15 insertions(+), 62 deletions(-) diff --git a/src/runner_time_integration.c b/src/runner_time_integration.c index fd0f0d10a0..83fe01b7e0 100644 --- a/src/runner_time_integration.c +++ b/src/runner_time_integration.c @@ -676,18 +676,14 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { int updated = 0, g_updated = 0, s_updated = 0, sink_updated = 0, b_updated = 0; - integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_end_max = 0, - ti_hydro_beg_max = 0; + integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_beg_max = 0; integertime_t ti_rt_end_min = max_nr_timesteps, ti_rt_beg_max = 0; integertime_t ti_rt_min_step_size = max_nr_timesteps; - integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_end_max = 0, - ti_gravity_beg_max = 0; - integertime_t ti_stars_end_min = max_nr_timesteps, ti_stars_end_max = 0, - ti_stars_beg_max = 0; - integertime_t ti_sinks_end_min = max_nr_timesteps, ti_sinks_end_max = 0, - ti_sinks_beg_max = 0; + integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_beg_max = 0; + integertime_t ti_stars_end_min = max_nr_timesteps, ti_stars_beg_max = 0; + integertime_t ti_sinks_end_min = max_nr_timesteps, ti_sinks_beg_max = 0; integertime_t ti_black_holes_end_min = max_nr_timesteps, - ti_black_holes_end_max = 0, ti_black_holes_beg_max = 0; + ti_black_holes_beg_max = 0; /* No children? */ if (!c->split) { @@ -762,7 +758,6 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { /* What is the next sync-point ? */ ti_hydro_end_min = min(ti_current + ti_new_step, ti_hydro_end_min); - ti_hydro_end_max = max(ti_current + ti_new_step, ti_hydro_end_max); /* What is the next starting point for this cell ? */ ti_hydro_beg_max = max(ti_current, ti_hydro_beg_max); @@ -772,8 +767,6 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { /* What is the next sync-point ? */ ti_gravity_end_min = min(ti_current + ti_new_step, ti_gravity_end_min); - ti_gravity_end_max = - max(ti_current + ti_new_step, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_gravity_beg_max = max(ti_current, ti_gravity_beg_max); @@ -802,7 +795,6 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { /* What is the next sync-point ? */ ti_hydro_end_min = min(ti_end, ti_hydro_end_min); - ti_hydro_end_max = max(ti_end, ti_hydro_end_max); /* What is the next starting point for this cell ? */ ti_hydro_beg_max = max(ti_beg, ti_hydro_beg_max); @@ -832,7 +824,6 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { /* What is the next sync-point ? */ ti_gravity_end_min = min(ti_end, ti_gravity_end_min); - ti_gravity_end_max = max(ti_end, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_gravity_beg_max = max(ti_beg, ti_gravity_beg_max); @@ -876,8 +867,6 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { /* What is the next sync-point ? */ ti_gravity_end_min = min(ti_current + ti_new_step, ti_gravity_end_min); - ti_gravity_end_max = - max(ti_current + ti_new_step, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_gravity_beg_max = max(ti_current, ti_gravity_beg_max); @@ -891,7 +880,6 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { /* What is the next sync-point ? */ ti_gravity_end_min = min(ti_end, ti_gravity_end_min); - ti_gravity_end_max = max(ti_end, ti_gravity_end_max); const integertime_t ti_beg = get_integer_time_begin(ti_current + 1, gp->time_bin); @@ -956,9 +944,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { g_updated++; ti_stars_end_min = min(ti_current + ti_new_step, ti_stars_end_min); - ti_stars_end_max = max(ti_current + ti_new_step, ti_stars_end_max); ti_gravity_end_min = min(ti_current + ti_new_step, ti_gravity_end_min); - ti_gravity_end_max = max(ti_current + ti_new_step, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_stars_beg_max = max(ti_current, ti_stars_beg_max); @@ -976,9 +962,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { get_integer_time_begin(ti_current + 1, sp->time_bin); ti_stars_end_min = min(ti_end, ti_stars_end_min); - ti_stars_end_max = max(ti_end, ti_stars_end_max); ti_gravity_end_min = min(ti_end, ti_gravity_end_min); - ti_gravity_end_max = max(ti_end, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_stars_beg_max = max(ti_beg, ti_stars_beg_max); @@ -1016,9 +1000,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { g_updated++; ti_sinks_end_min = min(ti_current + ti_new_step, ti_sinks_end_min); - ti_sinks_end_max = max(ti_current + ti_new_step, ti_sinks_end_max); ti_gravity_end_min = min(ti_current + ti_new_step, ti_gravity_end_min); - ti_gravity_end_max = max(ti_current + ti_new_step, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_sinks_beg_max = max(ti_current, ti_sinks_beg_max); @@ -1036,9 +1018,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { get_integer_time_begin(ti_current + 1, sink->time_bin); ti_sinks_end_min = min(ti_end, ti_sinks_end_min); - ti_sinks_end_max = max(ti_end, ti_sinks_end_max); ti_gravity_end_min = min(ti_end, ti_gravity_end_min); - ti_gravity_end_max = max(ti_end, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_sinks_beg_max = max(ti_beg, ti_sinks_beg_max); @@ -1093,10 +1073,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { ti_black_holes_end_min = min(ti_current + ti_new_step, ti_black_holes_end_min); - ti_black_holes_end_max = - max(ti_current + ti_new_step, ti_black_holes_end_max); ti_gravity_end_min = min(ti_current + ti_new_step, ti_gravity_end_min); - ti_gravity_end_max = max(ti_current + ti_new_step, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_black_holes_beg_max = max(ti_current, ti_black_holes_beg_max); @@ -1114,9 +1091,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, const int timer) { get_integer_time_begin(ti_current + 1, bp->time_bin); ti_black_holes_end_min = min(ti_end, ti_black_holes_end_min); - ti_black_holes_end_max = max(ti_end, ti_black_holes_end_max); ti_gravity_end_min = min(ti_end, ti_gravity_end_min); - ti_gravity_end_max = max(ti_end, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_black_holes_beg_max = max(ti_beg, ti_black_holes_beg_max); @@ -1340,10 +1315,8 @@ void runner_do_limiter(struct runner *r, struct cell *c, int force, if (c->nodeID != engine_rank) error("Limiting dt of a foreign cell is nope."); #endif - integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_end_max = 0, - ti_hydro_beg_max = 0; - integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_end_max = 0, - ti_gravity_beg_max = 0; + integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_beg_max = 0; + integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_beg_max = 0; /* Limit irrespective of cell flags? */ force = (force || cell_get_flag(c, cell_flag_do_hydro_limiter)); @@ -1435,7 +1408,6 @@ void runner_do_limiter(struct runner *r, struct cell *c, int force, /* What is the next sync-point ? */ ti_hydro_end_min = min(ti_end_new, ti_hydro_end_min); - ti_hydro_end_max = max(ti_end_new, ti_hydro_end_max); /* What is the next starting point for this cell ? */ ti_hydro_beg_max = max(ti_beg_new, ti_hydro_beg_max); @@ -1448,7 +1420,6 @@ void runner_do_limiter(struct runner *r, struct cell *c, int force, /* What is the next sync-point ? */ ti_gravity_end_min = min(ti_end_new, ti_gravity_end_min); - ti_gravity_end_max = max(ti_end_new, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_gravity_beg_max = max(ti_beg_new, ti_gravity_beg_max); @@ -1497,10 +1468,8 @@ void runner_do_sync(struct runner *r, struct cell *c, int force, if (c->nodeID != engine_rank) error("Syncing of a foreign cell is nope."); #endif - integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_end_max = 0, - ti_hydro_beg_max = 0; - integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_end_max = 0, - ti_gravity_beg_max = 0; + integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_beg_max = 0; + integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_beg_max = 0; /* Limit irrespective of cell flags? */ force = (force || cell_get_flag(c, cell_flag_do_hydro_sync)); @@ -1610,7 +1579,6 @@ void runner_do_sync(struct runner *r, struct cell *c, int force, /* What is the next sync-point ? */ ti_hydro_end_min = min(ti_current + ti_new_step, ti_hydro_end_min); - ti_hydro_end_max = max(ti_current + ti_new_step, ti_hydro_end_max); /* What is the next starting point for this cell ? */ ti_hydro_beg_max = max(ti_current, ti_hydro_beg_max); @@ -1624,8 +1592,6 @@ void runner_do_sync(struct runner *r, struct cell *c, int force, /* What is the next sync-point ? */ ti_gravity_end_min = min(ti_current + ti_new_step, ti_gravity_end_min); - ti_gravity_end_max = - max(ti_current + ti_new_step, ti_gravity_end_max); /* What is the next starting point for this cell ? */ ti_gravity_beg_max = max(ti_current, ti_gravity_beg_max); diff --git a/src/space_split.c b/src/space_split.c index 532ad03bad..43e020d5e5 100644 --- a/src/space_split.c +++ b/src/space_split.c @@ -74,18 +74,14 @@ void space_split_recursive(struct space *s, struct cell *c, float black_holes_h_max_active = 0.f; float sinks_h_max = 0.f; float sinks_h_max_active = 0.f; - integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_end_max = 0, - ti_hydro_beg_max = 0; + integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_beg_max = 0; integertime_t ti_rt_end_min = max_nr_timesteps, ti_rt_beg_max = 0; integertime_t ti_rt_min_step_size = max_nr_timesteps; - integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_end_max = 0, - ti_gravity_beg_max = 0; - integertime_t ti_stars_end_min = max_nr_timesteps, ti_stars_end_max = 0, - ti_stars_beg_max = 0; - integertime_t ti_sinks_end_min = max_nr_timesteps, ti_sinks_end_max = 0, - ti_sinks_beg_max = 0; + integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_beg_max = 0; + integertime_t ti_stars_end_min = max_nr_timesteps, ti_stars_beg_max = 0; + integertime_t ti_sinks_end_min = max_nr_timesteps, ti_sinks_beg_max = 0; integertime_t ti_black_holes_end_min = max_nr_timesteps, - ti_black_holes_end_max = 0, ti_black_holes_beg_max = 0; + ti_black_holes_beg_max = 0; struct part *parts = c->hydro.parts; struct gpart *gparts = c->grav.parts; struct spart *sparts = c->stars.parts; @@ -443,7 +439,7 @@ void space_split_recursive(struct space *s, struct cell *c, gravity_multipole_compute_power(&c->grav.multipole->m_pole); } /* Deal with gravity */ - } /* Split or let it be? */ + } /* Split or let it be? */ /* Otherwise, collect the data from the particles this cell. */ else { @@ -454,19 +450,15 @@ void space_split_recursive(struct space *s, struct cell *c, maxdepth = c->depth; ti_hydro_end_min = max_nr_timesteps; - ti_hydro_end_max = 0; ti_hydro_beg_max = 0; ti_gravity_end_min = max_nr_timesteps; - ti_gravity_end_max = 0; ti_gravity_beg_max = 0; ti_stars_end_min = max_nr_timesteps; - ti_stars_end_max = 0; ti_stars_beg_max = 0; ti_black_holes_end_min = max_nr_timesteps; - ti_black_holes_end_max = 0; ti_black_holes_beg_max = 0; ti_rt_end_min = max_nr_timesteps; @@ -489,7 +481,6 @@ void space_split_recursive(struct space *s, struct cell *c, const integertime_t ti_beg = get_integer_time_begin(ti_current, time_bin); ti_hydro_end_min = min(ti_hydro_end_min, ti_end); - ti_hydro_end_max = max(ti_hydro_end_max, ti_end); ti_hydro_beg_max = max(ti_hydro_beg_max, ti_beg); if (with_rt) { @@ -540,7 +531,6 @@ void space_split_recursive(struct space *s, struct cell *c, const integertime_t ti_beg = get_integer_time_begin(ti_current, time_bin); ti_gravity_end_min = min(ti_gravity_end_min, ti_end); - ti_gravity_end_max = max(ti_gravity_end_max, ti_end); ti_gravity_beg_max = max(ti_gravity_beg_max, ti_beg); } @@ -559,7 +549,6 @@ void space_split_recursive(struct space *s, struct cell *c, const integertime_t ti_beg = get_integer_time_begin(ti_current, time_bin); ti_stars_end_min = min(ti_stars_end_min, ti_end); - ti_stars_end_max = max(ti_stars_end_max, ti_end); ti_stars_beg_max = max(ti_stars_beg_max, ti_beg); stars_h_max = max(stars_h_max, sparts[k].h); @@ -588,7 +577,6 @@ void space_split_recursive(struct space *s, struct cell *c, const integertime_t ti_beg = get_integer_time_begin(ti_current, time_bin); ti_sinks_end_min = min(ti_sinks_end_min, ti_end); - ti_sinks_end_max = max(ti_sinks_end_max, ti_end); ti_sinks_beg_max = max(ti_sinks_beg_max, ti_beg); sinks_h_max = max(sinks_h_max, sinks[k].r_cut); @@ -617,7 +605,6 @@ void space_split_recursive(struct space *s, struct cell *c, const integertime_t ti_beg = get_integer_time_begin(ti_current, time_bin); ti_black_holes_end_min = min(ti_black_holes_end_min, ti_end); - ti_black_holes_end_max = max(ti_black_holes_end_max, ti_end); ti_black_holes_beg_max = max(ti_black_holes_beg_max, ti_beg); black_holes_h_max = max(black_holes_h_max, bparts[k].h); -- GitLab