diff --git a/src/active.h b/src/active.h index d73e7b9ef400174ba27a53c1ffb6579e7630dd16..7eab6f87d8c6d313b77576c2ac53bf1bb2d9949f 100644 --- a/src/active.h +++ b/src/active.h @@ -195,7 +195,7 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active_gravity( * @param e The #engine containing information about the current time. * @return 1 if the #cell contains at least an active particle, 0 otherwise. */ -__attribute__((always_inline)) INLINE static int cell_is_active_star( +__attribute__((always_inline)) INLINE static int cell_is_active_stars( const struct cell *c, const struct engine *e) { return 1; diff --git a/src/cell.c b/src/cell.c index eb5e70560a8e7448ec689e7db6242be61308d762..ef4ad7f5cabb5c5885835e17101dd5c7ffabe7f9 100644 --- a/src/cell.c +++ b/src/cell.c @@ -2326,9 +2326,9 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) { if (c->ghost_in != NULL) scheduler_activate(s, c->ghost_in); if (c->ghost_out != NULL) scheduler_activate(s, c->ghost_out); if (c->ghost != NULL) scheduler_activate(s, c->ghost); - if (c->star_ghost_in != NULL) scheduler_activate(s, c->star_ghost_in); - if (c->star_ghost_out != NULL) scheduler_activate(s, c->star_ghost_out); - if (c->star_ghost != NULL) scheduler_activate(s, c->star_ghost); + if (c->stars_ghost_in != NULL) scheduler_activate(s, c->stars_ghost_in); + if (c->stars_ghost_out != NULL) scheduler_activate(s, c->stars_ghost_out); + if (c->stars_ghost != NULL) scheduler_activate(s, c->stars_ghost); if (c->kick1 != NULL) scheduler_activate(s, c->kick1); if (c->kick2 != NULL) scheduler_activate(s, c->kick2); if (c->timestep != NULL) scheduler_activate(s, c->timestep); @@ -2876,7 +2876,7 @@ void cell_drift_gpart(struct cell *c, const struct engine *e, int force) { /* Drift... */ drift_spart(sp, dt_drift, ti_old_gpart, ti_current); if (spart_is_active(sp, e)) - star_init_spart(sp); + stars_init_spart(sp); /* Note: no need to compute dx_max as all spart have a gpart */ } diff --git a/src/cell.h b/src/cell.h index 42fbd8c41ffbffa55974157940fa2bc8c6c63c2e..49fd3d7008e297c4038bf3d2ec4b4b5659e5692e 100644 --- a/src/cell.h +++ b/src/cell.h @@ -283,16 +283,16 @@ struct cell { struct task *grav_down; /*! Dependency implicit task for the star ghost (in->ghost->out)*/ - struct task *star_ghost_in; + struct task *stars_ghost_in; /*! Dependency implicit task for the star ghost (in->ghost->out)*/ - struct task *star_ghost_out; + struct task *stars_ghost_out; /*! The star ghost task itself */ - struct task *star_ghost; + struct task *stars_ghost; /*! Linked list of the tasks computing this cell's star density. */ - struct link *star_density; + struct link *stars_density; /*! Task for cooling */ struct task *cooling; diff --git a/src/engine.c b/src/engine.c index cb009f77f326416fb5609b38fa37e991da316eff..292facd4d1aef1432f37cf23236a3231343d3dcd 100644 --- a/src/engine.c +++ b/src/engine.c @@ -152,23 +152,23 @@ void engine_addlink(struct engine *e, struct link **l, struct task *t) { /** * @brief Recursively add non-implicit star ghost tasks to a cell hierarchy. */ -void engine_add_star_ghosts(struct engine *e, struct cell *c, struct task *star_ghost_in, - struct task *star_ghost_out) { +void engine_add_stars_ghosts(struct engine *e, struct cell *c, struct task *stars_ghost_in, + struct task *stars_ghost_out) { /* If we have reached the leaf OR have to few particles to play with*/ if (!c->split || c->scount < engine_max_sparts_per_ghost) { /* Add the ghost task and its dependencies */ struct scheduler *s = &e->sched; - c->star_ghost = - scheduler_addtask(s, task_type_star_ghost, task_subtype_none, 0, 0, c, NULL); - scheduler_addunlock(s, star_ghost_in, c->star_ghost); - scheduler_addunlock(s, c->star_ghost, star_ghost_out); + c->stars_ghost = + scheduler_addtask(s, task_type_stars_ghost, task_subtype_none, 0, 0, c, NULL); + scheduler_addunlock(s, stars_ghost_in, c->stars_ghost); + scheduler_addunlock(s, c->stars_ghost, stars_ghost_out); } else { /* Keep recursing */ for (int k = 0; k < 8; k++) if (c->progeny[k] != NULL) - engine_add_star_ghosts(e, c->progeny[k], star_ghost_in, star_ghost_out); + engine_add_stars_ghosts(e, c->progeny[k], stars_ghost_in, stars_ghost_out); } } @@ -436,13 +436,13 @@ void engine_make_hierarchical_tasks_stars(struct engine *e, struct cell *c) { if (c->nodeID == e->nodeID) { /* Generate the ghost tasks. */ - c->star_ghost_in = - scheduler_addtask(s, task_type_star_ghost_in, task_subtype_none, 0, + c->stars_ghost_in = + scheduler_addtask(s, task_type_stars_ghost_in, task_subtype_none, 0, /* implicit = */ 1, c, NULL); - c->star_ghost_out = - scheduler_addtask(s, task_type_star_ghost_out, task_subtype_none, 0, + c->stars_ghost_out = + scheduler_addtask(s, task_type_stars_ghost_out, task_subtype_none, 0, /* implicit = */ 1, c, NULL); - engine_add_star_ghosts(e, c, c->star_ghost_in, c->star_ghost_out); + engine_add_stars_ghosts(e, c, c->stars_ghost_in, c->stars_ghost_out); } } else { /* We are above the super-cell so need to go deeper */ @@ -2670,7 +2670,7 @@ void engine_make_hydroloop_tasks_mapper(void *map_data, int num_elements, * @param num_elements Number of cells to traverse. * @param extra_data The #engine. */ -void engine_make_starloop_tasks_mapper(void *map_data, int num_elements, +void engine_make_starsloop_tasks_mapper(void *map_data, int num_elements, void *extra_data) { /* Extract the engine pointer. */ @@ -2699,7 +2699,7 @@ void engine_make_starloop_tasks_mapper(void *map_data, int num_elements, /* If the cells is local build a self-interaction */ if (ci->nodeID == nodeID) - scheduler_addtask(sched, task_type_self, task_subtype_star_density, 0, 0, ci, + scheduler_addtask(sched, task_type_self, task_subtype_stars_density, 0, 0, ci, NULL); /* Now loop over all the neighbours of this cell */ @@ -2727,7 +2727,7 @@ void engine_make_starloop_tasks_mapper(void *map_data, int num_elements, /* Construct the pair task */ const int sid = sortlistID[(kk + 1) + 3 * ((jj + 1) + 3 * (ii + 1))]; - scheduler_addtask(sched, task_type_pair, task_subtype_star_density, sid, 0, + scheduler_addtask(sched, task_type_pair, task_subtype_stars_density, sid, 0, ci, cj); } } @@ -2775,8 +2775,8 @@ void engine_count_and_link_tasks_mapper(void *map_data, int num_elements, } else if (t_subtype == task_subtype_external_grav) { engine_addlink(e, &ci->grav, t); } - if (t->subtype == task_subtype_star_density) { - engine_addlink(e, &ci->star_density, t); + if (t->subtype == task_subtype_stars_density) { + engine_addlink(e, &ci->stars_density, t); } /* Link pair tasks to cells. */ @@ -2796,9 +2796,9 @@ void engine_count_and_link_tasks_mapper(void *map_data, int num_elements, error("Found a pair/external-gravity task..."); } #endif - if (t->subtype == task_subtype_star_density) { - engine_addlink(e, &ci->star_density, t); - engine_addlink(e, &cj->star_density, t); + if (t->subtype == task_subtype_stars_density) { + engine_addlink(e, &ci->stars_density, t); + engine_addlink(e, &cj->stars_density, t); } /* Link sub-self tasks to cells. */ @@ -2812,8 +2812,8 @@ void engine_count_and_link_tasks_mapper(void *map_data, int num_elements, } else if (t_subtype == task_subtype_external_grav) { engine_addlink(e, &ci->grav, t); } - if (t->subtype == task_subtype_star_density) { - engine_addlink(e, &ci->star_density, t); + if (t->subtype == task_subtype_stars_density) { + engine_addlink(e, &ci->stars_density, t); } /* Link sub-pair tasks to cells. */ @@ -2828,16 +2828,12 @@ void engine_count_and_link_tasks_mapper(void *map_data, int num_elements, engine_addlink(e, &ci->grav, t); engine_addlink(e, &cj->grav, t); } -<<<<<<< HEAD + if (t->subtype == task_subtype_stars_density) { + engine_addlink(e, &ci->stars_density, t); + engine_addlink(e, &cj->stars_density, t); + } #ifdef SWIFT_DEBUG_CHECKS else if (t_subtype == task_subtype_external_grav) { -======= - if (t->subtype == task_subtype_star_density) { - engine_addlink(e, &ci->star_density, t); - engine_addlink(e, &cj->star_density, t); - } - if (t->subtype == task_subtype_external_grav) { ->>>>>>> star smoothing length close to be implemented error("Found a sub-pair/external-gravity task..."); } #endif @@ -3051,11 +3047,11 @@ static inline void engine_make_hydro_loops_dependencies(struct scheduler *sched, * @param density The density task to link. * @param c The cell. */ -static inline void engine_make_star_loops_dependencies(struct scheduler *sched, +static inline void engine_make_stars_loops_dependencies(struct scheduler *sched, struct task *density, struct cell *c) { /* density loop --> ghost */ - scheduler_addunlock(sched, density, c->super->star_ghost_in); + scheduler_addunlock(sched, density, c->super->stars_ghost_in); } /** @@ -3320,7 +3316,7 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, * With all the relevant tasks for a given cell available, we construct * all the dependencies for that cell. */ -void engine_link_star_tasks_mapper(void *map_data, int num_elements, +void engine_link_stars_tasks_mapper(void *map_data, int num_elements, void *extra_data) { struct engine *e = (struct engine *)extra_data; @@ -3331,18 +3327,18 @@ void engine_link_star_tasks_mapper(void *map_data, int num_elements, struct task *t = &((struct task *)map_data)[ind]; /* Self-interaction? */ - if (t->type == task_type_self && t->subtype == task_subtype_star_density) { + if (t->type == task_type_self && t->subtype == task_subtype_stars_density) { /* Make the self-density tasks depend on the drift only. */ scheduler_addunlock(sched, t->ci->super->drift_part, t); /* Now, build all the dependencies for the hydro */ - engine_make_star_loops_dependencies(sched, t, t->ci); - scheduler_addunlock(sched, t->ci->star_ghost_out, t->ci->super->end_force); + engine_make_stars_loops_dependencies(sched, t, t->ci); + scheduler_addunlock(sched, t->ci->stars_ghost_out, t->ci->super->end_force); } /* Otherwise, pair interaction? */ - else if (t->type == task_type_pair && t->subtype == task_subtype_star_density) { + else if (t->type == task_type_pair && t->subtype == task_subtype_stars_density) { /* Make all density tasks depend on the drift and the sorts. */ if (t->ci->nodeID == engine_rank) @@ -3357,18 +3353,18 @@ void engine_link_star_tasks_mapper(void *map_data, int num_elements, /* Now, build all the dependencies for the hydro for the cells */ /* that are local and are not descendant of the same super_hydro-cells */ if (t->ci->nodeID == nodeID) { - engine_make_star_loops_dependencies(sched, t, t->ci); + engine_make_stars_loops_dependencies(sched, t, t->ci); } if (t->cj->nodeID == nodeID) { if (t->ci->super_hydro != t->cj->super) - engine_make_star_loops_dependencies(sched, t, t->cj); + engine_make_stars_loops_dependencies(sched, t, t->cj); } } /* Otherwise, sub-self interaction? */ else if (t->type == task_type_sub_self && - t->subtype == task_subtype_star_density) { + t->subtype == task_subtype_stars_density) { /* Make all density tasks depend on the drift and sorts. */ scheduler_addunlock(sched, t->ci->super->drift_part, t); @@ -3377,14 +3373,14 @@ void engine_link_star_tasks_mapper(void *map_data, int num_elements, /* Now, build all the dependencies for the hydro for the cells */ /* that are local and are not descendant of the same super_hydro-cells */ if (t->ci->nodeID == nodeID) { - engine_make_star_loops_dependencies(sched, t, t->ci); + engine_make_stars_loops_dependencies(sched, t, t->ci); } else error("oo"); } /* Otherwise, sub-pair interaction? */ else if (t->type == task_type_sub_pair && - t->subtype == task_subtype_star_density) { + t->subtype == task_subtype_stars_density) { /* Make all density tasks depend on the drift. */ if (t->ci->nodeID == engine_rank) @@ -3399,11 +3395,11 @@ void engine_link_star_tasks_mapper(void *map_data, int num_elements, /* Now, build all the dependencies for the hydro for the cells */ /* that are local and are not descendant of the same super_hydro-cells */ if (t->ci->nodeID == nodeID) { - engine_make_star_loops_dependencies(sched, t, t->ci); + engine_make_stars_loops_dependencies(sched, t, t->ci); } if (t->cj->nodeID == nodeID) { if (t->ci->super != t->cj->super) - engine_make_star_loops_dependencies(sched, t, t->cj); + engine_make_stars_loops_dependencies(sched, t, t->cj); } } } @@ -3425,15 +3421,10 @@ void engine_maketasks(struct engine *e) { /* Re-set the scheduler. */ scheduler_reset(sched, engine_estimate_nr_tasks(e)); -<<<<<<< HEAD ticks tic2 = getticks(); - /* Construct the firt hydro loop over neighbours */ - if (e->policy & engine_policy_hydro) -======= /* Construct the first hydro loop over neighbours */ - if (e->policy & engine_policy_hydro) { ->>>>>>> star smoothing length close to be implemented + if (e->policy & engine_policy_hydro) threadpool_map(&e->threadpool, engine_make_hydroloop_tasks_mapper, NULL, s->nr_cells, 1, 0, e); @@ -3445,7 +3436,7 @@ void engine_maketasks(struct engine *e) { /* Construct the star hydro loop over neighbours */ if (e->policy & engine_policy_stars) { - threadpool_map(&e->threadpool, engine_make_starloop_tasks_mapper, NULL, + threadpool_map(&e->threadpool, engine_make_starsloop_tasks_mapper, NULL, s->nr_cells, 1, 0, e); } @@ -3479,7 +3470,7 @@ void engine_maketasks(struct engine *e) { #endif const size_t self_grav_tasks_per_cell = 125; const size_t ext_grav_tasks_per_cell = 1; - const size_t star_tasks_per_cell = 1; + const size_t stars_tasks_per_cell = 1; if (e->policy & engine_policy_hydro) e->size_links += s->tot_cells * hydro_tasks_per_cell; @@ -3488,7 +3479,7 @@ void engine_maketasks(struct engine *e) { if (e->policy & engine_policy_self_gravity) e->size_links += s->tot_cells * self_grav_tasks_per_cell; if (e->policy & engine_policy_stars) - e->size_links += s->tot_cells * star_tasks_per_cell; + e->size_links += s->tot_cells * stars_tasks_per_cell; /* Allocate the new link list */ if ((e->links = (struct link *)malloc(sizeof(struct link) * e->size_links)) == @@ -3565,15 +3556,20 @@ void engine_maketasks(struct engine *e) { if (e->policy & (engine_policy_self_gravity | engine_policy_external_gravity)) engine_link_gravity_tasks(e); -<<<<<<< HEAD if (e->verbose) message("Linking gravity tasks took %.3f %s.", clocks_from_ticks(getticks() - tic2), clocks_getunit()); -======= + + tic2 = getticks(); + if (e->policy & engine_policy_stars) - threadpool_map(&e->threadpool, engine_link_star_tasks_mapper, sched->tasks, + threadpool_map(&e->threadpool, engine_link_stars_tasks_mapper, sched->tasks, sched->nr_tasks, sizeof(struct task), 0, e); ->>>>>>> star smoothing length close to be implemented + + if (e->verbose) + message("Linking stars tasks took %.3f %s (including reweight).", + clocks_from_ticks(getticks() - tic2), clocks_getunit()); + #ifdef WITH_MPI if (e->policy & engine_policy_stars) @@ -3737,7 +3733,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements, /* Activate the star density */ else if (t->type == task_type_self && - t->subtype == task_subtype_star_density) { + t->subtype == task_subtype_stars_density) { if (cell_is_active_star(ci, e)) { scheduler_activate(s, t); cell_activate_drift_part(ci, s); @@ -3746,7 +3742,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements, /* Store current values of dx_max and h_max. */ else if (t->type == task_type_sub_self && - t->subtype == task_subtype_star_density) { + t->subtype == task_subtype_stars_density) { if (cell_is_active_star(ci, e)) { scheduler_activate(s, t); cell_activate_subcell_hydro_tasks(ci, NULL, s); @@ -3792,7 +3788,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements, if ((t->subtype == task_subtype_density || t->subtype == task_subtype_gradient || t->subtype == task_subtype_force || - t->subtype == task_subtype_star_density) && + t->subtype == task_subtype_stars_density) && ((ci_active_hydro && ci->nodeID == engine_rank) || (cj_active_hydro && cj->nodeID == engine_rank))) { @@ -3800,7 +3796,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements, /* Set the correct sorting flags */ if (t->type == task_type_pair && (t->subtype == task_subtype_density || - t->subtype == task_subtype_star_density)) { + t->subtype == task_subtype_stars_density)) { /* Store some values. */ atomic_or(&ci->requires_sorts, 1 << t->flags); @@ -3821,7 +3817,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements, /* Store current values of dx_max and h_max. */ else if (t->type == task_type_sub_pair && (t->subtype == task_subtype_density || - t->subtype == task_subtype_star_density)) { + t->subtype == task_subtype_stars_density)) { cell_activate_subcell_hydro_tasks(t->ci, t->cj, s); } } @@ -3939,8 +3935,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements, #endif } - /* Only interested in star_density tasks as of here. */ - if (t->subtype == task_subtype_star_density) { + /* Only interested in stars_density tasks as of here. */ + if (t->subtype == task_subtype_stars_density) { /* Too much particle movement? */ if (cell_need_rebuild_for_pair(ci, cj)) *rebuild_space = 1; @@ -4125,8 +4121,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements, } /* Star ghost tasks ? */ - else if (t->type == task_type_star_ghost || - t->type == task_type_star_ghost_in || t->type == task_type_star_ghost_out) { + else if (t->type == task_type_stars_ghost || + t->type == task_type_stars_ghost_in || t->type == task_type_stars_ghost_out) { if (cell_is_active_star(t->ci, e)) scheduler_activate(s, t); } diff --git a/src/part.h b/src/part.h index 145bf2111771d8ad254affb213b93b7ac829f1a6..36d4cc5ba2051aad1952cbb1a81102d62c076c17 100644 --- a/src/part.h +++ b/src/part.h @@ -86,7 +86,7 @@ #endif /* Import the right star particle definition */ -#include "./stars/Default/star_part.h" +#include "./stars/Default/stars_part.h" void part_relink_gparts_to_parts(struct part *parts, size_t N, ptrdiff_t offset); diff --git a/src/runner.c b/src/runner.c index 10d06975f997087b49ab01004df325f37af0bf63..b1c5c955b7bb9c8f11ae5f69fb06dc4d055a00a7 100644 --- a/src/runner.c +++ b/src/runner.c @@ -96,8 +96,8 @@ /* Import the gravity loop functions. */ #include "runner_doiact_grav.h" -/* Import the star loop functions. */ -#include "runner_doiact_star.h" +/* Import the stars loop functions. */ +#include "runner_doiact_stars.h" /** * @brief Perform source terms @@ -143,15 +143,15 @@ void runner_do_sourceterms(struct runner *r, struct cell *c, int timer) { * @param c The cell. * @param timer Are we timing this ? */ -void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) { +void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) { struct spart *restrict sparts = c->sparts; const struct engine *e = r->e; const struct cosmology *cosmo = e->cosmology; const struct stars_props *stars_properties = e->stars_properties; - const float star_h_max = stars_properties->h_max; + const float stars_h_max = stars_properties->h_max; const float eps = stars_properties->h_tolerance; - const float star_eta_dim = + const float stars_eta_dim = pow_dimension(stars_properties->eta_neighbours); const int max_smoothing_iter = stars_properties->max_smoothing_iterations; int redo = 0, scount = 0; @@ -159,12 +159,12 @@ void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) { TIMER_TIC; /* Anything to do here? */ - if (!cell_is_active_star(c, e)) return; + if (!cell_is_active_stars(c, e)) return; /* Recurse? */ if (c->split) { for (int k = 0; k < 8; k++) - if (c->progeny[k] != NULL) runner_do_star_ghost(r, c->progeny[k], 0); + if (c->progeny[k] != NULL) runner_do_stars_ghost(r, c->progeny[k], 0); } else { /* Init the list of active particles that have to be updated. */ @@ -212,11 +212,11 @@ void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) { } else { /* Finish the density calculation */ - star_end_density(sp, cosmo); + stars_end_density(sp, cosmo); /* Compute one step of the Newton-Raphson scheme */ const float n_sum = sp->wcount * h_old_dim; - const float n_target = star_eta_dim; + const float n_target = stars_eta_dim; const float f = n_sum - n_target; const float f_prime = sp->wcount_dh * h_old_dim + @@ -242,14 +242,14 @@ void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) { sp->h = h_new; /* If below the absolute maximum, try again */ - if (sp->h < star_h_max) { + if (sp->h < stars_h_max) { /* Flag for another round of fun */ sid[redo] = sid[i]; redo += 1; /* Re-initialise everything */ - star_init_spart(sp); + stars_init_spart(sp); /* Off we go ! */ continue; @@ -257,11 +257,11 @@ void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) { } else { /* Ok, this particle is a lost cause... */ - sp->h = star_h_max; + sp->h = stars_h_max; /* Do some damage control if no neighbours at all were found */ if (has_no_neighbours) { - star_spart_has_no_neighbours(sp, cosmo); + stars_spart_has_no_neighbours(sp, cosmo); } } } @@ -271,13 +271,13 @@ void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) { /* As of here, particle force variables will be set. */ /* Compute variables required for the force loop */ - star_prepare_force(sp, cosmo); + stars_prepare_force(sp, cosmo); /* The particle force values are now set. Do _NOT_ try to read any particle density variables! */ /* Prepare the particle for the force loop over neighbours */ - star_reset_acceleration(sp); + stars_reset_acceleration(sp); } @@ -301,23 +301,23 @@ void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) { /* Self-interaction? */ if (l->t->type == task_type_self) - runner_doself_subset_branch_star_density(r, finger, sparts, sid, scount); + runner_doself_subset_branch_stars_density(r, finger, sparts, sid, scount); /* Otherwise, pair interaction? */ else if (l->t->type == task_type_pair) { /* Left or right? */ if (l->t->ci == finger) - runner_dopair_subset_branch_star_density(r, finger, sparts, sid, + runner_dopair_subset_branch_stars_density(r, finger, sparts, sid, scount, l->t->cj); else - runner_dopair_subset_branch_star_density(r, finger, sparts, sid, + runner_dopair_subset_branch_stars_density(r, finger, sparts, sid, scount, l->t->ci); } /* Otherwise, sub-self interaction? */ else if (l->t->type == task_type_sub_self) - runner_dosub_subset_star_density(r, finger, sparts, sid, scount, NULL, + runner_dosub_subset_stars_density(r, finger, sparts, sid, scount, NULL, -1, 1); /* Otherwise, sub-pair interaction? */ @@ -325,10 +325,10 @@ void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) { /* Left or right? */ if (l->t->ci == finger) - runner_dosub_subset_star_density(r, finger, sparts, sid, scount, + runner_dosub_subset_stars_density(r, finger, sparts, sid, scount, l->t->cj, -1, 1); else - runner_dosub_subset_star_density(r, finger, sparts, sid, scount, + runner_dosub_subset_stars_density(r, finger, sparts, sid, scount, l->t->ci, -1, 1); } } @@ -344,7 +344,7 @@ void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) { free(sid); } - if (timer) TIMER_TOC(timer_do_star_ghost); + if (timer) TIMER_TOC(timer_do_stars_ghost); } @@ -1428,7 +1428,7 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) { } } - /* Loop over the star particles in this cell. */ + /* Loop over the stars particles in this cell. */ for (int k = 0; k < scount; k++) { /* Get a handle on the s-part. */ @@ -1640,7 +1640,7 @@ void runner_do_kick2(struct runner *r, struct cell *c, int timer) { #endif /* Prepare the values to be drifted */ - star_reset_predicted_values(sp); + stars_reset_predicted_values(sp); } } } @@ -1855,7 +1855,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) { /* What is the next starting point for this cell ? */ ti_gravity_beg_max = max(ti_current, ti_gravity_beg_max); - } else { /* star particle is inactive */ + } else { /* stars particle is inactive */ const integertime_t ti_end = get_integer_time_end(ti_current, sp->time_bin); @@ -1987,7 +1987,7 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) { long long id = 0; if (gp->type == swift_type_gas) id = e->s->parts[-gp->id_or_neg_offset].id; - else if (gp->type == swift_type_star) + else if (gp->type == swift_type_stars) id = e->s->sparts[-gp->id_or_neg_offset].id; else if (gp->type == swift_type_black_hole) error("Unexisting type"); @@ -2018,7 +2018,7 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) { long long my_id = 0; if (gp->type == swift_type_gas) my_id = e->s->parts[-gp->id_or_neg_offset].id; - else if (gp->type == swift_type_star) + else if (gp->type == swift_type_stars) my_id = e->s->sparts[-gp->id_or_neg_offset].id; else if (gp->type == swift_type_black_hole) error("Unexisting type"); @@ -2038,7 +2038,7 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) { } } - /* Loop over the star particles in this cell. */ + /* Loop over the stars particles in this cell. */ for (int k = 0; k < scount; k++) { /* Get a handle on the spart. */ @@ -2046,7 +2046,7 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) { if (spart_is_active(sp, e)) { /* Finish the force loop */ - star_end_force(sp); + stars_end_force(sp); } } } @@ -2361,8 +2361,8 @@ void *runner_main(void *data) { runner_doself_recursive_grav(r, ci, 1); else if (t->subtype == task_subtype_external_grav) runner_do_grav_external(r, ci, 1); - else if (t->subtype == task_subtype_star_density) - runner_doself_star_density(r, ci, 1); + else if (t->subtype == task_subtype_stars_density) + runner_doself_stars_density(r, ci, 1); else error("Unknown/invalid task subtype (%d).", t->subtype); break; @@ -2378,8 +2378,8 @@ void *runner_main(void *data) { runner_dopair2_branch_force(r, ci, cj); else if (t->subtype == task_subtype_grav) runner_dopair_recursive_grav(r, ci, cj, 1); - else if (t->subtype == task_subtype_star_density) - runner_dopair_star_density(r, ci, cj, 1); + else if (t->subtype == task_subtype_stars_density) + runner_dopair_stars_density(r, ci, cj, 1); else error("Unknown/invalid task subtype (%d).", t->subtype); break; @@ -2393,8 +2393,8 @@ void *runner_main(void *data) { #endif else if (t->subtype == task_subtype_force) runner_dosub_self2_force(r, ci, 1); - else if (t->subtype == task_subtype_star_density) - runner_dosub_self_star_density(r, ci, 1); + else if (t->subtype == task_subtype_stars_density) + runner_dosub_self_stars_density(r, ci, 1); else error("Unknown/invalid task subtype (%d).", t->subtype); break; @@ -2408,8 +2408,8 @@ void *runner_main(void *data) { #endif else if (t->subtype == task_subtype_force) runner_dosub_pair2_force(r, ci, cj, t->flags, 1); - else if (t->subtype == task_subtype_star_density) - runner_dosub_pair_star_density(r, ci, cj, t->flags, 1); + else if (t->subtype == task_subtype_stars_density) + runner_dosub_pair_stars_density(r, ci, cj, t->flags, 1); else error("Unknown/invalid task subtype (%d).", t->subtype); break; @@ -2432,8 +2432,8 @@ void *runner_main(void *data) { runner_do_extra_ghost(r, ci, 1); break; #endif - case task_type_star_ghost: - runner_do_star_ghost(r, ci, 1); + case task_type_stars_ghost: + runner_do_stars_ghost(r, ci, 1); break; case task_type_drift_part: runner_do_drift_part(r, ci, 1); diff --git a/src/runner_doiact_star.h b/src/runner_doiact_stars.h similarity index 100% rename from src/runner_doiact_star.h rename to src/runner_doiact_stars.h diff --git a/src/stars.h b/src/stars.h index ade47ff57298c13bf205e991548945576a802293..3e921239a29d862aba998c138623eb1cb81a37b9 100644 --- a/src/stars.h +++ b/src/stars.h @@ -16,15 +16,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ -#ifndef SWIFT_STAR_H -#define SWIFT_STAR_H +#ifndef SWIFT_STARS_H +#define SWIFT_STARS_H /* Config parameters. */ #include "../config.h" /* So far only one model here */ /* Straight-forward import */ -#include "./stars/Default/star.h" -#include "./stars/Default/star_iact.h" +#include "./stars/Default/stars.h" +#include "./stars/Default/stars_iact.h" #endif diff --git a/src/stars/Default/star.h b/src/stars/Default/stars.h similarity index 82% rename from src/stars/Default/star.h rename to src/stars/Default/stars.h index 224899840bc7b977a0a8bdca639f357a3158979f..07df0ca5458ad5f243a88f2e2625d9fd9a58b7ef 100644 --- a/src/stars/Default/star.h +++ b/src/stars/Default/stars.h @@ -16,8 +16,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ -#ifndef SWIFT_DEFAULT_STAR_H -#define SWIFT_DEFAULT_STAR_H +#ifndef SWIFT_DEFAULT_STARS_H +#define SWIFT_DEFAULT_STARS_H #include <float.h> #include "minmax.h" @@ -27,7 +27,7 @@ * * @param sp Pointer to the s-particle data. */ -__attribute__((always_inline)) INLINE static float star_compute_timestep( +__attribute__((always_inline)) INLINE static float stars_compute_timestep( const struct spart* const sp) { return FLT_MAX; @@ -41,7 +41,7 @@ __attribute__((always_inline)) INLINE static float star_compute_timestep( * * @param sp The particle to act upon */ -__attribute__((always_inline)) INLINE static void star_first_init_spart( +__attribute__((always_inline)) INLINE static void stars_first_init_spart( struct spart* sp) { sp->time_bin = 0; @@ -52,7 +52,7 @@ __attribute__((always_inline)) INLINE static void star_first_init_spart( * * @param sp The particle to act upon */ -__attribute__((always_inline)) INLINE static void star_init_spart( +__attribute__((always_inline)) INLINE static void stars_init_spart( struct spart* sp) { #ifdef DEBUG_INTERACTIONS_STARS @@ -70,7 +70,7 @@ __attribute__((always_inline)) INLINE static void star_init_spart( * * @param sp The particle. */ -__attribute__((always_inline)) INLINE static void star_reset_predicted_values( +__attribute__((always_inline)) INLINE static void stars_reset_predicted_values( struct spart* restrict sp) {} /** @@ -80,7 +80,7 @@ __attribute__((always_inline)) INLINE static void star_reset_predicted_values( * * @param sp The particle to act upon */ -__attribute__((always_inline)) INLINE static void star_end_force( +__attribute__((always_inline)) INLINE static void stars_end_force( struct spart* sp) {} /** @@ -89,7 +89,7 @@ __attribute__((always_inline)) INLINE static void star_end_force( * @param sp The particle to act upon * @param dt The time-step for this kick */ -__attribute__((always_inline)) INLINE static void star_kick_extra( +__attribute__((always_inline)) INLINE static void stars_kick_extra( struct spart* sp, float dt) {} /** @@ -97,7 +97,7 @@ __attribute__((always_inline)) INLINE static void star_kick_extra( * * @param sp The particle to act upon */ -__attribute__((always_inline)) INLINE static void star_end_density( +__attribute__((always_inline)) INLINE static void stars_end_density( struct spart* sp, const struct cosmology* cosmo) { /* Some smoothing length multiples. */ @@ -118,7 +118,7 @@ __attribute__((always_inline)) INLINE static void star_end_density( * @param sp The particle to act upon * @param cosmo The current cosmological model. */ -__attribute__((always_inline)) INLINE static void star_spart_has_no_neighbours( +__attribute__((always_inline)) INLINE static void stars_spart_has_no_neighbours( struct spart *restrict sp, const struct cosmology *cosmo) { /* Some smoothing length multiples. */ @@ -138,7 +138,7 @@ __attribute__((always_inline)) INLINE static void star_spart_has_no_neighbours( * @param sp The particle to act upon * @param cosmo The current cosmological model. */ -__attribute__((always_inline)) INLINE static void star_prepare_force( +__attribute__((always_inline)) INLINE static void stars_prepare_force( struct spart *restrict sp, const struct cosmology *cosmo) {} @@ -150,7 +150,7 @@ __attribute__((always_inline)) INLINE static void star_prepare_force( * * @param sp The particle to act upon */ -__attribute__((always_inline)) INLINE static void star_reset_acceleration( +__attribute__((always_inline)) INLINE static void stars_reset_acceleration( struct spart *restrict p) {} -#endif /* SWIFT_DEFAULT_STAR_H */ +#endif /* SWIFT_DEFAULT_STARS_H */ diff --git a/src/stars/Default/star_debug.h b/src/stars/Default/stars_debug.h similarity index 86% rename from src/stars/Default/star_debug.h rename to src/stars/Default/stars_debug.h index d940afac2eb67c97481f48a4bda6fa56085166d5..39ae754ddf60910ae07b3252e151c1f619588161 100644 --- a/src/stars/Default/star_debug.h +++ b/src/stars/Default/stars_debug.h @@ -16,10 +16,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ -#ifndef SWIFT_DEFAULT_STAR_DEBUG_H -#define SWIFT_DEFAULT_STAR_DEBUG_H +#ifndef SWIFT_DEFAULT_STARS_DEBUG_H +#define SWIFT_DEFAULT_STARS_DEBUG_H -__attribute__((always_inline)) INLINE static void star_debug_particle( +__attribute__((always_inline)) INLINE static void stars_debug_particle( const struct spart* p) { printf( "x=[%.3e,%.3e,%.3e], " @@ -28,4 +28,4 @@ __attribute__((always_inline)) INLINE static void star_debug_particle( p->mass, p->ti_begin, p->ti_end); } -#endif /* SWIFT_DEFAULT_STAR_DEBUG_H */ +#endif /* SWIFT_DEFAULT_STARS_DEBUG_H */ diff --git a/src/stars/Default/star_iact.h b/src/stars/Default/stars_iact.h similarity index 98% rename from src/stars/Default/star_iact.h rename to src/stars/Default/stars_iact.h index e9a86919484e296f57df87b3467254601a10929e..6bd1c49053d582f816dc97b02daffe9ad23bf640 100644 --- a/src/stars/Default/star_iact.h +++ b/src/stars/Default/stars_iact.h @@ -10,7 +10,7 @@ * @param a Current scale factor. * @param H Current Hubble parameter. */ -__attribute__((always_inline)) INLINE static void runner_iact_nonsym_star_density( +__attribute__((always_inline)) INLINE static void runner_iact_nonsym_stars_density( float r2, const float *dx, float hi, float hj, struct spart *restrict si, const struct part *restrict pj, float a, float H) { diff --git a/src/stars/Default/star_io.h b/src/stars/Default/stars_io.h similarity index 97% rename from src/stars/Default/star_io.h rename to src/stars/Default/stars_io.h index 740c39f588771bbf0632cf9d8b581babcc37bd9e..5b113378586bc0f3b3292fbae522e53c825998b0 100644 --- a/src/stars/Default/star_io.h +++ b/src/stars/Default/stars_io.h @@ -16,10 +16,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ -#ifndef SWIFT_DEFAULT_STAR_IO_H -#define SWIFT_DEFAULT_STAR_IO_H +#ifndef SWIFT_DEFAULT_STARS_IO_H +#define SWIFT_DEFAULT_STARS_IO_H -#include "star_part.h" +#include "stars_part.h" #include "io_properties.h" /** @@ -29,7 +29,7 @@ * @param list The list of i/o properties to read. * @param num_fields The number of i/o fields to read. */ -INLINE static void star_read_particles(struct spart* sparts, +INLINE static void stars_read_particles(struct spart* sparts, struct io_props* list, int* num_fields) { /* Say how much we want to read */ @@ -55,7 +55,7 @@ INLINE static void star_read_particles(struct spart* sparts, * @param list The list of i/o properties to write. * @param num_fields The number of i/o fields to write. */ -INLINE static void star_write_particles(const struct spart* sparts, +INLINE static void stars_write_particles(const struct spart* sparts, struct io_props* list, int* num_fields) { diff --git a/src/stars/Default/star_part.h b/src/stars/Default/stars_part.h similarity index 100% rename from src/stars/Default/star_part.h rename to src/stars/Default/stars_part.h diff --git a/src/stars_io.h b/src/stars_io.h index 18a13ec19163008f1c8e9f64cf544ddf812db655..046e90ee7570430ea25632539bc2cd642d4b52c0 100644 --- a/src/stars_io.h +++ b/src/stars_io.h @@ -16,11 +16,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ -#ifndef SWIFT_STAR_IO_H -#define SWIFT_STAR_IO_H +#ifndef SWIFT_STARS_IO_H +#define SWIFT_STARS_IO_H #include "./const.h" -#include "./stars/Default/star_io.h" +#include "./stars/Default/stars_io.h" -#endif /* SWIFT_STAR_IO_H */ +#endif /* SWIFT_STARS_IO_H */