Skip to content
GitLab
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
fba0dd79
Commit
fba0dd79
authored
Apr 25, 2017
by
Pedro Gonnet
Browse files
formatting.
parent
5bb19409
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/runner.c
View file @
fba0dd79
...
...
@@ -290,12 +290,10 @@ void runner_do_sort_ascending(struct entry *sort, int N) {
}
void
runner_check_sorts
(
struct
cell
*
c
,
int
flags
)
{
if
(
flags
&
~
c
->
sorted
)
error
(
"Inconsistent sort flags (downward)!"
);
if
(
flags
&
~
c
->
sorted
)
error
(
"Inconsistent sort flags (downward)!"
);
if
(
c
->
split
)
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
runner_check_sorts
(
c
->
progeny
[
k
],
c
->
sorted
);
if
(
c
->
progeny
[
k
]
!=
NULL
)
runner_check_sorts
(
c
->
progeny
[
k
],
c
->
sorted
);
}
/**
...
...
@@ -321,15 +319,15 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int clock) {
/* Check that the particles have been moved to the current time */
if
(
!
cell_is_drifted
(
c
,
r
->
e
))
error
(
"Sorting un-drifted cell"
);
#ifdef SWIFT_DEBUG_CHECKS
/* Make sure the sort flags are consistent (downward). */
runner_check_sorts
(
c
,
c
->
sorted
);
/* Make sure the sort flags are consistent (upard). */
for
(
struct
cell
*
finger
=
c
->
parent
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
{
if
(
finger
->
sorted
&
~
c
->
sorted
)
error
(
"Inconsistent sort flags (upward)."
);
for
(
struct
cell
*
finger
=
c
->
parent
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
{
if
(
finger
->
sorted
&
~
c
->
sorted
)
error
(
"Inconsistent sort flags (upward)."
);
}
#endif
...
...
@@ -344,7 +342,7 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int clock) {
c
->
sorted
=
0
;
}
if
(
flags
==
0
)
return
;
/* start by allocating the entry arrays. */
if
(
c
->
sort
==
NULL
||
c
->
sortsize
<
count
)
{
if
(
c
->
sort
!=
NULL
)
free
(
c
->
sort
);
...
...
@@ -357,7 +355,7 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int clock) {
/* Does this cell have any progeny? */
if
(
c
->
split
)
{
/* Fill in the gaps within the progeny. */
float
dx_max_sort
=
0
.
0
f
;
for
(
int
k
=
0
;
k
<
8
;
k
++
)
{
...
...
@@ -495,14 +493,14 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int clock) {
if
(
finger
[
k
].
i
>=
count
)
error
(
"Sorting failed, indices borked."
);
}
}
/* Make sure the sort flags are consistent (downward). */
runner_check_sorts
(
c
,
flags
);
/* Make sure the sort flags are consistent (upward). */
for
(
struct
cell
*
finger
=
c
->
parent
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
{
if
(
finger
->
sorted
&
~
c
->
sorted
)
error
(
"Inconsistent sort flags."
);
for
(
struct
cell
*
finger
=
c
->
parent
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
{
if
(
finger
->
sorted
&
~
c
->
sorted
)
error
(
"Inconsistent sort flags."
);
}
#endif
...
...
src/runner_doiact.h
View file @
fba0dd79
...
...
@@ -605,11 +605,12 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci,
sid
=
sortlistID
[
sid
];
/* Have the cells been sorted? */
if
(
!
(
cj
->
sorted
&
(
1
<<
sid
))
||
cj
->
dx_max_sort
>
space_maxreldx
*
cj
->
dmin
)
{
if
(
!
(
cj
->
sorted
&
(
1
<<
sid
))
||
cj
->
dx_max_sort
>
space_maxreldx
*
cj
->
dmin
)
{
DOPAIR_SUBSET_NAIVE
(
r
,
ci
,
parts_i
,
ind
,
count
,
cj
);
return
;
}
/* Pick-out the sorted lists. */
const
struct
entry
*
restrict
sort_j
=
&
cj
->
sort
[
sid
*
(
cj
->
count
+
1
)];
const
float
dxj
=
cj
->
dx_max_sort
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment