Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
margo
Commits
b8e72979
Commit
b8e72979
authored
Mar 21, 2018
by
Philip Carns
Browse files
tweak api and update margo-example-*
parent
680a0d91
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/margo.h
View file @
b8e72979
...
...
@@ -475,11 +475,14 @@ hg_return_t margo_destroy(
* @param [in] in_struct input argument struct for RPC
* @returns 0 on success, hg_return_t values on error
*/
hg_return_t
margo_forward
(
hg_return_t
margo_forward
_provider_id
(
uint16_t
provider_id
,
hg_handle_t
handle
,
void
*
in_struct
);
#define margo_forward(__handle, __in_struct)\
margo_forward_provider_id(MARGO_DEFAULT_PROVIDER_ID, __handle, __in_struct)
/**
* Forward (without blocking) an RPC request to a remote host
* @param [in] provider ID (may be MARGO_DEFAULT_PROVIDER_ID)
...
...
@@ -488,12 +491,15 @@ hg_return_t margo_forward(
* @param [out] req request to wait on using margo_wait
* @returns 0 on success, hg_return_t values on error
*/
hg_return_t
margo_iforward
(
hg_return_t
margo_iforward
_provider_id
(
uint16_t
provider_id
,
hg_handle_t
handle
,
void
*
in_struct
,
margo_request
*
req
);
#define margo_iforward(__handle, __in_struct, __req)\
margo_forward_provider_id(MARGO_DEFAULT_PROVIDER_ID, __handle, __in_struct, __req)
/**
* Wait for an operation initiated by a non-blocking
* margo function (margo_iforward, margo_irespond, etc.)
...
...
@@ -746,6 +752,13 @@ void margo_thread_sleep(
*/
int
margo_get_handler_pool
(
margo_instance_id
mid
,
ABT_pool
*
pool
);
/**
* Retrieve the rpc handler abt pool that is associated with this handle
* @param [in] h handle
* @return pool
*/
ABT_pool
margo_hg_handle_get_handler_pool
(
hg_handle_t
h
);
/**
* Retrieve the Mercury context that was associated with this instance at
* initialization time
...
...
@@ -771,6 +784,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 an hg_info struct
*
* \param [in] info hg_info struct
*
* \return Margo instance
*/
margo_instance_id
margo_hg_info_get_instance
(
const
struct
hg_info
*
info
);
/**
* Enables diagnostic collection on specified Margo instance
*
...
...
src/margo.c
View file @
b8e72979
...
...
@@ -512,7 +512,7 @@ int margo_shutdown_remote_instance(
mid
->
shutdown_rpc_id
,
&
handle
);
if
(
hret
!=
HG_SUCCESS
)
return
-
1
;
hret
=
margo_forward
(
MARGO_DEFAULT_PROVIDER_ID
,
handle
,
NULL
);
hret
=
margo_forward
(
handle
,
NULL
);
if
(
hret
!=
HG_SUCCESS
)
{
margo_destroy
(
handle
);
...
...
@@ -759,20 +759,20 @@ static hg_return_t margo_cb(const struct hg_cb_info *info)
return
(
HG_SUCCESS
);
}
hg_return_t
margo_forward
(
hg_return_t
margo_forward
_provider_id
(
uint16_t
provider_id
,
hg_handle_t
handle
,
void
*
in_struct
)
{
hg_return_t
hret
;
margo_request
req
;
hret
=
margo_iforward
(
provider_id
,
handle
,
in_struct
,
&
req
);
hret
=
margo_iforward
_provider_id
(
provider_id
,
handle
,
in_struct
,
&
req
);
if
(
hret
!=
HG_SUCCESS
)
return
hret
;
return
margo_wait
(
req
);
}
hg_return_t
margo_iforward
(
hg_return_t
margo_iforward
_provider_id
(
uint16_t
provider_id
,
hg_handle_t
handle
,
void
*
in_struct
,
...
...
@@ -1106,6 +1106,14 @@ ABT_pool margo_hg_handle_get_handler_pool(hg_handle_t h)
return
pool
;
}
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
;
return
data
->
mid
;
}
margo_instance_id
margo_hg_handle_get_instance
(
hg_handle_t
h
)
{
struct
margo_rpc_data
*
data
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment