Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
margo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
12
Issues
12
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
sds
margo
Commits
d7ebf492
Commit
d7ebf492
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
margo.h
include/margo.h
+18
-0
margo.c
src/margo.c
+31
-0
No files found.
include/margo.h
View file @
d7ebf492
...
@@ -174,6 +174,24 @@ hg_return_t margo_registered_name(
...
@@ -174,6 +174,24 @@ hg_return_t margo_registered_name(
hg_id_t
*
id
,
hg_id_t
*
id
,
hg_bool_t
*
flag
);
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.
* Register and associate user data to registered function.
* When HG_Finalize() is called free_callback (if defined) is called
* 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,
...
@@ -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
));
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
(
hg_return_t
margo_register_data
(
margo_instance_id
mid
,
margo_instance_id
mid
,
hg_id_t
id
,
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