Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
ab51e592
Commit
ab51e592
authored
Oct 30, 2017
by
James Willis
Browse files
Fix the exit iteration padding.
parent
214e577e
Changes
1
Show whitespace changes
Inline
Side-by-side
src/runner_doiact_vec.c
View file @
ab51e592
...
...
@@ -1255,20 +1255,10 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
vector
v_curlvySum
=
vector_setzero
();
vector
v_curlvzSum
=
vector_setzero
();
/* Pad the exit iteration if there is a serial remainder. */
int
exit_iteration_align
=
exit_iteration
;
const
int
rem
=
exit_iteration
%
VEC_SIZE
;
if
(
rem
!=
0
)
{
const
int
pad
=
VEC_SIZE
-
rem
;
if
(
exit_iteration_align
+
pad
<=
last_pj
+
1
)
exit_iteration_align
+=
pad
;
}
/* Loop over the parts in cj. Making sure to perform an iteration of the
* loop even if exit_iteration_align is zero and there is only one
* particle to interact with.*/
for
(
int
pjd
=
0
;
pjd
<=
exit_iteration
_align
;
pjd
+=
VEC_SIZE
)
{
for
(
int
pjd
=
0
;
pjd
<=
exit_iteration
;
pjd
+=
VEC_SIZE
)
{
/* Get the cache index to the jth particle. */
const
int
cj_cache_idx
=
pjd
;
...
...
@@ -1376,7 +1366,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
int
exit_iteration_align
=
exit_iteration
-
first_pi
;
/* Pad the exit iteration align so cache reads are aligned. */
const
int
rem
=
exit_iteration_align
%
VEC_SIZE
;
const
int
rem
=
(
ci_cache_count
-
exit_iteration_align
)
%
VEC_SIZE
;
if
(
exit_iteration_align
<
VEC_SIZE
)
{
exit_iteration_align
=
0
;
}
else
...
...
@@ -1614,20 +1604,10 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
vector
v_sigSum
=
vector_set1
(
pi
->
force
.
v_sig
);
vector
v_entropy_dtSum
=
vector_setzero
();
/* Pad the exit iteration if there is a serial remainder. */
int
exit_iteration_align
=
exit_iteration
;
const
int
rem
=
exit_iteration
%
VEC_SIZE
;
if
(
rem
!=
0
)
{
int
pad
=
VEC_SIZE
-
rem
;
if
(
exit_iteration_align
+
pad
<=
last_pj
+
1
)
exit_iteration_align
+=
pad
;
}
/* Loop over the parts in cj. Making sure to perform an iteration of the
* loop even if exit_iteration_align is zero and there is only one
* particle to interact with.*/
for
(
int
pjd
=
0
;
pjd
<=
exit_iteration
_align
;
pjd
+=
VEC_SIZE
)
{
for
(
int
pjd
=
0
;
pjd
<=
exit_iteration
;
pjd
+=
VEC_SIZE
)
{
/* Get the cache index to the jth particle. */
const
int
cj_cache_idx
=
pjd
;
...
...
@@ -1749,7 +1729,7 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
int
exit_iteration_align
=
exit_iteration
-
first_pi
;
/* Pad the exit iteration align so cache reads are aligned. */
const
int
rem
=
exit_iteration_align
%
VEC_SIZE
;
const
int
rem
=
(
ci_cache_count
-
exit_iteration_align
)
%
VEC_SIZE
;
if
(
exit_iteration_align
<
VEC_SIZE
)
{
exit_iteration_align
=
0
;
}
else
...
...
James Willis
@jwillis
mentioned in commit
c9b11f99
·
Oct 30, 2017
mentioned in commit
c9b11f99
mentioned in commit c9b11f99b3ffc5bf7fed556e1a4419085c0784b6
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment