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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
51f51665
Commit
51f51665
authored
Jan 16, 2017
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Also update the vectorized version of doself to the new active/inactive style.
parent
fb4709d9
No related branches found
No related tags found
1 merge request
!301
New time line
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner_doiact_vec.c
+14
-8
14 additions, 8 deletions
src/runner_doiact_vec.c
with
14 additions
and
8 deletions
src/runner_doiact_vec.c
+
14
−
8
View file @
51f51665
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
/* Config parameters. */
/* Config parameters. */
#include
"../config.h"
#include
"../config.h"
#include
"active.h"
/* This object's header. */
/* This object's header. */
#include
"runner_doiact_vec.h"
#include
"runner_doiact_vec.h"
...
@@ -270,7 +272,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
...
@@ -270,7 +272,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
struct
runner
*
r
,
struct
cell
*
restrict
c
)
{
struct
runner
*
r
,
struct
cell
*
restrict
c
)
{
#ifdef WITH_VECTORIZATION
#ifdef WITH_VECTORIZATION
const
int
ti_current
=
r
->
e
->
ti_current
;
const
struct
engine
*
e
=
r
->
e
;
int
doi_mask
;
int
doi_mask
;
struct
part
*
restrict
pi
;
struct
part
*
restrict
pi
;
int
count_align
;
int
count_align
;
...
@@ -283,8 +285,9 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
...
@@ -283,8 +285,9 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
TIMER_TIC
TIMER_TIC
if
(
c
->
ti_end_min
>
ti_current
)
return
;
if
(
!
cell_is_active
(
c
,
e
))
return
;
if
(
c
->
ti_end_max
<
ti_current
)
error
(
"Cell in an impossible time-zone"
);
if
(
!
cell_is_drifted
(
c
,
e
))
cell_drift
(
c
,
e
);
/* 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. */
...
@@ -308,7 +311,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
...
@@ -308,7 +311,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
pi
=
&
parts
[
pid
];
pi
=
&
parts
[
pid
];
/* Is the ith particle active? */
/* Is the ith particle active? */
if
(
pi
->
ti_end
>
ti_current
)
continue
;
if
(
!
part_is_active
(
pi
,
e
)
)
continue
;
vector
pix
,
piy
,
piz
;
vector
pix
,
piy
,
piz
;
...
@@ -509,6 +512,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
...
@@ -509,6 +512,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
/**
/**
* @brief Compute the cell self-interaction (non-symmetric) using vector
* @brief Compute the cell self-interaction (non-symmetric) using vector
* intrinsics with two particle pis at a time.
* intrinsics with two particle pis at a time.
*
* CURRENTLY BROKEN DO NOT USE.
* CURRENTLY BROKEN DO NOT USE.
*
*
* @param r The #runner.
* @param r The #runner.
...
@@ -518,7 +522,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec_2(
...
@@ -518,7 +522,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec_2(
struct
runner
*
r
,
struct
cell
*
restrict
c
)
{
struct
runner
*
r
,
struct
cell
*
restrict
c
)
{
#ifdef WITH_VECTORIZATION
#ifdef WITH_VECTORIZATION
const
int
ti_current
=
r
->
e
->
ti_current
;
const
struct
engine
*
e
=
r
->
e
;
int
doi_mask
;
int
doi_mask
;
int
doi2_mask
;
int
doi2_mask
;
struct
part
*
restrict
pi
;
struct
part
*
restrict
pi
;
...
@@ -530,9 +534,11 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec_2(
...
@@ -530,9 +534,11 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec_2(
TIMER_TIC
TIMER_TIC
if
(
!
cell_is_active
(
c
,
e
))
return
;
if
(
!
cell_is_drifted
(
c
,
e
))
cell_drift
(
c
,
e
);
/* TODO: Need to find two active particles, not just one. */
/* TODO: Need to find two active particles, not just one. */
if
(
c
->
ti_end_min
>
ti_current
)
return
;
if
(
c
->
ti_end_max
<
ti_current
)
error
(
"Cell in an impossible time-zone"
);
struct
part
*
restrict
parts
=
c
->
parts
;
struct
part
*
restrict
parts
=
c
->
parts
;
const
int
count
=
c
->
count
;
const
int
count
=
c
->
count
;
...
@@ -563,7 +569,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec_2(
...
@@ -563,7 +569,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec_2(
pi2
=
&
parts
[
pid
+
1
];
pi2
=
&
parts
[
pid
+
1
];
/* Is the ith particle active? */
/* Is the ith particle active? */
if
(
pi
->
ti_end
>
ti_current
)
continue
;
if
(
!
part_is_active
(
pi
,
e
)
)
continue
;
vector
pix
,
piy
,
piz
;
vector
pix
,
piy
,
piz
;
vector
pix2
,
piy2
,
piz2
;
vector
pix2
,
piy2
,
piz2
;
...
...
...
...
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
sign in
to comment