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
4aeeb629
Commit
4aeeb629
authored
Mar 02, 2017
by
James Willis
Browse files
Initialise each runner's ci and cj cache.
parent
159ba99c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
4aeeb629
...
...
@@ -3897,9 +3897,11 @@ void engine_init(struct engine *e, struct space *s,
e
->
runners
[
k
].
qid
=
k
*
nr_queues
/
e
->
nr_threads
;
}
/* Allocate particle cache. */
e
->
runners
[
k
].
par_cache
.
count
=
0
;
cache_init
(
&
e
->
runners
[
k
].
par_cache
,
CACHE_SIZE
);
/* Allocate particle caches. */
e
->
runners
[
k
].
ci_cache
.
count
=
0
;
e
->
runners
[
k
].
cj_cache
.
count
=
0
;
cache_init
(
&
e
->
runners
[
k
].
ci_cache
,
CACHE_SIZE
);
cache_init
(
&
e
->
runners
[
k
].
cj_cache
,
CACHE_SIZE
);
if
(
verbose
)
{
if
(
with_aff
)
...
...
@@ -3986,7 +3988,8 @@ void engine_compute_next_snapshot_time(struct engine *e) {
*/
void
engine_clean
(
struct
engine
*
e
)
{
for
(
int
i
=
0
;
i
<
e
->
nr_threads
;
++
i
)
cache_clean
(
&
e
->
runners
[
i
].
par_cache
);
for
(
int
i
=
0
;
i
<
e
->
nr_threads
;
++
i
)
cache_clean
(
&
e
->
runners
[
i
].
ci_cache
);
for
(
int
i
=
0
;
i
<
e
->
nr_threads
;
++
i
)
cache_clean
(
&
e
->
runners
[
i
].
cj_cache
);
free
(
e
->
runners
);
free
(
e
->
snapshotUnits
);
free
(
e
->
links
);
...
...
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