Skip to content
Snippets Groups Projects
Commit 8b2993ea authored by James Willis's avatar James Willis
Browse files

Allocate particle cache in engine_init().

parent fd702ff1
No related branches found
No related tags found
1 merge request!287Particle caching
...@@ -84,6 +84,8 @@ const char *engine_policy_names[16] = {"none", ...@@ -84,6 +84,8 @@ const char *engine_policy_names[16] = {"none",
"drift_all", "drift_all",
"cooling", "cooling",
"sourceterms"}; "sourceterms"};
/* Particle cache size. */
const int cache_size = 512;
/** The rank of the engine as a global variable (for messages). */ /** The rank of the engine as a global variable (for messages). */
int engine_rank; int engine_rank;
...@@ -3357,6 +3359,10 @@ void engine_init(struct engine *e, struct space *s, ...@@ -3357,6 +3359,10 @@ void engine_init(struct engine *e, struct space *s,
e->runners[k].cpuid = k; e->runners[k].cpuid = k;
e->runners[k].qid = k * nr_queues / e->nr_threads; e->runners[k].qid = k * nr_queues / e->nr_threads;
} }
/* Allocate particle cache. */
cache_init(&e->runners[k].par_cache,cache_size);
if (verbose) { if (verbose) {
if (with_aff) if (with_aff)
message("runner %i on cpuid=%i with qid=%i.", e->runners[k].id, message("runner %i on cpuid=%i with qid=%i.", e->runners[k].id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment