Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
margo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
sds
margo
Commits
53e828f9
Commit
53e828f9
authored
Jan 09, 2018
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
include/margo.h
include/margo.h
+18
-0
src/margo.c
src/margo.c
+31
-0
No files found.
include/margo.h
View file @
53e828f9
...
...
@@ -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 @
53e828f9
...
...
@@ -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
)
{
hg_bool_t
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