1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Changed name of configuration setting combine to vectorize

This commit is contained in:
Steffen Vogel 2015-12-19 16:48:20 +01:00
parent c01870aef4
commit 5fc9c7bd15
8 changed files with 18 additions and 18 deletions

View file

@ -77,7 +77,7 @@ The path section consists of a **list** of paths:
reverse = false,
poolsize = 32,
msgsize = 16,
combine = 4,
vectorize = 4,
hook = [ "print", "ts" ]
}
]
@ -102,7 +102,7 @@ By default, the path is unidirectional. Meaning, that it only forwards samples f
Sometimes a bidirectional path is needed.
This can be accomplished by setting `reverse` to `true`.
##### `combine` *(integer)*
##### `vectorize` *(integer)*
This setting allows to send multiple samples in a single message to the destination nodes. Currently this is only supported by the `file` and `socket` node-types.
@ -115,7 +115,7 @@ The value of this setting determines how many samples will be combined into one
A non-zero value for this setting will change this path to an asynchronous mode.
In this mode S2SS will send with a fixed rate to all destination nodes.
It will always send the latest value it received, possible skipping values which have been received in between.
If `combine` is larger than 1, it will send the last `combine` samples at once.
If `vectorize` is larger than 1, it will send the last `vectorize` samples at once.
**Important:** Please note that there is no correlation between the time of arrival and time of departure in this mode. It might increase the latency of this path by up to `1 / rate` seconds!
@ -123,7 +123,7 @@ If `combine` is larger than 1, it will send the last `combine` samples at once.
Every path manages a circular buffer to keep a history of past samples. This setting specifies the size of this circular buffer.
**Important:** There are some hook functions (or the `combine` setting) which require a minimum poolsize (for example the finite-impulse-response `fir` hook).
**Important:** There are some hook functions (or the `vectorize` setting) which require a minimum poolsize (for example the finite-impulse-response `fir` hook).
##### `hook` *(list of strings)*

View file

@ -8,7 +8,7 @@ It's using `libcurl` and `libjansson` to communicate with the context broker ove
## Configuration
You can use the `combine` setting to send multiple samples in a vector.
You can use the `vectorize` setting to send multiple samples in a vector.
Every `ngsi` node supports the following special settings:

View file

@ -43,7 +43,7 @@ Every `socket` node supports the following special settings:
local = "127.0.0.1:12001", # This node only received messages on this IP:Port pair
remote = "127.0.0.1:12000" # This node sents outgoing messages to this IP:Port pair
combine = 30 # Receive and sent 30 samples per message (multiplexing).
vectorize = 30 # Receive and sent 30 samples per message (multiplexing).
}
}

View file

@ -165,7 +165,7 @@ struct node
char *_name; /**< Singleton: A string used to print to screen. */
char *_name_long; /**< Singleton: A string used to print to screen. */
int combine; /**< Number of messages to send / recv at once (scatter / gather) */
int vectorize; /**< Number of messages to send / recv at once (scatter / gather) */
int affinity; /**< CPU Affinity of this node */
enum node_state {

View file

@ -225,8 +225,8 @@ int config_parse_node(config_setting_t *cfg, struct list *nodes, struct settings
if (ret)
cerror(cfg, "Failed to parse node '%s'", node_name(n));
if (!config_setting_lookup_int(cfg, "combine", &n->combine))
n->combine = 1;
if (!config_setting_lookup_int(cfg, "vectorize", &n->vectorize))
n->vectorize = 1;
if (!config_setting_lookup_int(cfg, "affinity", &n->affinity))
n->affinity = set->affinity;

View file

@ -22,8 +22,8 @@ static void path_write(struct path *p)
n, /* Destination node */
p->pool, /* Pool of received messages */
p->poolsize, /* Size of the pool */
p->received - n->combine,/* Index of the first message which should be sent */
n->combine /* Number of messages which should be sent */
p->received - n->vectorize,/* Index of the first message which should be sent */
n->vectorize /* Number of messages which should be sent */
);
debug(15, "Sent %u messages to node %s", sent, node_name(n));
@ -87,7 +87,7 @@ static void * path_run(void *arg)
/* Main thread loop */
for (;;) {
/* Receive message */
int recv = node_read(p->in, p->pool, p->poolsize, p->received, p->in->combine);
int recv = node_read(p->in, p->pool, p->poolsize, p->received, p->in->vectorize);
if (recv < 0)
error("Failed to receive message from node %s", node_name(p->in));
else if (recv == 0)

View file

@ -114,7 +114,7 @@ static int protocol_cb_http(struct lws_context *context, struct lws *wsi, enum l
"name", node_name_short(n),
"connections", list_length(&w->connections),
"state", n->state,
"combine", n->combine,
"vectorize", n->vectorize,
"affinity", n->affinity
);

View file

@ -70,7 +70,7 @@ static void usage(char *name)
void * send_loop(void *ctx)
{
for (;;) {
for (int i = 0; i < node->combine; i++) {
for (int i = 0; i < node->vectorize; i++) {
struct msg *m = &send_pool[i];
int reason;
@ -85,7 +85,7 @@ retry: reason = msg_fscan(stdin, m, NULL, NULL);
}
}
node_write(node, send_pool, node->combine, 0, node->combine);
node_write(node, send_pool, node->vectorize, 0, node->vectorize);
}
return NULL;
@ -99,7 +99,7 @@ void * recv_loop(void *ctx)
for (;;) {
struct timespec ts = time_now();
int recv = node_read(node, recv_pool, node->combine, 0, node->combine);
int recv = node_read(node, recv_pool, node->vectorize, 0, node->vectorize);
for (int i = 0; i < recv; i++) {
struct msg *m = &recv_pool[i];
@ -160,8 +160,8 @@ int main(int argc, char *argv[])
node_init(node->_vt, argc-optind, argv+optind, config_root_setting(&config));
recv_pool = alloc(sizeof(struct msg) * node->combine);
send_pool = alloc(sizeof(struct msg) * node->combine);
recv_pool = alloc(sizeof(struct msg) * node->vectorize);
send_pool = alloc(sizeof(struct msg) * node->vectorize);
if (reverse)
node_reverse(node);