Skip to content
GitLab
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
d4721fbe
Commit
d4721fbe
authored
Oct 14, 2016
by
Matthieu Schaller
Browse files
Remove the individual task counters.
parent
98fff2d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
d4721fbe
...
...
@@ -757,16 +757,9 @@ void cell_convert_hydro(struct cell *c, void *data) {
*/
void
cell_clean_links
(
struct
cell
*
c
,
void
*
data
)
{
c
->
density
=
NULL
;
c
->
nr_density
=
0
;
c
->
gradient
=
NULL
;
c
->
nr_gradient
=
0
;
c
->
force
=
NULL
;
c
->
nr_force
=
0
;
c
->
grav
=
NULL
;
c
->
nr_grav
=
0
;
}
/**
...
...
src/cell.h
View file @
d4721fbe
...
...
@@ -140,7 +140,6 @@ struct cell {
/* The tasks computing this cell's density. */
struct
link
*
density
,
*
gradient
,
*
force
,
*
grav
;
int
nr_density
,
nr_gradient
,
nr_force
,
nr_grav
;
/* The hierarchical tasks. */
struct
task
*
extra_ghost
,
*
ghost
,
*
init
,
*
kick
;
...
...
src/engine.c
View file @
d4721fbe
...
...
@@ -1358,15 +1358,12 @@ void engine_count_and_link_tasks(struct engine *e) {
atomic_inc
(
&
ci
->
nr_tasks
);
if
(
t
->
subtype
==
task_subtype_density
)
{
engine_addlink
(
e
,
&
ci
->
density
,
t
);
atomic_inc
(
&
ci
->
nr_density
);
}
if
(
t
->
subtype
==
task_subtype_grav
)
{
engine_addlink
(
e
,
&
ci
->
grav
,
t
);
atomic_inc
(
&
ci
->
nr_grav
);
}
if
(
t
->
subtype
==
task_subtype_external_grav
)
{
engine_addlink
(
e
,
&
ci
->
grav
,
t
);
atomic_inc
(
&
ci
->
nr_grav
);
}
/* Link pair tasks to cells. */
...
...
@@ -1375,15 +1372,11 @@ void engine_count_and_link_tasks(struct engine *e) {
atomic_inc
(
&
cj
->
nr_tasks
);
if
(
t
->
subtype
==
task_subtype_density
)
{
engine_addlink
(
e
,
&
ci
->
density
,
t
);
atomic_inc
(
&
ci
->
nr_density
);
engine_addlink
(
e
,
&
cj
->
density
,
t
);
atomic_inc
(
&
cj
->
nr_density
);
}
if
(
t
->
subtype
==
task_subtype_grav
)
{
engine_addlink
(
e
,
&
ci
->
grav
,
t
);
atomic_inc
(
&
ci
->
nr_grav
);
engine_addlink
(
e
,
&
cj
->
grav
,
t
);
atomic_inc
(
&
cj
->
nr_grav
);
}
/* Link sub-self tasks to cells. */
...
...
@@ -1391,15 +1384,12 @@ void engine_count_and_link_tasks(struct engine *e) {
atomic_inc
(
&
ci
->
nr_tasks
);
if
(
t
->
subtype
==
task_subtype_density
)
{
engine_addlink
(
e
,
&
ci
->
density
,
t
);
atomic_inc
(
&
ci
->
nr_density
);
}
if
(
t
->
subtype
==
task_subtype_grav
)
{
engine_addlink
(
e
,
&
ci
->
grav
,
t
);
atomic_inc
(
&
ci
->
nr_grav
);
}
if
(
t
->
subtype
==
task_subtype_external_grav
)
{
engine_addlink
(
e
,
&
ci
->
grav
,
t
);
atomic_inc
(
&
ci
->
nr_grav
);
}
/* Link sub-pair tasks to cells. */
...
...
@@ -1408,22 +1398,16 @@ void engine_count_and_link_tasks(struct engine *e) {
atomic_inc
(
&
cj
->
nr_tasks
);
if
(
t
->
subtype
==
task_subtype_density
)
{
engine_addlink
(
e
,
&
ci
->
density
,
t
);
atomic_inc
(
&
ci
->
nr_density
);
engine_addlink
(
e
,
&
cj
->
density
,
t
);
atomic_inc
(
&
cj
->
nr_density
);
}
if
(
t
->
subtype
==
task_subtype_grav
)
{
engine_addlink
(
e
,
&
ci
->
grav
,
t
);
atomic_inc
(
&
ci
->
nr_grav
);
engine_addlink
(
e
,
&
cj
->
grav
,
t
);
atomic_inc
(
&
cj
->
nr_grav
);
}
if
(
t
->
subtype
==
task_subtype_external_grav
)
{
error
(
"Found a sub-pair/external-gravity task..."
);
engine_addlink
(
e
,
&
ci
->
grav
,
t
);
atomic_inc
(
&
ci
->
nr_grav
);
engine_addlink
(
e
,
&
cj
->
grav
,
t
);
atomic_inc
(
&
cj
->
nr_grav
);
}
}
}
...
...
@@ -1649,9 +1633,7 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loops and the cell */
engine_addlink
(
e
,
&
t
->
ci
->
gradient
,
t2
);
atomic_inc
(
&
t
->
ci
->
nr_gradient
);
engine_addlink
(
e
,
&
t
->
ci
->
force
,
t3
);
atomic_inc
(
&
t
->
ci
->
nr_force
);
/* Now, build all the dependencies for the hydro */
engine_make_hydro_loops_dependencies
(
sched
,
t
,
t2
,
t3
,
t
->
ci
);
...
...
@@ -1664,7 +1646,6 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and the cell */
engine_addlink
(
e
,
&
t
->
ci
->
force
,
t2
);
atomic_inc
(
&
t
->
ci
->
nr_force
);
/* Now, build all the dependencies for the hydro */
engine_make_hydro_loops_dependencies
(
sched
,
t
,
t2
,
t
->
ci
);
...
...
@@ -1683,13 +1664,9 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and both cells */
engine_addlink
(
e
,
&
t
->
ci
->
gradient
,
t2
);
atomic_inc
(
&
t
->
ci
->
nr_gradient
);
engine_addlink
(
e
,
&
t
->
cj
->
gradient
,
t2
);
atomic_inc
(
&
t
->
cj
->
nr_gradient
);
engine_addlink
(
e
,
&
t
->
ci
->
force
,
t3
);
atomic_inc
(
&
t
->
ci
->
nr_force
);
engine_addlink
(
e
,
&
t
->
cj
->
force
,
t3
);
atomic_inc
(
&
t
->
cj
->
nr_force
);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
...
...
@@ -1708,9 +1685,7 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and both cells */
engine_addlink
(
e
,
&
t
->
ci
->
force
,
t2
);
atomic_inc
(
&
t
->
ci
->
nr_force
);
engine_addlink
(
e
,
&
t
->
cj
->
force
,
t2
);
atomic_inc
(
&
t
->
cj
->
nr_force
);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
...
...
@@ -1741,9 +1716,7 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and the cell */
engine_addlink
(
e
,
&
t
->
ci
->
gradient
,
t2
);
atomic_inc
(
&
t
->
ci
->
nr_gradient
);
engine_addlink
(
e
,
&
t
->
ci
->
force
,
t3
);
atomic_inc
(
&
t
->
ci
->
nr_force
);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
...
...
@@ -1759,7 +1732,6 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and the cell */
engine_addlink
(
e
,
&
t
->
ci
->
force
,
t2
);
atomic_inc
(
&
t
->
ci
->
nr_force
);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
...
...
@@ -1785,13 +1757,9 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and both cells */
engine_addlink
(
e
,
&
t
->
ci
->
gradient
,
t2
);
atomic_inc
(
&
t
->
ci
->
nr_gradient
);
engine_addlink
(
e
,
&
t
->
cj
->
gradient
,
t2
);
atomic_inc
(
&
t
->
cj
->
nr_gradient
);
engine_addlink
(
e
,
&
t
->
ci
->
force
,
t3
);
atomic_inc
(
&
t
->
ci
->
nr_force
);
engine_addlink
(
e
,
&
t
->
cj
->
force
,
t3
);
atomic_inc
(
&
t
->
cj
->
nr_force
);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
...
...
@@ -1810,9 +1778,7 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and both cells */
engine_addlink
(
e
,
&
t
->
ci
->
force
,
t2
);
atomic_inc
(
&
t
->
ci
->
nr_force
);
engine_addlink
(
e
,
&
t
->
cj
->
force
,
t2
);
atomic_inc
(
&
t
->
cj
->
nr_force
);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
...
...
src/space.c
View file @
d4721fbe
...
...
@@ -392,10 +392,6 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
space_rebuild_recycle
(
s
,
&
s
->
cells_top
[
k
]);
s
->
cells_top
[
k
].
sorts
=
NULL
;
s
->
cells_top
[
k
].
nr_tasks
=
0
;
s
->
cells_top
[
k
].
nr_density
=
0
;
s
->
cells_top
[
k
].
nr_gradient
=
0
;
s
->
cells_top
[
k
].
nr_force
=
0
;
s
->
cells_top
[
k
].
nr_grav
=
0
;
s
->
cells_top
[
k
].
density
=
NULL
;
s
->
cells_top
[
k
].
gradient
=
NULL
;
s
->
cells_top
[
k
].
force
=
NULL
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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