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
283d211e
Commit
283d211e
authored
Aug 22, 2017
by
James Willis
Browse files
Skip active loops if cell is not active.
parent
9763aaa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/runner_doiact_vec.c
View file @
283d211e
...
...
@@ -655,21 +655,26 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
const
double
di_max
=
sort_i
[
count_i
-
1
].
d
-
rshift
;
const
double
dj_min
=
sort_j
[
0
].
d
;
const
float
dx_max
=
(
ci
->
dx_max_sort
+
cj
->
dx_max_sort
);
const
int
active_ci
=
cell_is_active
(
ci
,
e
);
const
int
active_cj
=
cell_is_active
(
cj
,
e
);
/* Check if any particles are active and return if there are not. */
int
numActive
=
0
;
for
(
int
pid
=
count_i
-
1
;
pid
>=
0
&&
sort_i
[
pid
].
d
+
hi_max
+
dx_max
>
dj_min
;
pid
--
)
{
struct
part
*
restrict
pi
=
&
parts_i
[
sort_i
[
pid
].
i
];
if
(
part_is_active
(
pi
,
e
))
{
numActive
++
;
break
;
if
(
active_ci
)
{
for
(
int
pid
=
count_i
-
1
;
pid
>=
0
&&
sort_i
[
pid
].
d
+
hi_max
+
dx_max
>
dj_min
;
pid
--
)
{
struct
part
*
restrict
pi
=
&
parts_i
[
sort_i
[
pid
].
i
];
if
(
part_is_active
(
pi
,
e
))
{
numActive
++
;
break
;
}
}
}
if
(
!
numActive
)
{
if
(
!
numActive
&&
active_cj
)
{
for
(
int
pjd
=
0
;
pjd
<
count_j
&&
sort_j
[
pjd
].
d
-
hj_max
-
dx_max
<
di_max
;
pjd
++
)
{
pjd
++
)
{
struct
part
*
restrict
pj
=
&
parts_j
[
sort_j
[
pjd
].
i
];
if
(
part_is_active
(
pj
,
e
))
{
numActive
++
;
...
...
@@ -726,7 +731,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
/* Get the number of particles read into the ci cache. */
int
ci_cache_count
=
count_i
-
first_pi_align
;
if
(
cell_is_
active
(
ci
,
e
)
)
{
if
(
active
_
ci
)
{
/* Loop over the parts in ci until nothing is within range in cj. */
for
(
int
pid
=
count_i
-
1
;
pid
>=
first_pi_loop
;
pid
--
)
{
...
...
@@ -854,7 +859,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
}
/* loop over the parts in ci. */
}
if
(
cell_is_
active
(
cj
,
e
)
)
{
if
(
active
_
cj
)
{
/* Loop over the parts in cj until nothing is within range in ci. */
for
(
int
pjd
=
0
;
pjd
<=
last_pj_loop
;
pjd
++
)
{
...
...
Write
Preview
Supports
Markdown
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