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
0e91a8c4
Commit
0e91a8c4
authored
Dec 27, 2017
by
Matthieu Schaller
Browse files
Drift multipoles atomically in cell_unskip().
parent
949d9e03
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cell.c
View file @
0e91a8c4
...
@@ -1814,8 +1814,15 @@ void cell_activate_subcell_grav_tasks(struct cell *ci, struct cell *cj,
...
@@ -1814,8 +1814,15 @@ void cell_activate_subcell_grav_tasks(struct cell *ci, struct cell *cj,
if
(
!
cell_is_active_gravity
(
ci
,
e
)
&&
!
cell_is_active_gravity
(
cj
,
e
))
if
(
!
cell_is_active_gravity
(
ci
,
e
)
&&
!
cell_is_active_gravity
(
cj
,
e
))
return
;
return
;
/* Atomically drift the multipole in ci */
lock_lock
(
&
ci
->
mlock
);
if
(
ci
->
ti_old_multipole
<
e
->
ti_current
)
cell_drift_multipole
(
ci
,
e
);
if
(
ci
->
ti_old_multipole
<
e
->
ti_current
)
cell_drift_multipole
(
ci
,
e
);
if
(
lock_unlock
(
&
ci
->
mlock
)
!=
0
)
error
(
"Impossible to unlock m-pole"
);
/* Atomically drift the multipole in cj */
lock_lock
(
&
cj
->
mlock
);
if
(
cj
->
ti_old_multipole
<
e
->
ti_current
)
cell_drift_multipole
(
cj
,
e
);
if
(
cj
->
ti_old_multipole
<
e
->
ti_current
)
cell_drift_multipole
(
cj
,
e
);
if
(
lock_unlock
(
&
cj
->
mlock
)
!=
0
)
error
(
"Impossible to unlock m-pole"
);
/* Recover the multipole information */
/* Recover the multipole information */
struct
gravity_tensors
*
const
multi_i
=
ci
->
multipole
;
struct
gravity_tensors
*
const
multi_i
=
ci
->
multipole
;
...
...
Matthieu Schaller
@matthieu
mentioned in issue
#390 (closed)
·
Dec 28, 2017
mentioned in issue
#390 (closed)
mentioned in issue #390
Toggle commit list
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