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
c4af3c0d
Commit
c4af3c0d
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Corrected documentation and removed MPI exception.
parent
bdfd6679
No related branches found
No related tags found
1 merge request
!292
Drift on demand
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/active.h
+5
-3
5 additions, 3 deletions
src/active.h
src/engine.c
+6
-1
6 additions, 1 deletion
src/engine.c
src/runner.c
+1
-5
1 addition, 5 deletions
src/runner.c
with
12 additions
and
9 deletions
src/active.h
+
5
−
3
View file @
c4af3c0d
...
@@ -30,11 +30,9 @@
...
@@ -30,11 +30,9 @@
/**
/**
* @brief Check that a cell been drifted to the current time.
* @brief Check that a cell been drifted to the current time.
*
*
* Only used for debugging. Calls error() if the cell has not
* been drifted. Does nothing if SWIFT_DEBUG_CHECKS is not defined.
*
* @param c The #cell.
* @param c The #cell.
* @param e The #engine containing information about the current time.
* @param e The #engine containing information about the current time.
* @return 1 if the #cell has been drifted to the current time, 0 otherwise.
*/
*/
__attribute__
((
always_inline
))
INLINE
static
int
cell_is_drifted
(
__attribute__
((
always_inline
))
INLINE
static
int
cell_is_drifted
(
const
struct
cell
*
c
,
const
struct
engine
*
e
)
{
const
struct
cell
*
c
,
const
struct
engine
*
e
)
{
...
@@ -55,6 +53,7 @@ __attribute__((always_inline)) INLINE static int cell_is_drifted(
...
@@ -55,6 +53,7 @@ __attribute__((always_inline)) INLINE static int cell_is_drifted(
*
*
* @param c The #cell.
* @param c The #cell.
* @param e The #engine containing information about the current time.
* @param e The #engine containing information about the current time.
* @param 1 if the #cell contains at least an active particle, 0 otherwise.
*/
*/
__attribute__
((
always_inline
))
INLINE
static
int
cell_is_active
(
__attribute__
((
always_inline
))
INLINE
static
int
cell_is_active
(
const
struct
cell
*
c
,
const
struct
engine
*
e
)
{
const
struct
cell
*
c
,
const
struct
engine
*
e
)
{
...
@@ -73,6 +72,7 @@ __attribute__((always_inline)) INLINE static int cell_is_active(
...
@@ -73,6 +72,7 @@ __attribute__((always_inline)) INLINE static int cell_is_active(
*
*
* @param c The #cell.
* @param c The #cell.
* @param e The #engine containing information about the current time.
* @param e The #engine containing information about the current time.
* @param 1 if all particles in a #cell are active, 0 otherwise.
*/
*/
__attribute__
((
always_inline
))
INLINE
static
int
cell_is_all_active
(
__attribute__
((
always_inline
))
INLINE
static
int
cell_is_all_active
(
const
struct
cell
*
c
,
const
struct
engine
*
e
)
{
const
struct
cell
*
c
,
const
struct
engine
*
e
)
{
...
@@ -91,6 +91,7 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active(
...
@@ -91,6 +91,7 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active(
*
*
* @param p The #part.
* @param p The #part.
* @param e The #engine containing information about the current time.
* @param e The #engine containing information about the current time.
* @return 1 if the #part is active, 0 otherwise.
*/
*/
__attribute__
((
always_inline
))
INLINE
static
int
part_is_active
(
__attribute__
((
always_inline
))
INLINE
static
int
part_is_active
(
const
struct
part
*
p
,
const
struct
engine
*
e
)
{
const
struct
part
*
p
,
const
struct
engine
*
e
)
{
...
@@ -109,6 +110,7 @@ __attribute__((always_inline)) INLINE static int part_is_active(
...
@@ -109,6 +110,7 @@ __attribute__((always_inline)) INLINE static int part_is_active(
*
*
* @param gp The #gpart.
* @param gp The #gpart.
* @param e The #engine containing information about the current time.
* @param e The #engine containing information about the current time.
* @return 1 if the #gpart is active, 0 otherwise.
*/
*/
__attribute__
((
always_inline
))
INLINE
static
int
gpart_is_active
(
__attribute__
((
always_inline
))
INLINE
static
int
gpart_is_active
(
const
struct
gpart
*
gp
,
const
struct
engine
*
e
)
{
const
struct
gpart
*
gp
,
const
struct
engine
*
e
)
{
...
...
This diff is collapsed.
Click to expand it.
src/engine.c
+
6
−
1
View file @
c4af3c0d
...
@@ -2684,7 +2684,7 @@ int engine_is_done(struct engine *e) {
...
@@ -2684,7 +2684,7 @@ int engine_is_done(struct engine *e) {
}
}
/**
/**
* @brief
Drift particles using the current engine drift policy
.
* @brief
Unskip all the tasks that act on active cells at this time
.
*
*
* @param e The #engine.
* @param e The #engine.
*/
*/
...
@@ -2699,6 +2699,11 @@ void engine_unskip(struct engine *e) {
...
@@ -2699,6 +2699,11 @@ void engine_unskip(struct engine *e) {
clocks_getunit
());
clocks_getunit
());
}
}
/**
* @brief Drift *all* particles forward to the current time.
*
* @param e The #engine.
*/
void
engine_drift_all
(
struct
engine
*
e
)
{
void
engine_drift_all
(
struct
engine
*
e
)
{
const
ticks
tic
=
getticks
();
const
ticks
tic
=
getticks
();
...
...
This diff is collapsed.
Click to expand it.
src/runner.c
+
1
−
5
View file @
c4af3c0d
...
@@ -757,7 +757,7 @@ static void runner_do_unskip(struct cell *c, struct engine *e) {
...
@@ -757,7 +757,7 @@ static void runner_do_unskip(struct cell *c, struct engine *e) {
if
(
forcerebuild
)
atomic_inc
(
&
e
->
forcerebuild
);
if
(
forcerebuild
)
atomic_inc
(
&
e
->
forcerebuild
);
}
}
/*
Not drifting, but may still need to recurse for task un-skipping.
*/
/*
Recurse
*/
if
(
c
->
split
)
{
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
k
++
)
{
for
(
int
k
=
0
;
k
<
8
;
k
++
)
{
if
(
c
->
progeny
[
k
]
!=
NULL
)
{
if
(
c
->
progeny
[
k
]
!=
NULL
)
{
...
@@ -783,11 +783,7 @@ void runner_do_unskip_mapper(void *map_data, int num_elements,
...
@@ -783,11 +783,7 @@ void runner_do_unskip_mapper(void *map_data, int num_elements,
for
(
int
ind
=
0
;
ind
<
num_elements
;
ind
++
)
{
for
(
int
ind
=
0
;
ind
<
num_elements
;
ind
++
)
{
struct
cell
*
c
=
&
cells
[
ind
];
struct
cell
*
c
=
&
cells
[
ind
];
#ifdef WITH_MPI
if
(
c
!=
NULL
)
runner_do_unskip
(
c
,
e
);
#else
if
(
c
!=
NULL
)
runner_do_unskip
(
c
,
e
);
if
(
c
!=
NULL
)
runner_do_unskip
(
c
,
e
);
#endif
}
}
}
}
/**
/**
...
...
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