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
370769d2
Commit
370769d2
authored
Aug 24, 2017
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add margo_hg_info_get_instance call
parent
740a04f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
include/margo.h
include/margo.h
+9
-0
src/margo.c
src/margo.c
+5
-0
tests/my-rpc.c
tests/my-rpc.c
+3
-6
No files found.
include/margo.h
View file @
370769d2
...
...
@@ -638,6 +638,15 @@ hg_class_t* margo_get_class(margo_instance_id mid);
*/
margo_instance_id
margo_hg_handle_get_instance
(
hg_handle_t
h
);
/**
* Get the margo_instance_id from a received RPC handle.
*
* \param [in] info RPC info structure pointer
*
* \return Margo instance
*/
margo_instance_id
margo_hg_info_get_instance
(
const
struct
hg_info
*
info
);
/**
* Maps an RPC id and mplex id to the pool that it should execute on
* @param [in] mid Margo instance
...
...
src/margo.c
View file @
370769d2
...
...
@@ -928,6 +928,11 @@ margo_instance_id margo_hg_handle_get_instance(hg_handle_t h)
{
const
struct
hg_info
*
info
=
HG_Get_info
(
h
);
if
(
!
info
)
return
MARGO_INSTANCE_NULL
;
return
margo_hg_info_get_instance
(
info
);
}
margo_instance_id
margo_hg_info_get_instance
(
const
struct
hg_info
*
info
)
{
struct
margo_rpc_data
*
data
=
(
struct
margo_rpc_data
*
)
HG_Registered_data
(
info
->
hg_class
,
info
->
id
);
if
(
!
data
)
return
MARGO_INSTANCE_NULL
;
...
...
tests/my-rpc.c
View file @
370769d2
...
...
@@ -46,10 +46,9 @@ static void my_rpc_ult(hg_handle_t handle)
assert
(
buffer
);
/* get handle info and margo instance */
/* TODO: how can we avoid calling get_info twice? */
hgi
=
margo_get_info
(
handle
);
assert
(
hgi
);
mid
=
margo_hg_
handle_get_instance
(
handle
);
mid
=
margo_hg_
info_get_instance
(
hgi
);
assert
(
mid
!=
MARGO_INSTANCE_NULL
);
/* register local target buffer for bulk access */
...
...
@@ -97,10 +96,9 @@ static void my_rpc_shutdown_ult(hg_handle_t handle)
printf
(
"Got RPC request to shutdown
\n
"
);
/* get handle info and margo instance */
/* TODO: how can we avoid calling get_info twice? */
hgi
=
margo_get_info
(
handle
);
assert
(
hgi
);
mid
=
margo_hg_
handle_get_instance
(
handle
);
mid
=
margo_hg_
info_get_instance
(
hgi
);
assert
(
mid
!=
MARGO_INSTANCE_NULL
);
hret
=
margo_respond
(
mid
,
handle
,
NULL
);
...
...
@@ -136,10 +134,9 @@ static void my_rpc_hang_ult(hg_handle_t handle)
out
.
ret
=
0
;
/* get handle info and margo instance */
/* TODO: how can we avoid calling get_info twice? */
hgi
=
margo_get_info
(
handle
);
assert
(
hgi
);
mid
=
margo_hg_
handle_get_instance
(
handle
);
mid
=
margo_hg_
info_get_instance
(
hgi
);
assert
(
mid
!=
MARGO_INSTANCE_NULL
);
/* sleep for an hour (to allow client to test timeout capability) */
...
...
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