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
0e4f4058
Commit
0e4f4058
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Correct boundaries for the sorted DOPAIR2 loops over the axis.
parent
33a74261
No related branches found
No related tags found
1 merge request
!419
Dopair2 fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner_doiact.h
+18
-8
18 additions, 8 deletions
src/runner_doiact.h
with
18 additions
and
8 deletions
src/runner_doiact.h
+
18
−
8
View file @
0e4f4058
...
...
@@ -125,7 +125,7 @@ void DOPAIR1_NAIVE(struct runner *r, struct cell *restrict ci,
const
struct
engine
*
e
=
r
->
e
;
#ifndef SWIFT_DEBUG_CHECKS
error
(
"Don't use in actual runs ! Slow code !"
);
//
error("Don't use in actual runs ! Slow code !");
#endif
#ifdef WITH_VECTORIZATION
...
...
@@ -266,7 +266,7 @@ void DOPAIR2_NAIVE(struct runner *r, struct cell *restrict ci,
const
struct
engine
*
e
=
r
->
e
;
#ifndef SWIFT_DEBUG_CHECKS
error
(
"Don't use in actual runs ! Slow code !"
);
//
error("Don't use in actual runs ! Slow code !");
#endif
TIMER_TIC
;
...
...
@@ -1618,6 +1618,9 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
struct
engine
*
restrict
e
=
r
->
e
;
// DOPAIR2_NAIVE(r, ci, cj);
// return;
TIMER_TIC
;
/* Anything to do here? */
...
...
@@ -1692,7 +1695,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
if
(
cell_is_active
(
ci
,
e
))
{
int
last_pj
=
count_j
;
int
last_pj
=
count_j
-
1
;
/* Loop over the parts in ci until nothing is within range in cj.
* We start from the centre and move outwards. */
...
...
@@ -1711,7 +1714,10 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
if
(
di
<
dj_min
)
continue
;
/* Where do we have to stop when looping over cell j? */
while
(
sort_j
[
last_pj
].
d
>
di
)
last_pj
--
;
while
(
sort_j
[
last_pj
].
d
>
di
&&
last_pj
>
0
)
last_pj
--
;
last_pj
+=
1
;
if
(
last_pj
>=
count_j
)
last_pj
=
count_j
-
1
;
/* Get some additional information about pi */
const
float
hig2
=
hi
*
hi
*
kernel_gamma2
;
...
...
@@ -1720,7 +1726,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
const
float
piz
=
pi
->
x
[
2
]
-
ci
->
loc
[
2
]
-
shift
[
2
];
/* Now loop over the relevant particles in cj */
for
(
int
pjd
=
0
;
pjd
<
last_pj
;
++
pjd
)
{
for
(
int
pjd
=
0
;
pjd
<
=
last_pj
;
++
pjd
)
{
/* Recover pj */
struct
part
*
pj
=
&
parts_j
[
sort_j
[
pjd
].
i
];
...
...
@@ -1761,8 +1767,12 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
const
double
dj
=
sort_j
[
pjd
].
d
-
max
(
hj
,
hi_max
)
*
kernel_gamma
-
dx_max
;
if
(
dj
>
di_max
-
rshift
)
continue
;
/* Where do we have to stop when looping over cell j? */
while
(
sort_i
[
first_pi
].
d
-
rshift
<
dj
)
first_pi
++
;
/* Where do we have to stop when looping over cell i? */
while
(
sort_i
[
first_pi
].
d
-
rshift
<
dj
&&
first_pi
<
count_i
-
1
)
first_pi
++
;
first_pi
-=
1
;
if
(
first_pi
<
0
)
first_pi
=
0
;
/* Get some additional information about pi */
const
float
hjg2
=
hj
*
hj
*
kernel_gamma2
;
...
...
@@ -1771,7 +1781,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
const
float
pjz
=
pj
->
x
[
2
]
-
ci
->
loc
[
2
];
/* Now loop over the relevant particles in ci */
for
(
int
pid
=
count_i
;
pid
>=
first_pi
;
--
pid
)
{
for
(
int
pid
=
count_i
-
1
;
pid
>=
first_pi
;
--
pid
)
{
/* Recover pi */
struct
part
*
pi
=
&
parts_i
[
sort_i
[
pid
].
i
];
...
...
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