Skip to content
Snippets Groups Projects
Commit c8233de4 authored by Josh Borrow's avatar Josh Borrow Committed by Matthieu Schaller
Browse files

Fix gizmo compilation

parent b4786d13
No related branches found
No related tags found
No related merge requests found
......@@ -106,8 +106,8 @@ void proxy_tags_exchange(struct proxy *proxies, int num_proxies,
num_reqs_in += proxies[k].nr_cells_in;
num_reqs_out += proxies[k].nr_cells_out;
}
MPI_Request *reqs_in;
int *cids_in;
MPI_Request *reqs_in = NULL;
int *cids_in = NULL;
if ((reqs_in = (MPI_Request *)malloc(sizeof(MPI_Request) *
(num_reqs_in + num_reqs_out))) == NULL ||
(cids_in = (int *)malloc(sizeof(int) * (num_reqs_in + num_reqs_out))) ==
......
......@@ -643,6 +643,7 @@ void runner_do_extra_ghost(struct runner *r, struct cell *c, int timer) {
const int count = c->count;
const struct engine *e = r->e;
const integertime_t ti_end = e->ti_current;
const int with_cosmology = (e->policy & engine_policy_cosmology);
const double time_base = e->time_base;
const struct cosmology *cosmo = e->cosmology;
......@@ -665,9 +666,15 @@ void runner_do_extra_ghost(struct runner *r, struct cell *c, int timer) {
struct xpart *restrict xp = &xparts[i];
if (part_is_active(p, e)) {
/* Calculate the time-step for passing to hydro_prepare_force, used for
* the evolution of alpha factors (i.e. those involved in the artificial
* viscosity and thermal conduction terms) */
/* Finish the gradient calculation */
hydro_end_gradient(p);
/* As of here, particle force variables will be set. */
/* Calculate the time-step for passing to hydro_prepare_force.
* This is the physical time between the start and end of the time-step
* without any scale-factor powers. */
double dt_alpha;
if (with_cosmology) {
const integertime_t ti_step = get_integer_timestep(p->time_bin);
......@@ -676,11 +683,6 @@ void runner_do_extra_ghost(struct runner *r, struct cell *c, int timer) {
dt_alpha = get_timestep(p->time_bin, time_base);
}
/* Finish the gradient calculation */
hydro_end_gradient(p);
/* As of here, particle force variables will be set. */
/* Compute variables required for the force loop */
hydro_prepare_force(p, xp, cosmo, dt_alpha);
......@@ -774,17 +776,6 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
float h_new;
int has_no_neighbours = 0;
/* Calculate the time-step for passing to hydro_prepare_force, used for
* the evolution of alpha factors (i.e. those involved in the artificial
* viscosity and thermal conduction terms) */
double dt_alpha;
if (with_cosmology) {
const integertime_t ti_step = get_integer_timestep(p->time_bin);
dt_alpha = cosmology_get_delta_time(cosmo, ti_end - ti_step, ti_end);
} else {
dt_alpha = get_timestep(p->time_bin, time_base);
}
if (p->density.wcount == 0.f) { /* No neighbours case */
/* Flag that there were no neighbours */
......@@ -831,6 +822,18 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
#else
/* As of here, particle force variables will be set. */
/* Calculate the time-step for passing to hydro_prepare_force.
* This is the physical time between the start and end of the
* time-step without any scale-factor powers. */
double dt_alpha;
if (with_cosmology) {
const integertime_t ti_step = get_integer_timestep(p->time_bin);
dt_alpha =
cosmology_get_delta_time(cosmo, ti_end - ti_step, ti_end);
} else {
dt_alpha = get_timestep(p->time_bin, time_base);
}
/* Compute variables required for the force loop */
hydro_prepare_force(p, xp, cosmo, dt_alpha);
......@@ -913,6 +916,17 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
#else
/* As of here, particle force variables will be set. */
/* Calculate the time-step for passing to hydro_prepare_force.
* This is the physical time between the start and end of the time-step
* without any scale-factor powers. */
double dt_alpha;
if (with_cosmology) {
const integertime_t ti_step = get_integer_timestep(p->time_bin);
dt_alpha = cosmology_get_delta_time(cosmo, ti_end - ti_step, ti_end);
} else {
dt_alpha = get_timestep(p->time_bin, time_base);
}
/* Compute variables required for the force loop */
hydro_prepare_force(p, xp, cosmo, dt_alpha);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment