Commit c3c46887 authored by Mladen Ivkovic's avatar Mladen Ivkovic

small fixes following Loic's suggestions

parent 8edac39d
......@@ -1632,6 +1632,7 @@ int engine_estimate_nr_tasks(const struct engine *e) {
}
#endif
if (e->policy & engine_policy_rt) {
/* 1 self (inject), (3^3-1)/2 = 26/2 = 13 inject pairs */
n1 += 14;
}
......
......@@ -25,25 +25,25 @@
*/
/**
* @brief First initialisation of the RT extra hydro partilce data.
* @brief First initialisation of the RT extra hydro particle data.
*/
__attribute__((always_inline)) INLINE static void rt_first_init_xpart(
struct xpart* restrict xp) {}
/**
* @brief Initialisation of the RT extra hydro partilce data.
* @brief Initialisation of the RT extra hydro particle data.
*/
__attribute__((always_inline)) INLINE static void rt_init_xpart(
struct xpart* restrict xp) {}
/**
* @brief First initialisation of the RT extra star partilce data.
* @brief First initialisation of the RT extra star particle data.
*/
__attribute__((always_inline)) INLINE static void rt_first_init_spart(
struct spart* restrict sp) {}
/**
* @brief First initialisation of the RT extra star partilce data.
* @brief First initialisation of the RT extra star particle data.
*/
__attribute__((always_inline)) INLINE static void rt_init_spart(
struct spart* restrict sp) {}
......
......@@ -25,7 +25,7 @@
*/
/**
* @brief First initialisation of the RT extra hydro partilce data.
* @brief First initialisation of the RT extra hydro particle data.
*/
__attribute__((always_inline)) INLINE static void rt_first_init_xpart(
struct xpart* restrict xp) {
......@@ -38,7 +38,7 @@ __attribute__((always_inline)) INLINE static void rt_first_init_xpart(
}
/**
* @brief Initialisation of the RT extra hydro partilce data.
* @brief Initialisation of the RT extra hydro particle data.
*/
__attribute__((always_inline)) INLINE static void rt_init_xpart(
struct xpart* restrict xp) {
......@@ -50,7 +50,7 @@ __attribute__((always_inline)) INLINE static void rt_init_xpart(
}
/**
* @brief First initialisation of the RT extra star partilce data.
* @brief First initialisation of the RT extra star particle data.
*/
__attribute__((always_inline)) INLINE static void rt_first_init_spart(
struct spart* restrict sp) {
......@@ -63,7 +63,7 @@ __attribute__((always_inline)) INLINE static void rt_first_init_spart(
}
/**
* @brief First initialisation of the RT extra star partilce data.
* @brief First initialisation of the RT extra star particle data.
*/
__attribute__((always_inline)) INLINE static void rt_init_spart(
struct spart* restrict sp) {
......
......@@ -33,25 +33,22 @@
INLINE static int rt_write_particles(const struct xpart* xparts,
struct io_props* list) {
list[0] = io_make_output_field("RTStarIact", INT, 1, UNIT_CONV_NO_UNITS, 1.f,
list[0] = io_make_output_field("RTStarIact", INT, 1, UNIT_CONV_NO_UNITS, 0,
xparts, rt_data.iact_stars,
"number of interactions between this hydro "
"particle and any star particle");
list[1] = io_make_output_field(
"RTTotalCalls", INT, 1, UNIT_CONV_NO_UNITS, 1.f, xparts,
rt_data.calls_tot,
"RTTotalCalls", INT, 1, UNIT_CONV_NO_UNITS, 0, xparts, rt_data.calls_tot,
"total number of calls to this particle during the run");
list[2] = io_make_output_field(
"RTCallsThisStep", INT, 1, UNIT_CONV_NO_UNITS, 1.f, xparts,
"RTCallsThisStep", INT, 1, UNIT_CONV_NO_UNITS, 0, xparts,
rt_data.calls_per_step,
"number of calls to this particle during one time step");
list[3] = io_make_output_field(
"RTCallsSelf", INT, 1, UNIT_CONV_NO_UNITS, 1.f, xparts,
rt_data.calls_self,
"RTCallsSelf", INT, 1, UNIT_CONV_NO_UNITS, 0, xparts, rt_data.calls_self,
"number of calls to this particle during one time step in self task");
list[4] = io_make_output_field(
"RTCallsPair", INT, 1, UNIT_CONV_NO_UNITS, 1.f, xparts,
rt_data.calls_pair,
"RTCallsPair", INT, 1, UNIT_CONV_NO_UNITS, 0, xparts, rt_data.calls_pair,
"number of calls to this particle during one time step in self task");
return (5);
......@@ -64,25 +61,22 @@ INLINE static int rt_write_particles(const struct xpart* xparts,
INLINE static int rt_write_stars(const struct spart* sparts,
struct io_props* list) {
list[0] = io_make_output_field("RTHydroIact", INT, 1, UNIT_CONV_NO_UNITS, 1.f,
list[0] = io_make_output_field("RTHydroIact", INT, 1, UNIT_CONV_NO_UNITS, 0,
sparts, rt_data.iact_hydro,
"number of interactions between this hydro "
"particle and any star particle");
list[1] = io_make_output_field(
"RTRotalCalls", INT, 1, UNIT_CONV_NO_UNITS, 1.f, sparts,
rt_data.calls_tot,
"RTRotalCalls", INT, 1, UNIT_CONV_NO_UNITS, 0, sparts, rt_data.calls_tot,
"total number of calls to this particle during the run");
list[2] = io_make_output_field(
"RTCallsThisStep", INT, 1, UNIT_CONV_NO_UNITS, 1.f, sparts,
"RTCallsThisStep", INT, 1, UNIT_CONV_NO_UNITS, 0, sparts,
rt_data.calls_per_step,
"number of calls to this particle during one time step");
list[3] = io_make_output_field(
"RTCallsSelf", INT, 1, UNIT_CONV_NO_UNITS, 1.f, sparts,
rt_data.calls_self,
"RTCallsSelf", INT, 1, UNIT_CONV_NO_UNITS, 0, sparts, rt_data.calls_self,
"number of calls to this particle during one time step in self task");
list[4] = io_make_output_field(
"RTCallsPair", INT, 1, UNIT_CONV_NO_UNITS, 1.f, sparts,
rt_data.calls_pair,
"RTCallsPair", INT, 1, UNIT_CONV_NO_UNITS, 0, sparts, rt_data.calls_pair,
"number of calls to this particle during one time step in self task");
return (5);
......
......@@ -25,25 +25,25 @@
*/
/**
* @brief First initialisation of the RT extra hydro partilce data.
* @brief First initialisation of the RT extra hydro particle data.
*/
__attribute__((always_inline)) INLINE static void rt_first_init_xpart(
struct xpart* restrict xp) {}
/**
* @brief Initialisation of the RT extra hydro partilce data.
* @brief Initialisation of the RT extra hydro particle data.
*/
__attribute__((always_inline)) INLINE static void rt_init_xpart(
struct xpart* restrict xp) {}
/**
* @brief First initialisation of the RT extra star partilce data.
* @brief First initialisation of the RT extra star particle data.
*/
__attribute__((always_inline)) INLINE static void rt_first_init_spart(
struct spart* restrict sp) {}
/**
* @brief First initialisation of the RT extra star partilce data.
* @brief First initialisation of the RT extra star particle data.
*/
__attribute__((always_inline)) INLINE static void rt_init_spart(
struct spart* restrict sp) {}
......
......@@ -137,7 +137,7 @@ void DOPAIR1_NONSYM_RT(struct runner *r, struct cell *ci, struct cell *cj) {
float dx[3] = {six[0] - pjx[0], six[1] - pjx[1], six[2] - pjx[2]};
const float r2 = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2];
if (r2 < hjg2) IACT_RT(-1.f, dx, hi, hj, si, xpj);
if (r2 < hjg2) IACT_RT(r2, dx, hi, hj, si, xpj);
} /* loop over the parts in cj. */
} /* loop over the parts in ci. */
......
......@@ -1402,7 +1402,6 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
t->subtype == task_subtype_limiter)
cost = 1.f * (wscale * count_i) * count_i;
else if (t->subtype == task_subtype_rt_inject) {
/* TODO: does this make sense? */
cost = 1.f * wscale * scount_i * count_i;
} else
error("Untreated sub-type for selfs: %s",
......@@ -1453,8 +1452,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
cost = 2.f * (wscale * count_i) * count_j * sid_scale[t->flags];
} else if (t->subtype == task_subtype_rt_inject) {
/* TODO: does this make sense? */
cost = 1.f * wscale * scount_i * count_i;
cost = 1.f * wscale * scount_i * count_j;
} else {
error("Untreated sub-type for pairs: %s",
subtaskID_names[t->subtype]);
......@@ -1504,8 +1502,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
cost = 2.f * (wscale * count_i) * count_j * sid_scale[t->flags];
}
} else if (t->subtype == task_subtype_rt_inject) {
/* TODO: does this make sense? */
cost = 1.f * wscale * scount_i * count_i;
cost = 1.f * wscale * scount_i * count_j;
} else {
error("Untreated sub-type for sub-pairs: %s",
subtaskID_names[t->subtype]);
......@@ -1530,7 +1527,6 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
t->subtype == task_subtype_limiter) {
cost = 1.f * (wscale * count_i) * count_i;
} else if (t->subtype == task_subtype_rt_inject) {
/* TODO: does this make sense? */
cost = 1.f * wscale * scount_i * count_i;
} else {
error("Untreated sub-type for sub-selfs: %s",
......
......@@ -124,8 +124,10 @@ const char* timers_names[timer_count] = {
"fof_self",
"fof_pair",
"drift_sink",
"rt_inject_self",
"rt_inject_pair",
"doself_rt_inject",
"dopair_rt_inject",
"dosub_self_rt_inject",
"dosub_pair_rt_inject",
};
/* File to store the timers */
......
......@@ -127,6 +127,8 @@ enum {
timer_drift_sink,
timer_doself_rt_inject,
timer_dopair_rt_inject,
timer_dosub_self_rt_inject,
timer_dosub_pair_rt_inject,
timer_count,
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment