mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
Added support for node type dependend memory types
This commit is contained in:
parent
a50de4e8e7
commit
df5ec2bcdf
1 changed files with 12 additions and 2 deletions
14
lib/path.c
14
lib/path.c
|
@ -45,8 +45,9 @@ static void path_destination_enqueue(struct path *p, struct sample *smps[], unsi
|
|||
static int path_source_init(struct path_source *ps)
|
||||
{
|
||||
int ret;
|
||||
unsigned pool_cnt = (strcmp(node_type_name(ps->node->_vt), "infiniband") == 0 ? 8192 : (unsigned) MAX(DEFAULT_QUEUELEN, ps->node->in.vectorize));
|
||||
|
||||
ret = pool_init(&ps->pool, MAX(DEFAULT_QUEUELEN, ps->node->in.vectorize), SAMPLE_LEN(ps->node->samplelen), &memory_hugepage);
|
||||
ret = pool_init(&ps->pool, pool_cnt, SAMPLE_LEN(ps->node->samplelen), node_memory_type(ps->node, &memory_hugepage));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -394,9 +395,17 @@ int path_init2(struct path *p)
|
|||
#endif /* WITH_HOOKS */
|
||||
|
||||
/* Initialize destinations */
|
||||
struct memory_type *pool_mem_type = &memory_hugepage;
|
||||
unsigned pool_cnt = (unsigned) MAX(1, list_length(&p->destinations) * p->queuelen);
|
||||
|
||||
for (size_t i = 0; i < list_length(&p->destinations); i++) {
|
||||
struct path_destination *pd = (struct path_destination *) list_at(&p->destinations, i);
|
||||
|
||||
if (strcmp(node_type_name(pd->node->_vt), "infiniband") == 0) {
|
||||
pool_cnt = 8192;
|
||||
pool_mem_type = node_memory_type(pd->node, &memory_hugepage);
|
||||
}
|
||||
|
||||
ret = path_destination_init(pd, p->queuelen);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
@ -416,6 +425,7 @@ int path_init2(struct path *p)
|
|||
|
||||
/* Calc sample length of path and initialize bitset */
|
||||
p->samplelen = 0;
|
||||
|
||||
for (size_t i = 0; i < list_length(&p->sources); i++) {
|
||||
struct path_source *ps = (struct path_source *) list_at(&p->sources, i);
|
||||
|
||||
|
@ -436,7 +446,7 @@ int path_init2(struct path *p)
|
|||
if (!p->samplelen)
|
||||
p->samplelen = DEFAULT_SAMPLELEN;
|
||||
|
||||
ret = pool_init(&p->pool, MAX(1, list_length(&p->destinations)) * p->queuelen, SAMPLE_LEN(p->samplelen), &memory_hugepage);
|
||||
ret = pool_init(&p->pool, pool_cnt, SAMPLE_LEN(p->samplelen), pool_mem_type);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue