mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
added new field to node type descriptor which specifies maximum vector length
This commit is contained in:
parent
e59c2d7894
commit
458976ce63
8 changed files with 17 additions and 1 deletions
|
@ -43,6 +43,7 @@ struct config_setting_t *cfg;
|
|||
struct node_type {
|
||||
const char *name; /**< The unique name of this node. This must be allways the first member! */
|
||||
const char *description; /**< A short description of this node type. Will be shown in help text. */
|
||||
int vectorize; /**< Maximal vector length supported by this node type. Zero is unlimited. */
|
||||
|
||||
struct list instances; /**< A list of all existing nodes of this type. */
|
||||
size_t size; /**< Size of private data bock. @see node::_vd */
|
||||
|
|
11
lib/cfg.c
11
lib/cfg.c
|
@ -223,7 +223,16 @@ 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, "vectorize", &n->vectorize))
|
||||
if (config_setting_lookup_int(cfg, "vectorize", &n->vectorize)) {
|
||||
config_setting_t *cfg_vectorize = config_lookup_from(cfg, "vectorize");
|
||||
|
||||
if (n->vectorize <= 0)
|
||||
cerror(cfg_vectorize, "Invalid value for `vectorize`. Must be natural number!");
|
||||
if (vt->vectorize && vt->vectorize < n->vectorize)
|
||||
cerror(cfg_vectorize, "Invalid value for `vectorize`. Node type %s requires a number smaller than %d!",
|
||||
node_name_type(n), vt->vectorize);
|
||||
}
|
||||
else
|
||||
n->vectorize = 1;
|
||||
|
||||
if (!config_setting_lookup_int(cfg, "affinity", &n->affinity))
|
||||
|
|
|
@ -366,6 +366,7 @@ int file_write(struct node *n, struct pool *pool, int cnt)
|
|||
static struct node_type vt = {
|
||||
.name = "file",
|
||||
.description = "support for file log / replay node type",
|
||||
.vectorize = 0, /* unlimited */
|
||||
.size = sizeof(struct file),
|
||||
.reverse = file_reverse,
|
||||
.parse = file_parse,
|
||||
|
|
|
@ -268,6 +268,7 @@ int gtfpga_write(struct node *n, struct pool *pool, int cnt)
|
|||
static struct node_type vt = {
|
||||
.name = "gtfpga",
|
||||
.description = "GTFPGA PCIe card (libpci)",
|
||||
.vectorize = 1,
|
||||
.parse = gtfpga_parse,
|
||||
.print = gtfpga_print,
|
||||
.open = gtfpga_open,
|
||||
|
|
|
@ -598,6 +598,7 @@ int ngsi_write(struct node *n, struct pool *pool, int cnt)
|
|||
static struct node_type vt = {
|
||||
.name = "ngsi",
|
||||
.description = "OMA Next Generation Services Interface 10 (libcurl, libjansson, libuuid)",
|
||||
.vectorize = 0, /* unlimited */
|
||||
.size = sizeof(struct ngsi),
|
||||
.parse = ngsi_parse,
|
||||
.print = ngsi_print,
|
||||
|
|
|
@ -281,6 +281,7 @@ int opal_write(struct node *n, struct pool *pool, int cnt)
|
|||
static struct node_type vt = {
|
||||
.name = "opal",
|
||||
.description = "run as OPAL Asynchronous Process (libOpalAsyncApi)",
|
||||
.vectoroize = 1,
|
||||
.size = sizeof(struct opal),
|
||||
.parse = opal_parse,
|
||||
.print = opal_print,
|
||||
|
|
|
@ -484,6 +484,7 @@ int socket_parse_addr(const char *addr, struct sockaddr *saddr, enum socket_laye
|
|||
static struct node_type vt = {
|
||||
.name = "socket",
|
||||
.description = "Network socket (libnl3)",
|
||||
.vectorize = 0, /* unlimited */
|
||||
.size = sizeof(struct socket),
|
||||
.destroy = socket_destroy,
|
||||
.reverse = socket_reverse,
|
||||
|
|
|
@ -413,6 +413,7 @@ int websocket_write(struct node *n, struct msg *pool, int poolsize, int first, i
|
|||
static struct node_type vt = {
|
||||
.name = "websocket",
|
||||
.description = "Send and receive samples of a WebSocket connection (libwebsockets)",
|
||||
.vectoroize = 0, /* unlimited */
|
||||
.size = sizeof(struct websocket),
|
||||
.open = websocket_open,
|
||||
.close = websocket_close,
|
||||
|
|
Loading…
Add table
Reference in a new issue