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
73a09c7a
Commit
73a09c7a
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Plain Diff
Merge branch '380-check-for-drifted-state-in-vectorized-tasks' into 'master'
Resolve "Check for drifted state in vectorized tasks" Closes
#380
See merge request
!449
parents
602118e3
bc44965f
No related branches found
No related tags found
1 merge request
!449
Resolve "Check for drifted state in vectorized tasks"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner_doiact_vec.c
+36
-9
36 additions, 9 deletions
src/runner_doiact_vec.c
with
36 additions
and
9 deletions
src/runner_doiact_vec.c
+
36
−
9
View file @
73a09c7a
...
@@ -541,6 +541,14 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
...
@@ -541,6 +541,14 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
if
(
!
cell_are_part_drifted
(
c
,
e
))
error
(
"Interacting undrifted cell."
);
if
(
!
cell_are_part_drifted
(
c
,
e
))
error
(
"Interacting undrifted cell."
);
#ifdef SWIFT_DEBUG_CHECKS
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
/* Check that particles have been drifted to the current time */
if
(
parts
[
i
].
ti_drift
!=
e
->
ti_current
)
error
(
"Particle pi not drifted to current time"
);
}
#endif
/* Get the particle cache from the runner and re-allocate
/* Get the particle cache from the runner and re-allocate
* the cache if it is not big enough for the cell. */
* the cache if it is not big enough for the cell. */
struct
cache
*
restrict
cell_cache
=
&
r
->
ci_cache
;
struct
cache
*
restrict
cell_cache
=
&
r
->
ci_cache
;
...
@@ -944,6 +952,14 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
...
@@ -944,6 +952,14 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
if
(
!
cell_are_part_drifted
(
c
,
e
))
error
(
"Interacting undrifted cell."
);
if
(
!
cell_are_part_drifted
(
c
,
e
))
error
(
"Interacting undrifted cell."
);
#ifdef SWIFT_DEBUG_CHECKS
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
/* Check that particles have been drifted to the current time */
if
(
parts
[
i
].
ti_drift
!=
e
->
ti_current
)
error
(
"Particle pi not drifted to current time"
);
}
#endif
/* Get the particle cache from the runner and re-allocate
/* Get the particle cache from the runner and re-allocate
* the cache if it is not big enough for the cell. */
* the cache if it is not big enough for the cell. */
struct
cache
*
restrict
cell_cache
=
&
r
->
ci_cache
;
struct
cache
*
restrict
cell_cache
=
&
r
->
ci_cache
;
...
@@ -955,15 +971,6 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
...
@@ -955,15 +971,6 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
/* Read the particles from the cell and store them locally in the cache. */
/* Read the particles from the cell and store them locally in the cache. */
cache_read_force_particles
(
c
,
cell_cache
);
cache_read_force_particles
(
c
,
cell_cache
);
#ifdef SWIFT_DEBUG_CHECKS
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
pi
=
&
c
->
parts
[
i
];
/* Check that particles have been drifted to the current time */
if
(
pi
->
ti_drift
!=
e
->
ti_current
)
error
(
"Particle pi not drifted to current time"
);
}
#endif
/* Loop over the particles in the cell. */
/* Loop over the particles in the cell. */
for
(
int
pid
=
0
;
pid
<
count
;
pid
++
)
{
for
(
int
pid
=
0
;
pid
<
count
;
pid
++
)
{
...
@@ -1138,6 +1145,16 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
...
@@ -1138,6 +1145,16 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
const
int
active_ci
=
cell_is_active
(
ci
,
e
);
const
int
active_ci
=
cell_is_active
(
ci
,
e
);
const
int
active_cj
=
cell_is_active
(
cj
,
e
);
const
int
active_cj
=
cell_is_active
(
cj
,
e
);
#ifdef SWIFT_DEBUG_CHECKS
/* Check that particles have been drifted to the current time */
for
(
int
pid
=
0
;
pid
<
count_i
;
pid
++
)
if
(
parts_i
[
pid
].
ti_drift
!=
e
->
ti_current
)
error
(
"Particle pi not drifted to current time"
);
for
(
int
pjd
=
0
;
pjd
<
count_j
;
pjd
++
)
if
(
parts_j
[
pjd
].
ti_drift
!=
e
->
ti_current
)
error
(
"Particle pj not drifted to current time"
);
#endif
/* Count number of particles that are in range and active*/
/* Count number of particles that are in range and active*/
int
numActive
=
0
;
int
numActive
=
0
;
...
@@ -1479,6 +1496,16 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
...
@@ -1479,6 +1496,16 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
const
int
active_ci
=
cell_is_active
(
ci
,
e
);
const
int
active_ci
=
cell_is_active
(
ci
,
e
);
const
int
active_cj
=
cell_is_active
(
cj
,
e
);
const
int
active_cj
=
cell_is_active
(
cj
,
e
);
#ifdef SWIFT_DEBUG_CHECKS
/* Check that particles have been drifted to the current time */
for
(
int
pid
=
0
;
pid
<
count_i
;
pid
++
)
if
(
parts_i
[
pid
].
ti_drift
!=
e
->
ti_current
)
error
(
"Particle pi not drifted to current time"
);
for
(
int
pjd
=
0
;
pjd
<
count_j
;
pjd
++
)
if
(
parts_j
[
pjd
].
ti_drift
!=
e
->
ti_current
)
error
(
"Particle pj not drifted to current time"
);
#endif
/* Check if any particles are active and in range */
/* Check if any particles are active and in range */
int
numActive
=
0
;
int
numActive
=
0
;
...
...
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