Commit 959d73d4 authored by Mladen Ivkovic's avatar Mladen Ivkovic

cleanup and format

parent c927a299
......@@ -2105,7 +2105,9 @@ void engine_skip_force_and_kick(struct engine *e) {
t->subtype == task_subtype_tend_spart ||
t->subtype == task_subtype_tend_sink ||
t->subtype == task_subtype_tend_bpart ||
t->subtype == task_subtype_rho || t->subtype == task_subtype_sf_counts || t->subtype == task_subtype_rt_inject )
t->subtype == task_subtype_rho ||
t->subtype == task_subtype_sf_counts ||
t->subtype == task_subtype_rt_inject)
t->skip = 1;
}
......
......@@ -1958,7 +1958,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
}
if (with_rt) {
t_rt_inject = scheduler_addtask(sched, task_type_self, task_subtype_rt_inject, flags, 0, ci, NULL);
t_rt_inject = scheduler_addtask(
sched, task_type_self, task_subtype_rt_inject, flags, 0, ci, NULL);
}
/* Link the tasks to the cells */
......@@ -1977,7 +1978,7 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
engine_addlink(e, &ci->black_holes.do_bh_swallow, t_do_bh_swallow);
engine_addlink(e, &ci->black_holes.feedback, t_bh_feedback);
}
if (with_rt){
if (with_rt) {
engine_addlink(e, &ci->hydro.rt_inject, t_rt_inject);
}
......@@ -2069,7 +2070,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
}
if (with_rt) {
scheduler_addunlock(sched, ci->hydro.super->stars.stars_out, t_rt_inject);
scheduler_addunlock(sched, ci->hydro.super->stars.stars_out,
t_rt_inject);
scheduler_addunlock(sched, t_rt_inject, ci->super->timestep);
}
}
......@@ -2131,12 +2133,10 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
}
if (with_rt) {
t_rt_inject =
scheduler_addtask(sched, task_type_pair, task_subtype_rt_inject,
flags, 0, ci, cj);
t_rt_inject = scheduler_addtask(
sched, task_type_pair, task_subtype_rt_inject, flags, 0, ci, cj);
}
engine_addlink(e, &ci->hydro.force, t_force);
engine_addlink(e, &cj->hydro.force, t_force);
if (with_timestep_limiter) {
......@@ -2161,7 +2161,7 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
engine_addlink(e, &ci->black_holes.feedback, t_bh_feedback);
engine_addlink(e, &cj->black_holes.feedback, t_bh_feedback);
}
if (with_rt){
if (with_rt) {
engine_addlink(e, &ci->hydro.rt_inject, t_rt_inject);
engine_addlink(e, &cj->hydro.rt_inject, t_rt_inject);
}
......@@ -2286,7 +2286,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
}
if (with_rt) {
scheduler_addunlock(sched, ci->hydro.super->stars.stars_out, t_rt_inject);
scheduler_addunlock(sched, ci->hydro.super->stars.stars_out,
t_rt_inject);
scheduler_addunlock(sched, t_rt_inject, ci->super->timestep);
}
......@@ -2364,14 +2365,14 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
}
if (with_rt) {
scheduler_addunlock(sched, cj->hydro.super->stars.stars_out, t_rt_inject);
scheduler_addunlock(sched, cj->hydro.super->stars.stars_out,
t_rt_inject);
scheduler_addunlock(sched, t_rt_inject, cj->super->timestep);
}
if (with_timestep_limiter) {
scheduler_addunlock(sched, cj->hydro.super->hydro.drift, t_limiter);
}
}
if (ci->super != cj->super) {
......@@ -2459,12 +2460,10 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
}
if (with_rt) {
t_rt_inject =
scheduler_addtask(sched, task_type_self,
task_subtype_rt_inject, flags, 0, ci, NULL);
t_rt_inject = scheduler_addtask(
sched, task_type_self, task_subtype_rt_inject, flags, 0, ci, NULL);
}
/* Add the link between the new loop and the cell */
engine_addlink(e, &ci->hydro.force, t_force);
if (with_timestep_limiter) {
......@@ -2481,7 +2480,7 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
engine_addlink(e, &ci->black_holes.do_bh_swallow, t_do_bh_swallow);
engine_addlink(e, &ci->black_holes.feedback, t_bh_feedback);
}
if (with_rt){
if (with_rt) {
engine_addlink(e, &ci->hydro.rt_inject, t_rt_inject);
}
......@@ -2579,7 +2578,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
}
if (with_rt) {
scheduler_addunlock(sched, ci->hydro.super->stars.stars_out, t_rt_inject);
scheduler_addunlock(sched, ci->hydro.super->stars.stars_out,
t_rt_inject);
scheduler_addunlock(sched, t_rt_inject, ci->super->timestep);
}
}
......@@ -2645,9 +2645,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
}
if (with_rt) {
t_rt_inject =
scheduler_addtask(sched, task_type_pair, task_subtype_rt_inject,
flags, 0, ci, cj);
t_rt_inject = scheduler_addtask(
sched, task_type_pair, task_subtype_rt_inject, flags, 0, ci, cj);
}
engine_addlink(e, &ci->hydro.force, t_force);
......@@ -2674,7 +2673,7 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
engine_addlink(e, &ci->black_holes.feedback, t_bh_feedback);
engine_addlink(e, &cj->black_holes.feedback, t_bh_feedback);
}
if (with_rt){
if (with_rt) {
engine_addlink(e, &ci->hydro.rt_inject, t_rt_inject);
engine_addlink(e, &cj->hydro.rt_inject, t_rt_inject);
}
......@@ -2798,7 +2797,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
}
if (with_rt) {
scheduler_addunlock(sched, ci->hydro.super->stars.stars_out, t_rt_inject);
scheduler_addunlock(sched, ci->hydro.super->stars.stars_out,
t_rt_inject);
scheduler_addunlock(sched, t_rt_inject, ci->super->timestep);
}
} else /* ci->nodeID != nodeID */ {
......@@ -2875,7 +2875,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
cj->hydro.super->black_holes.black_holes_out);
}
if (with_rt) {
scheduler_addunlock(sched, cj->hydro.super->stars.stars_out, t_rt_inject);
scheduler_addunlock(sched, cj->hydro.super->stars.stars_out,
t_rt_inject);
scheduler_addunlock(sched, t_rt_inject, cj->super->timestep);
}
......@@ -3548,7 +3549,4 @@ void engine_maketasks(struct engine *e) {
if (e->verbose)
message("took %.3f %s (including reweight).",
clocks_from_ticks(getticks() - tic), clocks_getunit());
scheduler_write_dependencies(sched, 1);
}
......@@ -470,7 +470,6 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
cell_activate_subcell_grav_tasks(t->ci, t->cj, s);
}
#ifdef SWIFT_DEBUG_CHECKS
else if (t_type == task_type_sub_pair &&
t_subtype == task_subtype_grav) {
......@@ -885,7 +884,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
cj_nodeID);
}
#endif
} /* Only interested in RT tasks as of here. */
} /* Only interested in RT tasks as of here. */
else if (t_subtype == task_subtype_rt_inject) {
#ifdef WITH_MPI
error("RT doesn't work with MPI yet.");
......
......@@ -27,6 +27,8 @@
/**
* @brief Dummy function to test whether inclusions work properly.
*/
__attribute__((always_inline)) INLINE static void rt_dummy_function(void) { message("Called M1 closure RT scheme."); }
__attribute__((always_inline)) INLINE static void rt_dummy_function(void) {
message("Called M1 closure RT scheme.");
}
#endif /* SWIFT_RT_M1_H */
......@@ -27,6 +27,8 @@
/**
* @brief Dummy function to test whether inclusions work properly.
*/
__attribute__((always_inline)) INLINE static void rt_dummy_function(void) { message("Called debug RT scheme."); }
__attribute__((always_inline)) INLINE static void rt_dummy_function(void) {
message("Called debug RT scheme.");
}
#endif /* SWIFT_RT_DEBUG_H */
......@@ -27,6 +27,8 @@
/**
* @brief Dummy function to test whether inclusions work properly.
*/
__attribute__((always_inline)) INLINE static void rt_dummy_function(void) { message("Called no RT scheme."); }
__attribute__((always_inline)) INLINE static void rt_dummy_function(void) {
message("Called no RT scheme.");
}
#endif /* SWIFT_RT_NONE_H */
......@@ -27,36 +27,35 @@
#include "runner_doiact_rt.h"
/**
* @brief TODO
* @brief Function for self-type interaction between stars and hydro particles
*
* @param r runner task
* @param c cell
* @param timer 1 if the time is to be recorded.
*/
void DOSELF1_RT(struct runner *r, struct cell *c, int timer){
TIMER_TIC;
void DOSELF1_RT(struct runner *r, struct cell *c, int timer) {
TIMER_TIC;
message("message from DOSELF1_RT");
if (timer) TIMER_TOC(TIMER_DOSELF_RT);
}
/**
* @brief TODO
* @brief Function for pari-type interaction between stars and hydro particles
*
*
* @param r runner task
* @param c cell
* @param timer 1 if the time is to be recorded.
*/
void DOPAIR1_SYM_RT(struct runner *r, struct cell *ci, struct cell *cj, int timer){
TIMER_TIC;
void DOPAIR1_RT(struct runner *r, struct cell *ci, struct cell *cj, int timer) {
TIMER_TIC;
message("message from DOPAIR1_RT");
if (timer) TIMER_TOC(TIMER_DOPAIR_RT);
}
/**
* @brief Determine which version of DOSELF1_RT needs to be called depending
* on the optimisation level.
* @brief Determine which version of DOSELF1_RT needs to be called
*
* @param r #runner
* @param c #cell c
......@@ -67,15 +66,15 @@ void DOSELF1_BRANCH_RT(struct runner *r, struct cell *c, int timer) {
}
/**
* @brief Determine which version of DOPAIR1_RT needs to be called depending
* on the optimisation level.
* @brief Determine which version of DOPAIR1_RT needs to be called
*
* @param r #runner
* @param c #cell c
* @param timer 1 if the time is to be recorded.
*/
void DOPAIR1_BRANCH_RT(struct runner *r, struct cell *ci, struct cell *cj, int timer) {
DOPAIR1_SYM_RT(r, ci, cj, timer);
void DOPAIR1_BRANCH_RT(struct runner *r, struct cell *ci, struct cell *cj,
int timer) {
DOPAIR1_RT(r, ci, cj, timer);
}
/**
......@@ -96,6 +95,7 @@ void DOSUB_SELF1_RT(struct runner *r, struct cell *c, int timer) {
* @param ci The first #cell.
* @param gettimer Do we have a timer ?
*/
void DOSUB_PAIR1_RT(struct runner *r, struct cell *ci, struct cell *cj, int timer) {
DOPAIR1_SYM_RT(r, ci, cj, timer);
void DOSUB_PAIR1_RT(struct runner *r, struct cell *ci, struct cell *cj,
int timer) {
DOPAIR1_RT(r, ci, cj, timer);
}
......@@ -34,7 +34,5 @@
/* Import the rt injection loop functions. */
#define FUNCTION inject
#define FUNCTION_TASK_LOOP TASK_LOOP_INJECT
#include "runner_doiact_functions_rt.h"
#undef FUNCTION_TASK_LOOP
#undef FUNCTION
......@@ -29,20 +29,8 @@
#define _DOSELF1_RT(f) PASTE(runner_doself_rt, f)
#define DOSELF1_RT _DOSELF1_RT(FUNCTION)
#define _DOPAIR1_SYM_RT(f) PASTE(runner_dopair_rt, f)
#define DOPAIR1_SYM_RT _DOPAIR1_SYM_RT(FUNCTION)
#define _DOPAIR1_NONSYM_RT(f) PASTE(runner_dopair_nonsym_rt, f)
#define DOPAIR1_NONSYM_RT _DOPAIR1_NONSYM_RT(FUNCTION)
#define _DOPAIR1_SYM_NAIVE_RT(f) PASTE(runner_dopair_naive_rt, f)
#define DOPAIR1_SYM_NAIVE_RT _DOPAIR1_SYM_NAIVE_RT(FUNCTION)
#define _DOPAIR1_NONSYM_NAIVE_RT(f) PASTE(runner_dopair_nonsym_naive_rt, f)
#define DOPAIR1_NONSYM_NAIVE_RT _DOPAIR1_NONSYM_NAIVE_RT(FUNCTION)
#define _DOPAIR1_RT(f) PASTE(runner_dopair_rt, f)
#define DOPAIR1_RT_DOPAIR1_RT(FUNCTION)
#define DOPAIR1_RT _DOPAIR1_RT(FUNCTION)
#define _DOSELF1_BRANCH_RT(f) PASTE(runner_doself_branch_rt, f)
#define DOSELF1_BRANCH_RT _DOSELF1_BRANCH_RT(FUNCTION)
......@@ -68,13 +56,13 @@
#define _TIMER_DOSUB_PAIR_RT(f) PASTE(timer_dosub_pair_rt, f)
#define TIMER_DOSUB_PAIR_RT _TIMER_DOSUB_PAIR_RT(FUNCTION)
#define _IACT_RT(f) PASTE(runner_iact_nonsym_rt, f)
#define _IACT_RT(f) PASTE(runner_iact_rt, f)
#define IACT_RT _IACT_RT(FUNCTION)
void DOSELF1_BRANCH_RT(struct runner *r, struct cell *c, int timer);
void DOPAIR1_BRANCH_RT(struct runner *r, struct cell *ci, struct cell *cj,
void DOPAIR1_BRANCH_RT(struct runner *r, struct cell *ci, struct cell *cj,
int timer);
void DOSUB_SELF1_RT(struct runner *r, struct cell *ci, int timer);
void DOSUB_PAIR1_RT(struct runner *r, struct cell *ci, struct cell *cj,
int timer);
int timer);
......@@ -106,12 +106,9 @@
/* Import radiative transfer loop functions. */
#define FUNCTION inject
#define FUNCTION_TASK_LOOP TASK_LOOP_INJECT
#include "runner_doiact_rt.h"
#undef FUNCTION_TASK_LOOP
#undef FUNCTION
/**
* @brief The #runner main thread routine.
*
......@@ -210,7 +207,6 @@ void *runner_main(void *data) {
else if (t->subtype == task_subtype_bh_feedback)
runner_doself_branch_bh_feedback(r, ci);
else if (t->subtype == task_subtype_rt_inject)
/* TODO: check? */
runner_doself_branch_rt_inject(r, ci, 1);
else
error("Unknown/invalid task subtype (%s).",
......@@ -245,7 +241,6 @@ void *runner_main(void *data) {
else if (t->subtype == task_subtype_bh_feedback)
runner_dopair_branch_bh_feedback(r, ci, cj);
else if (t->subtype == task_subtype_rt_inject)
/* TODO: check? */
runner_dopair_branch_rt_inject(r, ci, cj, 1);
else
error("Unknown/invalid task subtype (%s/%s).",
......
......@@ -140,8 +140,7 @@ const char *subtaskID_names[task_subtype_count] = {"none",
"do_bh_swallow",
"bh_feedback",
"sink",
"rt_inject"
};
"rt_inject"};
const char *task_category_names[task_category_count] = {
"drift", "sort", "hydro", "gravity", "feedback",
......
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