mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
refactoring: DEFAULT_VALUES => DEFAULT_SAMPLELEN
This commit is contained in:
parent
374f5bb557
commit
61d42c342d
7 changed files with 12 additions and 13 deletions
4
config.h
4
config.h
|
@ -11,7 +11,7 @@
|
|||
#pragma once
|
||||
|
||||
/** Default number of values in a sample */
|
||||
#define DEFAULT_VALUES 64
|
||||
#define DEFAULT_SAMPLELEN 64
|
||||
#define DEFAULT_QUEUELEN 1024
|
||||
|
||||
/** Number of hugepages which are requested from the the kernel.
|
||||
|
@ -30,7 +30,7 @@
|
|||
|
||||
#define USER_AGENT "VILLASnode (" BUILDID ")"
|
||||
|
||||
/*ID Required kernel version */
|
||||
/* Required kernel version */
|
||||
#define KERNEL_VERSION_MAJ 3
|
||||
#define KERNEL_VERSION_MIN 6
|
||||
|
||||
|
|
|
@ -143,10 +143,9 @@ paths = (
|
|||
|
||||
rate = 100, # Send message over this path with a fixed (constant) rate (default: 0).
|
||||
# Setting this value to 0 will disable this feature.
|
||||
|
||||
poolsize = 30 # The amount of samples which are kept in a circular buffer.
|
||||
# This number must be larger than the 'vectorize' settings of all
|
||||
# associated input and output nodes!
|
||||
|
||||
queuelen = 128,
|
||||
samplelen = 64
|
||||
},
|
||||
{
|
||||
enabled = false,
|
||||
|
|
|
@ -268,7 +268,7 @@ int websocket_start(struct node *n)
|
|||
int ret;
|
||||
struct websocket *w = n->_vd;
|
||||
|
||||
size_t blocklen = LWS_PRE + WEBMSG_LEN(DEFAULT_VALUES);
|
||||
size_t blocklen = LWS_PRE + WEBMSG_LEN(DEFAULT_SAMPLELEN);
|
||||
|
||||
ret = pool_init(&w->pool, 64 * DEFAULT_QUEUELEN, blocklen, &memtype_hugepage);
|
||||
if (ret)
|
||||
|
|
|
@ -167,7 +167,7 @@ int path_init(struct path *p, struct super_node *sn)
|
|||
p->reverse = 0;
|
||||
p->enabled = 1;
|
||||
|
||||
p->samplelen = DEFAULT_VALUES;
|
||||
p->samplelen = DEFAULT_SAMPLELEN;
|
||||
p->queuelen = DEFAULT_QUEUELEN;
|
||||
|
||||
p->super_node = sn;
|
||||
|
@ -221,7 +221,7 @@ int path_parse(struct path *p, config_setting_t *cfg, struct list *nodes)
|
|||
|
||||
config_setting_lookup_bool(cfg, "reverse", &p->reverse);
|
||||
config_setting_lookup_bool(cfg, "enabled", &p->enabled);
|
||||
config_setting_lookup_int(cfg, "values", &p->samplelen);
|
||||
config_setting_lookup_int(cfg, "samplelen", &p->samplelen);
|
||||
config_setting_lookup_int(cfg, "queuelen", &p->queuelen);
|
||||
|
||||
if (!IS_POW2(p->queuelen)) {
|
||||
|
|
|
@ -125,7 +125,7 @@ int main(int argc, char *argv[])
|
|||
if (cnt < 1)
|
||||
error("Vectorize option must be greater than 0");
|
||||
|
||||
ret = pool_init(&q, 10 * cnt, SAMPLE_LEN(DEFAULT_VALUES), &memtype_hugepage);
|
||||
ret = pool_init(&q, 10 * cnt, SAMPLE_LEN(DEFAULT_SAMPLELEN), &memtype_hugepage);
|
||||
if (ret)
|
||||
error("Failed to initilize memory pool");
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ static void * send_loop(void *ctx)
|
|||
sendd.started = true;
|
||||
|
||||
/* Initialize memory */
|
||||
ret = pool_init(&sendd.pool, LOG2_CEIL(node->vectorize), SAMPLE_LEN(DEFAULT_VALUES), &memtype_hugepage);
|
||||
ret = pool_init(&sendd.pool, LOG2_CEIL(node->vectorize), SAMPLE_LEN(DEFAULT_SAMPLELEN), &memtype_hugepage);
|
||||
if (ret < 0)
|
||||
error("Failed to allocate memory for receive pool.");
|
||||
|
||||
|
@ -142,7 +142,7 @@ static void * recv_loop(void *ctx)
|
|||
recvv.started = true;
|
||||
|
||||
/* Initialize memory */
|
||||
ret = pool_init(&recvv.pool, LOG2_CEIL(node->vectorize), SAMPLE_LEN(DEFAULT_VALUES), &memtype_hugepage);
|
||||
ret = pool_init(&recvv.pool, LOG2_CEIL(node->vectorize), SAMPLE_LEN(DEFAULT_SAMPLELEN), &memtype_hugepage);
|
||||
if (ret < 0)
|
||||
error("Failed to allocate memory for receive pool.");
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ check: if (optarg == endptr)
|
|||
log_init(&log, V, LOG_ALL);
|
||||
log_start(&log);
|
||||
|
||||
pool_init(&pool, 1024, SAMPLE_LEN(DEFAULT_VALUES), &memtype_heap);
|
||||
pool_init(&pool, 1024, SAMPLE_LEN(DEFAULT_SAMPLELEN), &memtype_heap);
|
||||
sample_alloc(&pool, samples, 2);
|
||||
|
||||
f1.sample = samples[0];
|
||||
|
|
Loading…
Add table
Reference in a new issue