Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
dc99b5bf
Commit
dc99b5bf
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Use careful locks and unlocks around the activation of the gravity drifts.
parent
88c04547
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!576
Gravity splittask (non-MPI)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cell.c
+10
-2
10 additions, 2 deletions
src/cell.c
with
10 additions
and
2 deletions
src/cell.c
+
10
−
2
View file @
dc99b5bf
...
@@ -1435,16 +1435,24 @@ void cell_activate_drift_gpart(struct cell *c, struct scheduler *s) {
...
@@ -1435,16 +1435,24 @@ void cell_activate_drift_gpart(struct cell *c, struct scheduler *s) {
/* Set the do_grav_sub_drifts all the way up and activate the super drift
/* Set the do_grav_sub_drifts all the way up and activate the super drift
if this has not yet been done. */
if this has not yet been done. */
if
(
c
==
c
->
super_gravity
)
{
if
(
c
==
c
->
super_gravity
)
{
/* Lock the cell and actuivate things */
if
(
lock_lock
(
&
c
->
lock
)
!=
0
)
error
(
"Error trying to lock cell"
);
if
(
c
->
drift_gpart
==
NULL
)
error
(
"Trying to activate un-existing c->drift_gpart"
);
if
(
c
->
drift_gpart
==
NULL
)
error
(
"Trying to activate un-existing c->drift_gpart"
);
scheduler_activate
(
s
,
c
->
drift_gpart
);
if
(
c
->
drift_gpart
!=
NULL
)
scheduler_activate
(
s
,
c
->
drift_gpart
);
if
(
lock_unlock
(
&
c
->
lock
)
!=
0
)
error
(
"Error trying to unlock cell"
);
}
else
{
}
else
{
for
(
struct
cell
*
parent
=
c
->
parent
;
for
(
struct
cell
*
parent
=
c
->
parent
;
parent
!=
NULL
&&
!
parent
->
do_grav_sub_drift
;
parent
!=
NULL
&&
!
parent
->
do_grav_sub_drift
;
parent
=
parent
->
parent
)
{
parent
=
parent
->
parent
)
{
parent
->
do_grav_sub_drift
=
1
;
parent
->
do_grav_sub_drift
=
1
;
if
(
parent
==
c
->
super_gravity
)
{
if
(
parent
==
c
->
super_gravity
)
{
/* Lock the cell and actuivate things */
if
(
lock_lock
(
&
parent
->
lock
)
!=
0
)
error
(
"Error trying to lock parent cell"
);
if
(
parent
->
drift_gpart
==
NULL
)
error
(
"Trying to activate un-existing parent->drift_gpart"
);
if
(
parent
->
drift_gpart
==
NULL
)
error
(
"Trying to activate un-existing parent->drift_gpart"
);
scheduler_activate
(
s
,
parent
->
drift_gpart
);
if
(
parent
->
drift_gpart
!=
NULL
)
scheduler_activate
(
s
,
parent
->
drift_gpart
);
if
(
lock_unlock
(
&
parent
->
lock
)
!=
0
)
error
(
"Error trying to unlock parent cell"
);
break
;
break
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment