Commit b2fd8e78 authored by Matthieu Schaller's avatar Matthieu Schaller

Merge branch 'remove_task_order' into 'master'

Remove task order

See merge request !1137
parents 2a57648e 950c67c0
......@@ -1504,7 +1504,6 @@ with_subgrid_pressure_floor=none
with_subgrid_stars=none
with_subgrid_star_formation=none
with_subgrid_feedback=none
with_subgrid_task_order=default
with_subgrid_sink=none
case "$with_subgrid" in
......@@ -1521,8 +1520,7 @@ case "$with_subgrid" in
with_subgrid_star_formation=GEAR
with_subgrid_feedback=GEAR
with_subgrid_black_holes=none
with_subgrid_task_order=GEAR
with_subgrid_sink=none
with_subgrid_sink=none
enable_fof=no
;;
QLA)
......@@ -1534,8 +1532,7 @@ case "$with_subgrid" in
with_subgrid_star_formation=QLA
with_subgrid_feedback=none
with_subgrid_black_holes=none
with_subgrid_task_order=default
with_subgrid_sink=none
with_subgrid_sink=none
enable_fof=no
;;
EAGLE)
......@@ -1547,8 +1544,7 @@ case "$with_subgrid" in
with_subgrid_star_formation=EAGLE
with_subgrid_feedback=EAGLE
with_subgrid_black_holes=EAGLE
with_subgrid_task_order=EAGLE
with_subgrid_sink=none
with_subgrid_sink=none
enable_fof=yes
;;
EAGLE-XL)
......@@ -1560,7 +1556,6 @@ case "$with_subgrid" in
with_subgrid_star_formation=EAGLE
with_subgrid_feedback=EAGLE
with_subgrid_black_holes=EAGLE
with_subgrid_task_order=EAGLE
with_subgrid_sink=none
enable_fof=yes
;;
......@@ -2096,38 +2091,6 @@ case "$with_sink" in
;;
esac
# Task order
AC_ARG_WITH([task-order],
[AS_HELP_STRING([--with-task-order=<model>],
[Task order to use @<:@default, EAGLE, GEAR default: default@:>@]
)],
[with_task_order="$withval"],
[with_task_order="default"]
)
if test "$with_subgrid" != "none"; then
if test "$with_task_order" != "default"; then
AC_MSG_ERROR([Cannot provide with-subgrid and with-task-order together])
else
with_task_order="$with_subgrid_task_order"
fi
fi
case "$with_task_order" in
EAGLE)
AC_DEFINE([TASK_ORDER_EAGLE], [1], [EAGLE task order])
;;
default)
AC_DEFINE([TASK_ORDER_DEFAULT], [1], [Default (i.e. EAGLE/OWLS) task order])
;;
GEAR)
AC_DEFINE([TASK_ORDER_GEAR], [1], [GEAR task order])
;;
*)
AC_MSG_ERROR([Unknown task ordering: $with_task_order])
;;
esac
# External potential
AC_ARG_WITH([ext-potential],
[AS_HELP_STRING([--with-ext-potential=<pot>],
......@@ -2397,7 +2360,6 @@ AC_MSG_RESULT([
Star feedback model : $with_feedback
Sink particle model : $with_sink
Black holes model : $with_black_holes
Task dependencies : $with_task_order
Atomic operations in tasks : $enable_atomics_within_tasks
Individual timers : $enable_timers
......
......@@ -58,7 +58,7 @@ include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \
pressure_floor.h pressure_floor_struct.h pressure_floor_iact.h \
velociraptor_struct.h velociraptor_io.h random.h memuse.h mpiuse.h memuse_rnodes.h \
black_holes.h black_holes_io.h black_holes_properties.h black_holes_struct.h \
feedback.h feedback_struct.h feedback_properties.h task_order.h \
feedback.h feedback_struct.h feedback_properties.h \
space_unique_id.h line_of_sight.h io_compression.h
# source files for EAGLE cooling
......@@ -293,7 +293,6 @@ nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h
pressure_floor/GEAR/pressure_floor.h pressure_floor/none/pressure_floor.h \
pressure_floor/GEAR/pressure_floor_iact.h pressure_floor/none/pressure_floor_iact.h \
pressure_floor/GEAR/pressure_floor_struct.h pressure_floor/none/pressure_floor_struct.h \
task_order/GEAR/task_order.h task_order/EAGLE/task_order.h task_order/default/task_order.h \
sink/Default/sink.h sink/Default/sink_io.h sink/Default/sink_part.h \
sink.h sink_io.h
......
......@@ -68,7 +68,6 @@
#include "space_getsid.h"
#include "star_formation.h"
#include "stars.h"
#include "task_order.h"
#include "timers.h"
#include "tools.h"
#include "tracers.h"
......@@ -2716,7 +2715,7 @@ void cell_activate_star_formation_tasks(struct cell *c, struct scheduler *s,
scheduler_activate(s, c->hydro.star_formation);
/* Activate the star resort tasks at whatever level they are */
if (task_order_star_formation_before_feedback && with_feedback) {
if (with_feedback) {
cell_activate_star_resort_tasks(c, s);
}
}
......@@ -3810,16 +3809,12 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
/* Propagating new star counts? */
if (with_star_formation && with_feedback) {
if (ci_active && ci->hydro.count > 0) {
if (task_order_star_formation_before_feedback) {
scheduler_activate_recv(s, ci->mpi.recv, task_subtype_sf_counts);
}
scheduler_activate_recv(s, ci->mpi.recv, task_subtype_sf_counts);
scheduler_activate_recv(s, ci->mpi.recv, task_subtype_tend_spart);
}
if (cj_active && cj->hydro.count > 0) {
if (task_order_star_formation_before_feedback) {
scheduler_activate_send(s, cj->mpi.send, task_subtype_sf_counts,
ci_nodeID);
}
scheduler_activate_send(s, cj->mpi.send, task_subtype_sf_counts,
ci_nodeID);
scheduler_activate_send(s, cj->mpi.send, task_subtype_tend_spart,
ci_nodeID);
}
......@@ -3883,16 +3878,12 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
/* Propagating new star counts? */
if (with_star_formation && with_feedback) {
if (cj_active && cj->hydro.count > 0) {
if (task_order_star_formation_before_feedback) {
scheduler_activate_recv(s, cj->mpi.recv, task_subtype_sf_counts);
}
scheduler_activate_recv(s, cj->mpi.recv, task_subtype_sf_counts);
scheduler_activate_recv(s, cj->mpi.recv, task_subtype_tend_spart);
}
if (ci_active && ci->hydro.count > 0) {
if (task_order_star_formation_before_feedback) {
scheduler_activate_send(s, ci->mpi.send, task_subtype_sf_counts,
cj_nodeID);
}
scheduler_activate_send(s, ci->mpi.send, task_subtype_sf_counts,
cj_nodeID);
scheduler_activate_send(s, ci->mpi.send, task_subtype_tend_spart,
cj_nodeID);
}
......
......@@ -50,7 +50,6 @@
#include "debug.h"
#include "error.h"
#include "proxy.h"
#include "task_order.h"
#include "timers.h"
extern int engine_max_parts_per_ghost;
......@@ -271,8 +270,7 @@ void engine_addtasks_send_stars(struct engine *e, struct cell *ci,
/* Early abort (are we below the level where tasks are)? */
if (!cell_get_flag(ci, cell_flag_has_tasks)) return;
if (task_order_star_formation_before_feedback && t_sf_counts == NULL &&
with_star_formation && ci->hydro.count > 0) {
if (t_sf_counts == NULL && with_star_formation && ci->hydro.count > 0) {
#ifdef SWIFT_DEBUG_CHECKS
if (ci->depth != 0)
error(
......@@ -320,8 +318,7 @@ void engine_addtasks_send_stars(struct engine *e, struct cell *ci,
engine_addlink(e, &ci->mpi.send, t_feedback);
engine_addlink(e, &ci->mpi.send, t_ti);
if (task_order_star_formation_before_feedback && with_star_formation &&
ci->hydro.count > 0) {
if (with_star_formation && ci->hydro.count > 0) {
engine_addlink(e, &ci->mpi.send, t_sf_counts);
}
}
......@@ -585,8 +582,7 @@ void engine_addtasks_recv_stars(struct engine *e, struct cell *c,
/* Early abort (are we below the level where tasks are)? */
if (!cell_get_flag(c, cell_flag_has_tasks)) return;
if (task_order_star_formation_before_feedback && t_sf_counts == NULL &&
with_star_formation && c->hydro.count > 0) {
if (t_sf_counts == NULL && with_star_formation && c->hydro.count > 0) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->depth != 0)
error(
......@@ -613,8 +609,7 @@ void engine_addtasks_recv_stars(struct engine *e, struct cell *c,
t_ti = scheduler_addtask(s, task_type_recv, task_subtype_tend_spart,
c->mpi.tag, 0, c, NULL);
if (task_order_star_formation_before_feedback && with_star_formation &&
c->hydro.count > 0) {
if (with_star_formation && c->hydro.count > 0) {
/* Receive the stars only once the counts have been received */
scheduler_addunlock(s, t_sf_counts, t_feedback);
......@@ -624,8 +619,7 @@ void engine_addtasks_recv_stars(struct engine *e, struct cell *c,
if (t_feedback != NULL) {
engine_addlink(e, &c->mpi.recv, t_feedback);
engine_addlink(e, &c->mpi.recv, t_ti);
if (task_order_star_formation_before_feedback && with_star_formation &&
c->hydro.count > 0) {
if (with_star_formation && c->hydro.count > 0) {
engine_addlink(e, &c->mpi.recv, t_sf_counts);
}
......@@ -1113,8 +1107,7 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c,
/* Are we are the level where we create the stars' resort tasks?
* If the tree is shallow, we need to do this at the super-level if the
* super-level is above the level we want */
if (task_order_star_formation_before_feedback && (c->nodeID == e->nodeID) &&
(star_resort_cell == NULL) &&
if ((c->nodeID == e->nodeID) && (star_resort_cell == NULL) &&
(c->depth == engine_star_resort_task_depth || c->hydro.super == c)) {
if (with_feedback && with_star_formation && c->hydro.count > 0) {
......@@ -1233,7 +1226,8 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c,
scheduler_addunlock(s, c->stars.stars_out, c->super->timestep);
if (with_feedback && with_star_formation && c->hydro.count > 0) {
task_order_addunlock_star_formation_feedback(s, c, star_resort_cell);
scheduler_addunlock(s, star_resort_cell->hydro.stars_resort,
c->stars.stars_in);
}
}
......
......@@ -51,7 +51,6 @@
#include "debug.h"
#include "error.h"
#include "proxy.h"
#include "task_order.h"
#include "timers.h"
/**
......@@ -538,17 +537,12 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* Propagating new star counts? */
if (with_star_formation && with_feedback) {
if (ci_active_hydro && ci->hydro.count > 0) {
if (task_order_star_formation_before_feedback) {
scheduler_activate_recv(s, ci->mpi.recv,
task_subtype_sf_counts);
}
scheduler_activate_recv(s, ci->mpi.recv, task_subtype_sf_counts);
scheduler_activate_recv(s, ci->mpi.recv, task_subtype_tend_spart);
}
if (cj_active_hydro && cj->hydro.count > 0) {
if (task_order_star_formation_before_feedback) {
scheduler_activate_send(s, cj->mpi.send, task_subtype_sf_counts,
ci_nodeID);
}
scheduler_activate_send(s, cj->mpi.send, task_subtype_sf_counts,
ci_nodeID);
scheduler_activate_send(s, cj->mpi.send, task_subtype_tend_spart,
ci_nodeID);
}
......@@ -615,17 +609,12 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* Propagating new star counts? */
if (with_star_formation && with_feedback) {
if (cj_active_hydro && cj->hydro.count > 0) {
if (task_order_star_formation_before_feedback) {
scheduler_activate_recv(s, cj->mpi.recv,
task_subtype_sf_counts);
}
scheduler_activate_recv(s, cj->mpi.recv, task_subtype_sf_counts);
scheduler_activate_recv(s, cj->mpi.recv, task_subtype_tend_spart);
}
if (ci_active_hydro && ci->hydro.count > 0) {
if (task_order_star_formation_before_feedback) {
scheduler_activate_send(s, ci->mpi.send, task_subtype_sf_counts,
cj_nodeID);
}
scheduler_activate_send(s, ci->mpi.send, task_subtype_sf_counts,
cj_nodeID);
scheduler_activate_send(s, ci->mpi.send, task_subtype_tend_spart,
cj_nodeID);
}
......
......@@ -55,7 +55,6 @@
#include "star_formation.h"
#include "star_formation_logger.h"
#include "stars.h"
#include "task_order.h"
#include "timers.h"
#include "timestep_limiter.h"
#include "tracers.h"
......
......@@ -29,7 +29,6 @@
#include "active.h"
#include "cell.h"
#include "engine.h"
#include "task_order.h"
#include "timers.h"
/**
......@@ -46,8 +45,6 @@ void runner_do_stars_resort(struct runner *r, struct cell *c, const int timer) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->nodeID != r->e->nodeID) error("Task must be run locally!");
if (!task_order_star_formation_before_feedback)
error("Resorting when not needed");
#endif
TIMER_TIC;
......
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2019 Loic Hausammann (loic.hausammann@epfl.ch)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_TASK_ORDER_H
#define SWIFT_TASK_ORDER_H
#include "../config.h"
/* Local includes */
#include "scheduler.h"
#ifdef TASK_ORDER_DEFAULT
#include "task_order/default/task_order.h"
#elif TASK_ORDER_GEAR
#include "task_order/GEAR/task_order.h"
#elif TASK_ORDER_EAGLE
#include "task_order/EAGLE/task_order.h"
#else
#error undefined task order
#endif
#endif /* SWIFT_TASK_ORDER_H */
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2019 Loic Hausammann (loic.hausammann@epfl.ch)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_TASK_ORDER_EAGLE_H
#define SWIFT_TASK_ORDER_EAGLE_H
/**
* Is the star-formation task running before the feedback task?
*/
#define task_order_star_formation_before_feedback 1
/**
* @brief Place the star formation cell at the right place in the dependency
* graph.
*
* In EAGLE, star formation takes place before the feedback tasks (that are
* launched after the stars_in task).
*
* @param s The #scheduler.
* @param c The #cell on which to act.
* @param star_resort_cell The #cell where the stars re-sorting task is in this
* hierarchy.
*/
INLINE static void task_order_addunlock_star_formation_feedback(
struct scheduler *s, struct cell *c, struct cell *star_resort_cell) {
scheduler_addunlock(s, star_resort_cell->hydro.stars_resort,
c->stars.stars_in);
}
#endif /* SWIFT_TASK_ORDER_EAGLE_H */
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2019 Loic Hausammann (loic.hausammann@epfl.ch)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_TASK_ORDER_GEAR_H
#define SWIFT_TASK_ORDER_GEAR_H
/**
* Is the star-formation task running before the feedback task?
*/
#define task_order_star_formation_before_feedback 0
/**
* @brief Place the star formation cell at the right place in the dependency
* graph.
*
* In GEAR, star formation takes place after the feedback tasks (that are
* finishing with the stars_out task).
*
* @param s The #scheduler.
* @param c The #cell on which to act.
* @param star_resort_cell The #cell where the stars re-sorting task is in this
* hierarchy.
*/
INLINE static void task_order_addunlock_star_formation_feedback(
struct scheduler *s, struct cell *c, struct cell *star_resort_cell) {
scheduler_addunlock(s, c->stars.stars_out, c->top->hydro.star_formation);
}
#endif /* SWIFT_TASK_ORDER_GEAR_H */
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2019 Loic Hausammann (loic.hausammann@epfl.ch)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_TASK_ORDER_DEFAULT_H
#define SWIFT_TASK_ORDER_DEFAULT_H
/**
* @file task_order/default/task_order.h
* @brief Defines the order of the subgrid tasks when no subgrid model has
* been specified. Defaults to the EAGLE model.
*/
/**
* Is the star-formation task running before the feedback task?
*/
#define task_order_star_formation_before_feedback 1
/**
* @brief Place the star formation cell at the right place in the dependency
* graph.
*
* The default model follows EAGLE.
*
* In EAGLE, star formation takes place before the feedback tasks (that are
* launched after the stars_in task).
*
* @param s The #scheduler.
* @param c The #cell on which to act.
* @param star_resort_cell The #cell where the stars re-sorting task is in this
* hierarchy.
*/
INLINE static void task_order_addunlock_star_formation_feedback(
struct scheduler *s, struct cell *c, struct cell *star_resort_cell) {
scheduler_addunlock(s, star_resort_cell->hydro.stars_resort,
c->stars.stars_in);
}
#endif /* SWIFT_TASK_ORDER_DEFAULT_H */
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