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
3af059d1
Commit
3af059d1
authored
8 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
add a function to clear cell flags.
parent
3f3d324f
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!343
Subset sorting
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cell.c
+13
-9
13 additions, 9 deletions
src/cell.c
src/cell.h
+1
-0
1 addition, 0 deletions
src/cell.h
with
14 additions
and
9 deletions
src/cell.c
+
13
−
9
View file @
3af059d1
...
...
@@ -1316,6 +1316,14 @@ int cell_is_drift_needed(struct cell *c, const struct engine *e) {
return
0
;
}
/**
* @brief Clear the drift flags on the given cell.
*/
void
cell_clear_drift_flags
(
struct
cell
*
c
,
void
*
data
)
{
c
->
do_drift
=
0
;
c
->
do_sub_drift
=
0
;
}
/**
* @brief Activate the drifts on the given cell.
*/
...
...
@@ -1358,8 +1366,8 @@ void cell_activate_sorts(struct cell *c, int sid, struct scheduler *s) {
for
(
struct
cell
*
finger
=
c
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
{
if
(
finger
->
requires_sorts
==
ti_current
)
{
atomic_or
(
&
finger
->
sorts
->
flags
,
finger
->
sorted
);
scheduler_activate
(
s
,
finger
->
sorts
);
if
(
finger
->
nodeID
==
engine_rank
)
cell_activate_drift_part
(
finger
,
s
);
scheduler_activate
(
s
,
finger
->
sorts
);
}
finger
->
sorted
=
0
;
}
...
...
@@ -1896,10 +1904,6 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) {
/* Update the time of the last drift */
c
->
ti_old_part
=
ti_current
;
/* Clear the drift flags. */
c
->
do_drift
=
0
;
c
->
do_sub_drift
=
0
;
}
else
if
(
force
&&
ti_current
>
ti_old_part
)
{
/* Loop over all the gas particles in the cell */
...
...
@@ -1946,11 +1950,11 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) {
/* Update the time of the last drift */
c
->
ti_old_part
=
ti_current
;
/* Clear the drift flags. */
c
->
do_drift
=
0
;
c
->
do_sub_drift
=
0
;
}
/* Clear the drift flags. */
c
->
do_drift
=
0
;
c
->
do_sub_drift
=
0
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/cell.h
+
1
−
0
View file @
3af059d1
...
...
@@ -397,6 +397,7 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
struct
scheduler
*
s
);
void
cell_activate_drift_part
(
struct
cell
*
c
,
struct
scheduler
*
s
);
void
cell_activate_sorts
(
struct
cell
*
c
,
int
sid
,
struct
scheduler
*
s
);
void
cell_clear_drift_flags
(
struct
cell
*
c
,
void
*
data
);
/* Inlined functions (for speed). */
...
...
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