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
7a595a27
Commit
7a595a27
authored
Sep 19, 2017
by
Matthieu Schaller
Browse files
Only finalize the centre of mass calculation if the mass is non-zero
parent
161e8cb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
7a595a27
...
...
@@ -4469,8 +4469,7 @@ void engine_init(struct engine *e, struct space *s,
* do this once we've made at least one call to engine_entry_affinity and
* maybe numa_node_of_cpu(sched_getcpu()), even if the engine isn't already
* pinned. */
if
(
with_aff
)
engine_unpin
();
if
(
with_aff
)
engine_unpin
();
#endif
if
(
with_aff
)
{
...
...
src/statistics.c
View file @
7a595a27
...
...
@@ -301,9 +301,11 @@ void stats_collect(const struct space *s, struct statistics *stats) {
*/
void
stats_finalize
(
struct
statistics
*
stats
)
{
stats
->
centre_of_mass
[
0
]
/=
stats
->
mass
;
stats
->
centre_of_mass
[
1
]
/=
stats
->
mass
;
stats
->
centre_of_mass
[
2
]
/=
stats
->
mass
;
if
(
stats
->
mass
>
0
.)
{
stats
->
centre_of_mass
[
0
]
/=
stats
->
mass
;
stats
->
centre_of_mass
[
1
]
/=
stats
->
mass
;
stats
->
centre_of_mass
[
2
]
/=
stats
->
mass
;
}
}
/**
...
...
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