Commit 8afae580 authored by Philip Carns's avatar Philip Carns

update remaining examples

parent b8e72979
......@@ -55,10 +55,6 @@ void composed_read(margo_instance_id mid, hg_addr_t svr_addr, void *buffer, hg_s
in.data_xfer_svc_addr = data_xfer_svc_addr_string;
#if 0
margo_set_target_id(handle, mplex_id);
#endif
/* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above.
*/
......@@ -105,10 +101,6 @@ void data_xfer_read(margo_instance_id mid, hg_addr_t svr_addr, void *buffer, hg_
in.client_addr = addr_self_string;
#if 0
margo_set_target_id(handle, mplex_id);
#endif
/* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above.
*/
......
......@@ -38,7 +38,7 @@ static void data_xfer_read_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult);
my_tid = pthread_self();
printf("svc1: do_thing: mplex_id: %u, ult: %p, xstream %p, tid: %lu\n",
printf("svc1: do_thing: provider_id: %u, ult: %p, xstream %p, tid: %lu\n",
hgi->target_id, my_ult, my_xstream, my_tid);
#endif
......@@ -72,7 +72,7 @@ static void data_xfer_read_ult(hg_handle_t handle)
}
DEFINE_MARGO_RPC_HANDLER(data_xfer_read_ult)
int data_xfer_service_register(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id)
int data_xfer_service_register(margo_instance_id mid, ABT_pool pool, uint32_t provider_id)
{
hg_return_t hret;
......@@ -86,14 +86,14 @@ int data_xfer_service_register(margo_instance_id mid, ABT_pool pool, uint32_t mp
assert(hret == HG_SUCCESS);
/* register RPC handler */
MARGO_REGISTER_MPLEX(mid, "data_xfer_read",
MARGO_REGISTER_PROVIDER(mid, "data_xfer_read",
data_xfer_read_in_t, data_xfer_read_out_t,
data_xfer_read_ult, mplex_id, pool);
data_xfer_read_ult, provider_id, pool);
return(0);
}
void data_xfer_deregister(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id)
void data_xfer_deregister(margo_instance_id mid, ABT_pool pool, uint32_t provider_id)
{
margo_bulk_free(g_buffer_bulk_handle);
free(g_buffer);
......
......@@ -9,7 +9,7 @@
#include <margo.h>
int data_xfer_service_register(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id);
void data_xfer_service_deregister(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id);
int data_xfer_service_register(margo_instance_id mid, ABT_pool pool, uint32_t provider_id);
void data_xfer_service_deregister(margo_instance_id mid, ABT_pool pool, uint32_t provider_id);
#endif /* __DATA_XFER_SERVICE */
......@@ -43,7 +43,7 @@ static void delegator_read_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult);
my_tid = pthread_self();
printf("svc1: do_thing: mplex_id: %u, ult: %p, xstream %p, tid: %lu\n",
printf("svc1: do_thing: provider_id: %u, ult: %p, xstream %p, tid: %lu\n",
hgi->target_id, my_ult, my_xstream, my_tid);
#endif
......@@ -81,7 +81,7 @@ static void delegator_read_ult(hg_handle_t handle)
}
DEFINE_MARGO_RPC_HANDLER(delegator_read_ult)
int delegator_service_register(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id)
int delegator_service_register(margo_instance_id mid, ABT_pool pool, uint32_t provider_id)
{
/* register client-side of function to relay */
/* NOTE: this RPC may already be registered if this process has already registered a
......@@ -91,14 +91,14 @@ int delegator_service_register(margo_instance_id mid, ABT_pool pool, uint32_t mp
data_xfer_read_in_t, data_xfer_read_out_t, NULL);
/* register RPC handler */
MARGO_REGISTER_MPLEX(mid, "delegator_read",
MARGO_REGISTER_PROVIDER(mid, "delegator_read",
delegator_read_in_t, delegator_read_out_t,
delegator_read_ult, mplex_id, pool);
delegator_read_ult, provider_id, pool);
return(0);
}
void delegator_deregister(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id)
void delegator_deregister(margo_instance_id mid, ABT_pool pool, uint32_t provider_id)
{
/* TODO: undo what was done in delegator_register() */
return;
......
......@@ -9,7 +9,7 @@
#include <margo.h>
int delegator_service_register(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id);
void delegator_service_deregister(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id);
int delegator_service_register(margo_instance_id mid, ABT_pool pool, uint32_t provider_id);
void delegator_service_deregister(margo_instance_id mid, ABT_pool pool, uint32_t provider_id);
#endif /* __DELEGATOR_SERVICE */
......@@ -107,7 +107,7 @@ int main(int argc, char **argv)
*/
MARGO_REGISTER(mid, "my_shutdown_rpc", void, void, my_rpc_shutdown_ult);
/* register svc1, with mplex_id 1, to execute on the default handler pool
/* register svc1, with provider_id 1, to execute on the default handler pool
* used by Margo
*/
margo_get_handler_pool(mid, &handler_pool);
......@@ -124,14 +124,14 @@ int main(int argc, char **argv)
ret = ABT_xstream_get_main_pools(svc1_xstream2, 1, &svc1_pool2);
assert(ret == 0);
#endif
/* register svc1, with mplex_id 2, to execute on a separate pool. This
/* register svc1, with provider_id 2, to execute on a separate pool. This
* will result in svc1 being registered twice, with the client being able
* to dictate which instance they want to target
*/
ret = svc1_register(mid, svc1_pool2, 2);
assert(ret == 0);
/* register svc2, with mplex_id 3, to execute on the default handler pool
/* register svc2, with provider_id 3, to execute on the default handler pool
* used by Margo
*/
margo_get_handler_pool(mid, &handler_pool);
......
......@@ -30,7 +30,7 @@ int svc1_register_client(margo_instance_id mid)
return(0);
}
void svc1_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id)
void svc1_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t provider_id)
{
hg_handle_t handle;
svc1_do_thing_in_t in;
......@@ -54,13 +54,11 @@ void svc1_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id)
HG_BULK_READ_ONLY, &in.bulk_handle);
assert(hret == HG_SUCCESS);
margo_set_target_id(handle, mplex_id);
/* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above.
*/
in.input_val = 0;
hret = margo_forward(handle, &in);
hret = margo_forward_provider_id(provider_id, handle, &in);
assert(hret == HG_SUCCESS);
/* decode response */
......@@ -76,7 +74,7 @@ void svc1_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id)
return;
}
void svc1_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id)
void svc1_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t provider_id)
{
hg_handle_t handle;
svc1_do_other_thing_in_t in;
......@@ -100,13 +98,11 @@ void svc1_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mpl
HG_BULK_READ_ONLY, &in.bulk_handle);
assert(hret == HG_SUCCESS);
margo_set_target_id(handle, mplex_id);
/* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above.
*/
in.input_val = 0;
hret = margo_forward(handle, &in);
hret = margo_forward_provider_id(provider_id, handle, &in);
assert(hret == HG_SUCCESS);
/* decode response */
......
......@@ -11,7 +11,7 @@
int svc1_register_client(margo_instance_id mid);
void svc1_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id);
void svc1_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id);
void svc1_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t provider_id);
void svc1_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t provider_id);
#endif /* __SVC1_CLIENT */
......@@ -33,8 +33,8 @@ static void svc1_do_thing_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult);
my_tid = pthread_self();
printf("svc1: do_thing: mplex_id: %u, ult: %p, xstream %p, tid: %lu\n",
hgi->target_id, my_ult, my_xstream, my_tid);
printf("svc1: do_thing: ult: %p, xstream %p, tid: %lu\n",
my_ult, my_xstream, my_tid);
out.ret = 0;
......@@ -91,8 +91,8 @@ static void svc1_do_other_thing_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult);
my_tid = pthread_self();
printf("svc1: do_other_thing: mplex_id: %u, ult: %p, xstream %p, tid: %lu\n",
hgi->target_id, my_ult, my_xstream, my_tid);
printf("svc1: do_other_thing: ult: %p, xstream %p, tid: %lu\n",
my_ult, my_xstream, my_tid);
out.ret = 0;
......@@ -125,19 +125,19 @@ static void svc1_do_other_thing_ult(hg_handle_t handle)
}
DEFINE_MARGO_RPC_HANDLER(svc1_do_other_thing_ult)
int svc1_register(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id)
int svc1_register(margo_instance_id mid, ABT_pool pool, uint32_t provider_id)
{
MARGO_REGISTER_MPLEX(mid, "svc1_do_thing",
MARGO_REGISTER_PROVIDER(mid, "svc1_do_thing",
svc1_do_thing_in_t, svc1_do_thing_out_t,
svc1_do_thing_ult, mplex_id, pool);
MARGO_REGISTER_MPLEX(mid, "svc1_do_other_thing",
svc1_do_thing_ult, provider_id, pool);
MARGO_REGISTER_PROVIDER(mid, "svc1_do_other_thing",
svc1_do_other_thing_in_t, svc1_do_other_thing_out_t,
svc1_do_other_thing_ult, mplex_id, pool);
svc1_do_other_thing_ult, provider_id, pool);
return(0);
}
void svc1_deregister(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id)
void svc1_deregister(margo_instance_id mid, ABT_pool pool, uint32_t provider_id)
{
/* TODO: undo what was done in svc1_register() */
return;
......
......@@ -9,7 +9,7 @@
#include <margo.h>
int svc1_register(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id);
void svc1_deregister(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id);
int svc1_register(margo_instance_id mid, ABT_pool pool, uint32_t provider_id);
void svc1_deregister(margo_instance_id mid, ABT_pool pool, uint32_t provider_id);
#endif /* __SVC1_SERVER */
......@@ -29,7 +29,7 @@ int svc2_register_client(margo_instance_id mid)
return(0);
}
void svc2_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id)
void svc2_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t provider_id)
{
hg_handle_t handle;
svc2_do_thing_in_t in;
......@@ -53,13 +53,11 @@ void svc2_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id)
HG_BULK_READ_ONLY, &in.bulk_handle);
assert(hret == HG_SUCCESS);
margo_set_target_id(handle, mplex_id);
/* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above.
*/
in.input_val = 0;
hret = margo_forward(handle, &in);
hret = margo_forward_provider_id(provider_id, handle, &in);
assert(hret == HG_SUCCESS);
/* decode response */
......@@ -75,7 +73,7 @@ void svc2_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id)
return;
}
void svc2_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id)
void svc2_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t provider_id)
{
hg_handle_t handle;
svc2_do_other_thing_in_t in;
......@@ -99,13 +97,11 @@ void svc2_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mpl
HG_BULK_READ_ONLY, &in.bulk_handle);
assert(hret == HG_SUCCESS);
margo_set_target_id(handle, mplex_id);
/* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above.
*/
in.input_val = 0;
hret = margo_forward(handle, &in);
hret = margo_forward_provider_id(provider_id, handle, &in);
assert(hret == HG_SUCCESS);
/* decode response */
......
......@@ -11,7 +11,7 @@
int svc2_register_client(margo_instance_id mid);
void svc2_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id);
void svc2_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id);
void svc2_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t provider_id);
void svc2_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t provider_id);
#endif /* __SVC2_CLIENT */
......@@ -33,8 +33,8 @@ static void svc2_do_thing_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult);
my_tid = pthread_self();
printf("svc2: do_thing: mplex_id: %u, ult: %p, xstream %p, tid: %lu\n",
hgi->target_id, my_ult, my_xstream, my_tid);
printf("svc2: do_thing: ult: %p, xstream %p, tid: %lu\n",
my_ult, my_xstream, my_tid);
out.ret = 0;
......@@ -91,8 +91,8 @@ static void svc2_do_other_thing_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult);
my_tid = pthread_self();
printf("svc2: do_other_thing: mplex_id: %u, ult: %p, xstream %p, tid: %lu\n",
hgi->target_id, my_ult, my_xstream, my_tid);
printf("svc2: do_other_thing: ult: %p, xstream %p, tid: %lu\n",
my_ult, my_xstream, my_tid);
out.ret = 0;
......@@ -125,19 +125,19 @@ static void svc2_do_other_thing_ult(hg_handle_t handle)
}
DEFINE_MARGO_RPC_HANDLER(svc2_do_other_thing_ult)
int svc2_register(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id)
int svc2_register(margo_instance_id mid, ABT_pool pool, uint32_t provider_id)
{
MARGO_REGISTER_MPLEX(mid, "svc2_do_thing",
MARGO_REGISTER_PROVIDER(mid, "svc2_do_thing",
svc2_do_thing_in_t, svc2_do_thing_out_t,
svc2_do_thing_ult, mplex_id, pool);
MARGO_REGISTER_MPLEX(mid, "svc2_do_other_thing",
svc2_do_thing_ult, provider_id, pool);
MARGO_REGISTER_PROVIDER(mid, "svc2_do_other_thing",
svc2_do_other_thing_in_t, svc2_do_other_thing_out_t,
svc2_do_other_thing_ult, mplex_id, pool);
svc2_do_other_thing_ult, provider_id, pool);
return(0);
}
void svc2_deregister(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id)
void svc2_deregister(margo_instance_id mid, ABT_pool pool, uint32_t provider_id)
{
/* TODO: undo what was done in svc2_register() */
return;
......
......@@ -9,7 +9,7 @@
#include <margo.h>
int svc2_register(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id);
void svc2_deregister(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id);
int svc2_register(margo_instance_id mid, ABT_pool pool, uint32_t provider_id);
void svc2_deregister(margo_instance_id mid, ABT_pool pool, uint32_t provider_id);
#endif /* __SVC2_SERVER */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment