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
6f12fe19
Commit
6f12fe19
authored
Oct 13, 2016
by
Matthieu Schaller
Browse files
Also update the counter of gravity self/pair tasks when linking them.
parent
7f64ed3b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
6f12fe19
...
...
@@ -763,6 +763,9 @@ void cell_clean_links(struct cell *c, void *data) {
c
->
force
=
NULL
;
c
->
nr_force
=
0
;
c
->
grav
=
NULL
;
c
->
nr_grav
=
0
;
}
/**
...
...
src/engine.c
View file @
6f12fe19
...
...
@@ -1409,6 +1409,7 @@ static inline void engine_make_gravity_dependencies(struct engine *e,
/* link to cell. */
engine_addlink
(
e
,
&
c
->
grav
,
gravity
);
atomic_inc
(
&
c
->
nr_grav
);
}
/**
...
...
@@ -1420,11 +1421,9 @@ static inline void engine_make_gravity_dependencies(struct engine *e,
* @param gravity The gravity task to link.
* @param c The cell.
*/
static
inline
void
engine_make_external_gravity_dependencies
(
struct
engine
*
e
,
struct
scheduler
*
sched
,
struct
task
*
gravity
,
struct
cell
*
c
)
{
static
inline
void
engine_make_external_gravity_dependencies
(
struct
engine
*
e
,
struct
scheduler
*
sched
,
struct
task
*
gravity
,
struct
cell
*
c
)
{
/* init --> external gravity --> kick */
scheduler_addunlock
(
sched
,
c
->
super
->
init
,
gravity
);
...
...
@@ -1432,6 +1431,7 @@ static inline void engine_make_external_gravity_dependencies(struct engine *e,
/* link to cell. */
engine_addlink
(
e
,
&
c
->
grav
,
gravity
);
atomic_inc
(
&
c
->
nr_grav
);
}
/**
...
...
src/space.c
View file @
6f12fe19
...
...
@@ -395,6 +395,7 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
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
;
...
...
@@ -587,8 +588,7 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
for
(
size_t
k
=
1
;
k
<
nr_parts
;
k
++
)
{
if
(
ind
[
k
-
1
]
>
ind
[
k
])
{
error
(
"Sort failed!"
);
}
else
if
(
ind
[
k
]
!=
cell_getid
(
s
->
cdim
,
s
->
parts
[
k
].
x
[
0
]
*
s
->
iwidth
[
0
],
}
else
if
(
ind
[
k
]
!=
cell_getid
(
s
->
cdim
,
s
->
parts
[
k
].
x
[
0
]
*
s
->
iwidth
[
0
],
s
->
parts
[
k
].
x
[
1
]
*
s
->
iwidth
[
1
],
s
->
parts
[
k
].
x
[
2
]
*
s
->
iwidth
[
2
]))
{
error
(
"Incorrect indices!"
);
...
...
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