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
47ed85d1
Commit
47ed85d1
authored
Dec 12, 2016
by
Pedro Gonnet
Browse files
properly destroy glocks as well.
parent
9dcdeb4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
47ed85d1
...
...
@@ -330,8 +330,8 @@ void engine_redistribute(struct engine *e) {
r
++
;
}
}
message
(
"%ld of %ld (%.2f%%) of particles moved"
,
total
-
unmoved
,
total
,
100
.
0
*
(
double
)(
total
-
unmoved
)
/
(
double
)
total
);
message
(
"%ld of %ld (%.2f%%) of particles moved"
,
total
-
unmoved
,
total
,
100
.
0
*
(
double
)(
total
-
unmoved
)
/
(
double
)
total
);
}
}
...
...
src/space.c
View file @
47ed85d1
...
...
@@ -434,8 +434,8 @@ void space_regrid(struct space *s, int verbose) {
// message( "rebuilding upper-level cells took %.3f %s." ,
// clocks_from_ticks(double)(getticks() - tic), clocks_getunit());
}
/* re-build upper-level cells? */
else
{
/* Otherwise, just clean up the cells. */
}
/* re-build upper-level cells? */
else
{
/* Otherwise, just clean up the cells. */
/* Free the old cells, if they were allocated. */
threadpool_map
(
&
s
->
e
->
threadpool
,
space_rebuild_recycle_mapper
,
...
...
@@ -1630,7 +1630,8 @@ void space_split_mapper(void *map_data, int num_cells, void *extra_data) {
void
space_recycle
(
struct
space
*
s
,
struct
cell
*
c
)
{
/* Clear the cell. */
if
(
lock_destroy
(
&
c
->
lock
)
!=
0
)
error
(
"Failed to destroy spinlock."
);
if
(
lock_destroy
(
&
c
->
lock
)
!=
0
||
lock_destroy
(
&
c
->
glock
)
!=
0
)
error
(
"Failed to destroy spinlock."
);
/* Clear this cell's sort arrays. */
if
(
c
->
sort
!=
NULL
)
free
(
c
->
sort
);
...
...
@@ -1665,7 +1666,8 @@ void space_recycle_list(struct space *s, struct cell *list_begin,
/* Clean up the list of cells. */
for
(
struct
cell
*
c
=
list_begin
;
c
!=
NULL
;
c
=
c
->
next
)
{
/* Clear the cell. */
if
(
lock_destroy
(
&
c
->
lock
)
!=
0
)
error
(
"Failed to destroy spinlock."
);
if
(
lock_destroy
(
&
c
->
lock
)
!=
0
||
lock_destroy
(
&
c
->
glock
)
!=
0
)
error
(
"Failed to destroy spinlock."
);
/* Clear this cell's sort arrays. */
if
(
c
->
sort
!=
NULL
)
free
(
c
->
sort
);
...
...
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