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
7088644a
Commit
7088644a
authored
Mar 25, 2016
by
Matthieu Schaller
Browse files
Post-merge changes
parent
8a86e252
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/space.c
View file @
7088644a
...
...
@@ -480,7 +480,7 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
const
struct
gpart
*
const
p
=
&
s
->
gparts
[
k
];
gind
[
k
]
=
cell_getid
(
cdim
,
p
->
x
[
0
]
*
ih
[
0
],
p
->
x
[
1
]
*
ih
[
1
],
p
->
x
[
2
]
*
ih
[
2
]);
cells
[
gind
[
k
]].
count
+=
1
;
cells
[
gind
[
k
]].
g
count
+=
1
;
/* if ( cells[ ind[k] ].nodeID != nodeID )
error( "Received part that does not belong to me (nodeID=%i)." , cells[
ind[k] ].nodeID ); */
...
...
@@ -490,7 +490,7 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
#endif
/* Sort the parts according to their cells. */
space_gparts_sort
(
s
->
gparts
,
gind
,
nr_gparts
,
0
,
s
->
nr_cells
-
1
);
space_gparts_sort
(
s
,
gind
,
nr_gparts
,
0
,
s
->
nr_cells
-
1
,
verbose
);
/* Re-link the parts. */
for
(
int
k
=
0
;
k
<
nr_gparts
;
k
++
)
...
...
@@ -739,7 +739,7 @@ void space_do_parts_sort() {
* @param max highest index.
* @param verbose Are we talkative ?
*/
void
space_gparts_sort
(
struct
space
*
s
,
size_
t
*
ind
,
size_t
N
,
int
min
,
int
max
,
void
space_gparts_sort
(
struct
space
*
s
,
in
t
*
ind
,
size_t
N
,
int
min
,
int
max
,
int
verbose
)
{
const
ticks
tic
=
getticks
();
...
...
@@ -786,7 +786,7 @@ void space_gparts_sort(struct space *s, size_t *ind, size_t N, int min, int max,
void
space_do_gparts_sort
()
{
/* Pointers to the sorting data. */
size_
t
*
ind
=
space_sort_struct
.
ind
;
in
t
*
ind
=
space_sort_struct
.
ind
;
struct
gpart
*
gparts
=
space_sort_struct
.
gparts
;
/* Main loop. */
...
...
@@ -902,15 +902,6 @@ void space_do_gparts_sort() {
atomic_dec
(
&
space_sort_struct
.
waiting
);
}
/* main loop. */
/* Verify space_sort_struct. */
/* for ( i = 1 ; i < N ; i++ )
if ( ind[i-1] > ind[i] )
error( "Sorting failed (ind[%i]=%i,ind[%i]=%i)." , i-1 , ind[i-1] , i
, ind[i] ); */
/* Clean up. */
free
(
qstack
);
}
/**
...
...
src/space.h
View file @
7088644a
...
...
@@ -130,7 +130,7 @@ extern struct parallel_sort space_sort_struct;
/* function prototypes. */
void
space_parts_sort
(
struct
space
*
s
,
int
*
ind
,
size_t
N
,
int
min
,
int
max
,
int
verbose
);
void
space_gparts_sort
(
struct
space
*
s
,
size_
t
*
ind
,
size_t
N
,
int
min
,
int
max
,
void
space_gparts_sort
(
struct
space
*
s
,
in
t
*
ind
,
size_t
N
,
int
min
,
int
max
,
int
verbose
);
struct
cell
*
space_getcell
(
struct
space
*
s
);
int
space_getsid
(
struct
space
*
s
,
struct
cell
**
ci
,
struct
cell
**
cj
,
...
...
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