Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VILLASnode
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACS
Public
VILLASframework
VILLASnode
Commits
759fb007
Commit
759fb007
authored
7 years ago
by
Steffen Vogel
Browse files
Options
Downloads
Patches
Plain Diff
node: add new option to skip loading of default hooks
parent
05d37fab
Branches
Branches containing commit
Tags
v0.6.0
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/villas/node.h
+1
-0
1 addition, 0 deletions
include/villas/node.h
lib/node.c
+17
-13
17 additions, 13 deletions
lib/node.c
with
18 additions
and
13 deletions
include/villas/node.h
+
1
−
0
View file @
759fb007
...
...
@@ -47,6 +47,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
no_builtin
;
int
vectorize
;
/**< Number of messages to send / recv at once (scatter / gather) */
int
affinity
;
/**< CPU Affinity of this node */
int
samplelen
;
/**< The maximum number of values this node can receive. */
...
...
This diff is collapsed.
Click to expand it.
lib/node.c
+
17
−
13
View file @
759fb007
...
...
@@ -50,6 +50,7 @@ int node_init(struct node *n, struct node_type *vt)
/* Default values */
n
->
vectorize
=
1
;
n
->
no_builtin
=
0
;
n
->
samplelen
=
DEFAULT_SAMPLELEN
;
list_push
(
&
vt
->
instances
,
n
);
...
...
@@ -57,22 +58,24 @@ int node_init(struct node *n, struct node_type *vt)
list_init
(
&
n
->
hooks
);
/* Add internal hooks if they are not already in the list */
for
(
size_t
i
=
0
;
i
<
list_length
(
&
plugins
);
i
++
)
{
struct
plugin
*
q
=
(
struct
plugin
*
)
list_at
(
&
plugins
,
i
);
if
(
!
n
->
no_builtin
)
{
for
(
size_t
i
=
0
;
i
<
list_length
(
&
plugins
);
i
++
)
{
struct
plugin
*
q
=
(
struct
plugin
*
)
list_at
(
&
plugins
,
i
);
if
(
q
->
type
!=
PLUGIN_TYPE_HOOK
)
continue
;
if
(
q
->
type
!=
PLUGIN_TYPE_HOOK
)
continue
;
struct
hook_type
*
vt
=
&
q
->
hook
;
struct
hook_type
*
vt
=
&
q
->
hook
;
if
((
vt
->
flags
&
HOOK_NODE
)
&&
(
vt
->
flags
&
HOOK_BUILTIN
))
{
struct
hook
*
h
=
(
struct
hook
*
)
alloc
(
sizeof
(
struct
hook
));
if
((
vt
->
flags
&
HOOK_NODE
)
&&
(
vt
->
flags
&
HOOK_BUILTIN
))
{
struct
hook
*
h
=
(
struct
hook
*
)
alloc
(
sizeof
(
struct
hook
));
ret
=
hook_init
(
h
,
vt
,
NULL
,
n
);
if
(
ret
)
return
ret
;
ret
=
hook_init
(
h
,
vt
,
NULL
,
n
);
if
(
ret
)
return
ret
;
list_push
(
&
n
->
hooks
,
h
);
list_push
(
&
n
->
hooks
,
h
);
}
}
}
...
...
@@ -101,11 +104,12 @@ int node_parse(struct node *n, json_t *cfg, const char *name)
n
->
name
=
strdup
(
name
);
ret
=
json_unpack_ex
(
cfg
,
&
err
,
0
,
"{ s: s, s?: i, s?: i, s?: o }"
,
ret
=
json_unpack_ex
(
cfg
,
&
err
,
0
,
"{ s: s, s?: i, s?: i, s?: o
, s?: b
}"
,
"type"
,
&
type
,
"vectorize"
,
&
n
->
vectorize
,
"samplelen"
,
&
n
->
samplelen
,
"hooks"
,
&
json_hooks
"hooks"
,
&
json_hooks
,
"no_builtin"
,
&
n
->
no_builtin
);
if
(
ret
)
jerror
(
&
err
,
"Failed to parse node '%s'"
,
node_name
(
n
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment