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
da254a51
Commit
da254a51
authored
May 05, 2017
by
James Willis
Browse files
Disable particle cache when vectorisation is enabled.
parent
6079a299
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cache.h
View file @
da254a51
...
...
@@ -34,6 +34,7 @@
#define C2_CACHE_SIZE (NUM_VEC_PROC * VEC_SIZE * 6) + (NUM_VEC_PROC * VEC_SIZE)
#define C2_CACHE_ALIGN sizeof(float) * VEC_SIZE
#ifdef WITH_VECTORIZATION
/* Cache struct to hold a local copy of a cells' particle
* properties required for density/force calculations.*/
struct
cache
{
...
...
@@ -433,4 +434,6 @@ static INLINE void cache_clean(struct cache *c) {
}
}
#endif
/* WITH_VECTORIZATION */
#endif
/* SWIFT_CACHE_H */
src/engine.c
View file @
da254a51
...
...
@@ -4264,11 +4264,13 @@ void engine_init(struct engine *e, struct space *s,
e
->
runners
[
k
].
qid
=
k
*
nr_queues
/
e
->
nr_threads
;
}
#ifdef WITH_VECTORIZATION
/* 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
);
#endif
if
(
verbose
)
{
if
(
with_aff
)
...
...
@@ -4355,8 +4357,10 @@ void engine_compute_next_snapshot_time(struct engine *e) {
*/
void
engine_clean
(
struct
engine
*
e
)
{
#ifdef WITH_VECTORIZATION
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
);
#endif
free
(
e
->
runners
);
free
(
e
->
snapshotUnits
);
free
(
e
->
links
);
...
...
src/runner.h
View file @
da254a51
...
...
@@ -49,11 +49,13 @@ struct runner {
/*! The engine owing this runner. */
struct
engine
*
e
;
#ifdef WITH_VECTORIZATION
/*! The particle cache of cell ci. */
struct
cache
ci_cache
;
/*! The particle cache of cell cj. */
struct
cache
cj_cache
;
#endif
};
/* Function prototypes. */
...
...
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