Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
2781ef21
Commit
2781ef21
authored
Mar 01, 2017
by
Matthieu Schaller
Browse files
Restored the grav-down task
parent
b04a14f4
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
2781ef21
...
...
@@ -1320,6 +1320,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
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
);
if
(
c
->
grav_down
!=
NULL
)
scheduler_activate
(
s
,
c
->
grav_down
);
if
(
c
->
cooling
!=
NULL
)
scheduler_activate
(
s
,
c
->
cooling
);
if
(
c
->
sourceterms
!=
NULL
)
scheduler_activate
(
s
,
c
->
sourceterms
);
...
...
src/engine.c
View file @
2781ef21
...
...
@@ -2160,34 +2160,27 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
*/
void
engine_make_gravityrecursive_tasks
(
struct
engine
*
e
)
{
/* struct space *s = e->s; */
/* struct scheduler *sched = &e->sched; */
/* const int nodeID = e->nodeID; */
/* const int nr_cells = s->nr_cells; */
/* struct cell *cells = s->cells_top; */
/* for (int k = 0; k < nr_cells; k++) { */
/* /\* Only do this for local cells containing gravity particles *\/ */
/* if (cells[k].nodeID == nodeID && cells[k].gcount > 0) { */
/* /\* Create tasks at top level. *\/ */
/* struct task *up = */
/* scheduler_addtask(sched, task_type_grav_up, task_subtype_none, 0,
* 0, */
/* &cells[k], NULL, 0); */
/* struct task *down = NULL; */
/* /\* struct task *down = *\/ */
/* /\* scheduler_addtask(sched, task_type_grav_down,
* task_subtype_none, 0, */
/* * 0, *\/ */
/* /\* &cells[k], NULL, 0); *\/ */
/* /\* Push tasks down the cell hierarchy. *\/ */
/* engine_addtasks_grav(e, &cells[k], up, down); */
/* } */
/* } */
struct
space
*
s
=
e
->
s
;
struct
scheduler
*
sched
=
&
e
->
sched
;
const
int
nodeID
=
e
->
nodeID
;
const
int
nr_cells
=
s
->
nr_cells
;
struct
cell
*
cells
=
s
->
cells_top
;
for
(
int
k
=
0
;
k
<
nr_cells
;
k
++
)
{
/* Only do this for local cells containing gravity particles */
if
(
cells
[
k
].
nodeID
==
nodeID
&&
cells
[
k
].
gcount
>
0
)
{
/* Create tasks at top level. */
struct
task
*
up
=
NULL
;
struct
task
*
down
=
scheduler_addtask
(
sched
,
task_type_grav_down
,
task_subtype_none
,
0
,
0
,
&
cells
[
k
],
NULL
,
0
);
/* Push tasks down the cell hierarchy. */
engine_addtasks_grav
(
e
,
&
cells
[
k
],
up
,
down
);
}
}
}
/**
...
...
@@ -2453,6 +2446,11 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
if
(
cell_is_active
(
t
->
ci
,
e
))
scheduler_activate
(
s
,
t
);
}
/* Gravity ? */
else
if
(
t
->
type
==
task_type_grav_down
)
{
if
(
cell_is_active
(
t
->
ci
,
e
))
scheduler_activate
(
s
,
t
);
}
/* Time-step? */
else
if
(
t
->
type
==
task_type_timestep
)
{
t
->
ci
->
updated
=
0
;
...
...
src/runner.c
View file @
2781ef21
...
...
@@ -1797,12 +1797,11 @@ void *runner_main(void *data) {
break
;
#endif
case
task_type_grav_mm
:
// runner_do_grav_mm(r, t->ci, 1);
;
// runner_do_grav_mm(r, t->ci, 1);
break
;
case
task_type_grav_down
:
// runner_do_grav_down(r, t->ci);
break
;
/* case task_type_grav_up: */
/* runner_do_grav_up(r, t->ci); */
/* break; */
/* case task_type_grav_gather_m: */
/* break; */
/* case task_type_grav_fft: */
...
...
src/timeline.h
View file @
2781ef21
...
...
@@ -37,6 +37,8 @@ typedef char timebin_t;
/*! The maximal number of timesteps in a simulation */
#define max_nr_timesteps (1LL << (num_time_bins + 1))
#define time_bin_inactive (num_time_bins + 2)
/**
* @brief Returns the integer time interval corresponding to a time bin
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment