Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
margo
Commits
d7ebf492
Commit
d7ebf492
authored
Jan 09, 2018
by
Matthieu Dorier
Browse files
added a function to check if the RPC is registered with a given multiplex id
parent
f1720209
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/margo.h
View file @
d7ebf492
...
...
@@ -174,6 +174,24 @@ hg_return_t margo_registered_name(
hg_id_t
*
id
,
hg_bool_t
*
flag
);
/**
* Indicate whether the given RPC name has been registered with the given multiplex id.
*
* @param [in] mid Margo instance
* @param [in] func_name function name
* @param [in] mplex_id multiplex id
* @param [out] id registered RPC ID
* @param [out] flag pointer to boolean
*
* @return HG_SUCCESS or corresponding HG error code
*/
hg_return_t
margo_registered_name_mplex
(
margo_instance_id
mid
,
const
char
*
func_name
,
uint32_t
mplex_id
,
hg_id_t
*
id
,
hg_bool_t
*
flag
);
/**
* Register and associate user data to registered function.
* When HG_Finalize() is called free_callback (if defined) is called
...
...
src/margo.c
View file @
d7ebf492
...
...
@@ -507,6 +507,37 @@ hg_return_t margo_registered_name(margo_instance_id mid, const char *func_name,
return
(
HG_Registered_name
(
mid
->
hg_class
,
func_name
,
id
,
flag
));
}
hg_return_t
margo_registered_name_mplex
(
margo_instance_id
mid
,
const
char
*
func_name
,
uint32_t
mplex_id
,
hg_id_t
*
id
,
hg_bool_t
*
flag
)
{
int
b
;
hg_return_t
ret
=
margo_registered_name
(
mid
,
func_name
,
id
,
&
b
);
if
(
ret
!=
HG_SUCCESS
)
return
ret
;
if
((
!
b
)
||
(
!
mplex_id
))
{
*
flag
=
b
;
return
ret
;
}
struct
mplex_key
key
;
struct
mplex_element
*
element
;
memset
(
&
key
,
0
,
sizeof
(
key
));
key
.
id
=
*
id
;
key
.
mplex_id
=
mplex_id
;
HASH_FIND
(
hh
,
mid
->
mplex_table
,
&
key
,
sizeof
(
key
),
element
);
if
(
!
element
)
{
*
flag
=
0
;
return
HG_SUCCESS
;
}
assert
(
element
->
key
.
id
==
id
&&
element
->
key
.
mplex_id
==
mplex_id
);
*
flag
=
1
;
return
HG_SUCCESS
;
}
hg_return_t
margo_register_data
(
margo_instance_id
mid
,
hg_id_t
id
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment