mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
added affinity option per node
This commit is contained in:
parent
3fe2008a94
commit
ace9c08812
3 changed files with 13 additions and 6 deletions
|
@ -55,11 +55,12 @@ int config_parse_global(config_setting_t *cfg, struct settings *set);
|
|||
* @param cfg A libconfig object pointing to the path
|
||||
* @param paths Add new paths to this linked list
|
||||
* @param nodes A linked list of all existing nodes
|
||||
* @param set The global configuration structure
|
||||
* @retval 0 Success. Everything went well.
|
||||
* @retval <0 Error. Something went wrong.
|
||||
*/
|
||||
int config_parse_path(config_setting_t *cfg,
|
||||
struct list *paths, struct list *nodes);
|
||||
struct list *paths, struct list *nodes, struct settings *set);
|
||||
|
||||
/** Parse an array or single node and checks if they exist in the "nodes" section.
|
||||
*
|
||||
|
@ -85,9 +86,10 @@ int config_parse_hooklist(config_setting_t *cfg, struct list *hooks);
|
|||
*
|
||||
* @param cfg A libconfig object pointing to the node.
|
||||
* @param nodes Add new nodes to this linked list.
|
||||
* @param set The global configuration structure
|
||||
* @retval 0 Success. Everything went well.
|
||||
* @retval <0 Error. Something went wrong.
|
||||
*/
|
||||
int config_parse_node(config_setting_t *cfg, struct list *nodes);
|
||||
int config_parse_node(config_setting_t *cfg, struct list *nodes, struct settings *set);
|
||||
|
||||
#endif /* _CFG_H_ */
|
||||
|
|
|
@ -136,6 +136,8 @@ struct node
|
|||
int refcnt;
|
||||
/** Number of messages to send / recv at once (scatter / gather) */
|
||||
int combine;
|
||||
/** CPU Affinity of this node */
|
||||
int affinity;
|
||||
/** A short identifier of the node, only used for configuration and logging */
|
||||
const char *name;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ int config_parse(const char *filename, config_t *cfg, struct settings *set,
|
|||
|
||||
for (int i = 0; i < config_setting_length(cfg_nodes); i++) {
|
||||
config_setting_t *cfg_node = config_setting_get_elem(cfg_nodes, i);
|
||||
config_parse_node(cfg_node, nodes);
|
||||
config_parse_node(cfg_node, nodes, set);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ int config_parse(const char *filename, config_t *cfg, struct settings *set,
|
|||
|
||||
for (int i = 0; i < config_setting_length(cfg_paths); i++) {
|
||||
config_setting_t *cfg_path = config_setting_get_elem(cfg_paths, i);
|
||||
config_parse_path(cfg_path, paths, nodes);
|
||||
config_parse_path(cfg_path, paths, nodes, set);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ int config_parse_global(config_setting_t *cfg, struct settings *set)
|
|||
}
|
||||
|
||||
int config_parse_path(config_setting_t *cfg,
|
||||
struct list *paths, struct list *nodes)
|
||||
struct list *paths, struct list *nodes, struct settings *set)
|
||||
{
|
||||
const char *in;
|
||||
int enabled;
|
||||
|
@ -244,7 +244,7 @@ int config_parse_hooklist(config_setting_t *cfg, struct list *hooks) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int config_parse_node(config_setting_t *cfg, struct list *nodes)
|
||||
int config_parse_node(config_setting_t *cfg, struct list *nodes, struct settings *set)
|
||||
{
|
||||
const char *type;
|
||||
int ret;
|
||||
|
@ -263,6 +263,9 @@ int config_parse_node(config_setting_t *cfg, struct list *nodes)
|
|||
if (!config_setting_lookup_int(cfg, "combine", &n->combine))
|
||||
n->combine = 1;
|
||||
|
||||
if (!config_setting_lookup_int(cfg, "affinity", &n->combine))
|
||||
n->affinity = set->affinity;
|
||||
|
||||
n->vt = node_lookup_vtable(type);
|
||||
if (!n->vt)
|
||||
cerror(cfg, "Invalid type for node '%s'", n->name);
|
||||
|
|
Loading…
Add table
Reference in a new issue