Commit afc7cf00 authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

Merge branch 'dev-provider-id' into 'master'

refactor provider multiplexing

See merge request sds/margo!4
parents 72eec057 d9ec42c5
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63]) AC_PREREQ([2.63])
AC_INIT([margo], [0.2], [],[],[]) AC_INIT([margo], [0.3], [],[],[])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
LT_INIT LT_INIT
......
...@@ -55,10 +55,6 @@ void composed_read(margo_instance_id mid, hg_addr_t svr_addr, void *buffer, hg_s ...@@ -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; 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 /* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above. * 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_ ...@@ -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; 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 /* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above. * input struct. It was set above.
*/ */
......
...@@ -38,7 +38,7 @@ static void data_xfer_read_ult(hg_handle_t handle) ...@@ -38,7 +38,7 @@ static void data_xfer_read_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream); ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult); ABT_thread_self(&my_ult);
my_tid = pthread_self(); 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); hgi->target_id, my_ult, my_xstream, my_tid);
#endif #endif
...@@ -72,7 +72,7 @@ static void data_xfer_read_ult(hg_handle_t handle) ...@@ -72,7 +72,7 @@ static void data_xfer_read_ult(hg_handle_t handle)
} }
DEFINE_MARGO_RPC_HANDLER(data_xfer_read_ult) 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; hg_return_t hret;
...@@ -86,14 +86,14 @@ int data_xfer_service_register(margo_instance_id mid, ABT_pool pool, uint32_t mp ...@@ -86,14 +86,14 @@ int data_xfer_service_register(margo_instance_id mid, ABT_pool pool, uint32_t mp
assert(hret == HG_SUCCESS); assert(hret == HG_SUCCESS);
/* register RPC handler */ /* 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_in_t, data_xfer_read_out_t,
data_xfer_read_ult, mplex_id, pool); data_xfer_read_ult, provider_id, pool);
return(0); 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); margo_bulk_free(g_buffer_bulk_handle);
free(g_buffer); free(g_buffer);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <margo.h> #include <margo.h>
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);
void data_xfer_service_deregister(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 provider_id);
#endif /* __DATA_XFER_SERVICE */ #endif /* __DATA_XFER_SERVICE */
...@@ -43,7 +43,7 @@ static void delegator_read_ult(hg_handle_t handle) ...@@ -43,7 +43,7 @@ static void delegator_read_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream); ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult); ABT_thread_self(&my_ult);
my_tid = pthread_self(); 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); hgi->target_id, my_ult, my_xstream, my_tid);
#endif #endif
...@@ -81,7 +81,7 @@ static void delegator_read_ult(hg_handle_t handle) ...@@ -81,7 +81,7 @@ static void delegator_read_ult(hg_handle_t handle)
} }
DEFINE_MARGO_RPC_HANDLER(delegator_read_ult) 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 */ /* register client-side of function to relay */
/* NOTE: this RPC may already be registered if this process has already registered a /* 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 ...@@ -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); data_xfer_read_in_t, data_xfer_read_out_t, NULL);
/* register RPC handler */ /* 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_in_t, delegator_read_out_t,
delegator_read_ult, mplex_id, pool); delegator_read_ult, provider_id, pool);
return(0); 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() */ /* TODO: undo what was done in delegator_register() */
return; return;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <margo.h> #include <margo.h>
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);
void delegator_service_deregister(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id); void delegator_service_deregister(margo_instance_id mid, ABT_pool pool, uint32_t provider_id);
#endif /* __DELEGATOR_SERVICE */ #endif /* __DELEGATOR_SERVICE */
...@@ -107,7 +107,7 @@ int main(int argc, char **argv) ...@@ -107,7 +107,7 @@ int main(int argc, char **argv)
*/ */
MARGO_REGISTER(mid, "my_shutdown_rpc", void, void, my_rpc_shutdown_ult); 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 * used by Margo
*/ */
margo_get_handler_pool(mid, &handler_pool); margo_get_handler_pool(mid, &handler_pool);
...@@ -124,14 +124,14 @@ int main(int argc, char **argv) ...@@ -124,14 +124,14 @@ int main(int argc, char **argv)
ret = ABT_xstream_get_main_pools(svc1_xstream2, 1, &svc1_pool2); ret = ABT_xstream_get_main_pools(svc1_xstream2, 1, &svc1_pool2);
assert(ret == 0); assert(ret == 0);
#endif #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 * will result in svc1 being registered twice, with the client being able
* to dictate which instance they want to target * to dictate which instance they want to target
*/ */
ret = svc1_register(mid, svc1_pool2, 2); ret = svc1_register(mid, svc1_pool2, 2);
assert(ret == 0); 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 * used by Margo
*/ */
margo_get_handler_pool(mid, &handler_pool); margo_get_handler_pool(mid, &handler_pool);
......
...@@ -30,7 +30,7 @@ int svc1_register_client(margo_instance_id mid) ...@@ -30,7 +30,7 @@ int svc1_register_client(margo_instance_id mid)
return(0); 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; hg_handle_t handle;
svc1_do_thing_in_t in; 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) ...@@ -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); HG_BULK_READ_ONLY, &in.bulk_handle);
assert(hret == HG_SUCCESS); assert(hret == HG_SUCCESS);
margo_set_target_id(handle, mplex_id);
/* Send rpc. Note that we are also transmitting the bulk handle in the /* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above. * input struct. It was set above.
*/ */
in.input_val = 0; in.input_val = 0;
hret = margo_forward(handle, &in); hret = margo_provider_forward(provider_id, handle, &in);
assert(hret == HG_SUCCESS); assert(hret == HG_SUCCESS);
/* decode response */ /* decode response */
...@@ -76,7 +74,7 @@ void svc1_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id) ...@@ -76,7 +74,7 @@ void svc1_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id)
return; 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; hg_handle_t handle;
svc1_do_other_thing_in_t in; 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 ...@@ -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); HG_BULK_READ_ONLY, &in.bulk_handle);
assert(hret == HG_SUCCESS); assert(hret == HG_SUCCESS);
margo_set_target_id(handle, mplex_id);
/* Send rpc. Note that we are also transmitting the bulk handle in the /* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above. * input struct. It was set above.
*/ */
in.input_val = 0; in.input_val = 0;
hret = margo_forward(handle, &in); hret = margo_provider_forward(provider_id, handle, &in);
assert(hret == HG_SUCCESS); assert(hret == HG_SUCCESS);
/* decode response */ /* decode response */
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
int svc1_register_client(margo_instance_id mid); 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_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 mplex_id); void svc1_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t provider_id);
#endif /* __SVC1_CLIENT */ #endif /* __SVC1_CLIENT */
...@@ -33,8 +33,8 @@ static void svc1_do_thing_ult(hg_handle_t handle) ...@@ -33,8 +33,8 @@ static void svc1_do_thing_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream); ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult); ABT_thread_self(&my_ult);
my_tid = pthread_self(); my_tid = pthread_self();
printf("svc1: do_thing: mplex_id: %u, ult: %p, xstream %p, tid: %lu\n", printf("svc1: do_thing: ult: %p, xstream %p, tid: %lu\n",
hgi->target_id, my_ult, my_xstream, my_tid); my_ult, my_xstream, my_tid);
out.ret = 0; out.ret = 0;
...@@ -91,8 +91,8 @@ static void svc1_do_other_thing_ult(hg_handle_t handle) ...@@ -91,8 +91,8 @@ static void svc1_do_other_thing_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream); ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult); ABT_thread_self(&my_ult);
my_tid = pthread_self(); my_tid = pthread_self();
printf("svc1: do_other_thing: mplex_id: %u, ult: %p, xstream %p, tid: %lu\n", printf("svc1: do_other_thing: ult: %p, xstream %p, tid: %lu\n",
hgi->target_id, my_ult, my_xstream, my_tid); my_ult, my_xstream, my_tid);
out.ret = 0; out.ret = 0;
...@@ -125,19 +125,19 @@ static void svc1_do_other_thing_ult(hg_handle_t handle) ...@@ -125,19 +125,19 @@ static void svc1_do_other_thing_ult(hg_handle_t handle)
} }
DEFINE_MARGO_RPC_HANDLER(svc1_do_other_thing_ult) 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_in_t, svc1_do_thing_out_t,
svc1_do_thing_ult, mplex_id, pool); svc1_do_thing_ult, provider_id, pool);
MARGO_REGISTER_MPLEX(mid, "svc1_do_other_thing", MARGO_REGISTER_PROVIDER(mid, "svc1_do_other_thing",
svc1_do_other_thing_in_t, svc1_do_other_thing_out_t, 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); 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() */ /* TODO: undo what was done in svc1_register() */
return; return;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <margo.h> #include <margo.h>
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);
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);
#endif /* __SVC1_SERVER */ #endif /* __SVC1_SERVER */
...@@ -29,7 +29,7 @@ int svc2_register_client(margo_instance_id mid) ...@@ -29,7 +29,7 @@ int svc2_register_client(margo_instance_id mid)
return(0); 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; hg_handle_t handle;
svc2_do_thing_in_t in; 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) ...@@ -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); HG_BULK_READ_ONLY, &in.bulk_handle);
assert(hret == HG_SUCCESS); assert(hret == HG_SUCCESS);
margo_set_target_id(handle, mplex_id);
/* Send rpc. Note that we are also transmitting the bulk handle in the /* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above. * input struct. It was set above.
*/ */
in.input_val = 0; in.input_val = 0;
hret = margo_forward(handle, &in); hret = margo_provider_forward(provider_id, handle, &in);
assert(hret == HG_SUCCESS); assert(hret == HG_SUCCESS);
/* decode response */ /* decode response */
...@@ -75,7 +73,7 @@ void svc2_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id) ...@@ -75,7 +73,7 @@ void svc2_do_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t mplex_id)
return; 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; hg_handle_t handle;
svc2_do_other_thing_in_t in; 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 ...@@ -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); HG_BULK_READ_ONLY, &in.bulk_handle);
assert(hret == HG_SUCCESS); assert(hret == HG_SUCCESS);
margo_set_target_id(handle, mplex_id);
/* Send rpc. Note that we are also transmitting the bulk handle in the /* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above. * input struct. It was set above.
*/ */
in.input_val = 0; in.input_val = 0;
hret = margo_forward(handle, &in); hret = margo_provider_forward(provider_id, handle, &in);
assert(hret == HG_SUCCESS); assert(hret == HG_SUCCESS);
/* decode response */ /* decode response */
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
int svc2_register_client(margo_instance_id mid); 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_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 mplex_id); void svc2_do_other_thing(margo_instance_id mid, hg_addr_t svr_addr, uint32_t provider_id);
#endif /* __SVC2_CLIENT */ #endif /* __SVC2_CLIENT */
...@@ -33,8 +33,8 @@ static void svc2_do_thing_ult(hg_handle_t handle) ...@@ -33,8 +33,8 @@ static void svc2_do_thing_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream); ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult); ABT_thread_self(&my_ult);
my_tid = pthread_self(); my_tid = pthread_self();
printf("svc2: do_thing: mplex_id: %u, ult: %p, xstream %p, tid: %lu\n", printf("svc2: do_thing: ult: %p, xstream %p, tid: %lu\n",
hgi->target_id, my_ult, my_xstream, my_tid); my_ult, my_xstream, my_tid);
out.ret = 0; out.ret = 0;
...@@ -91,8 +91,8 @@ static void svc2_do_other_thing_ult(hg_handle_t handle) ...@@ -91,8 +91,8 @@ static void svc2_do_other_thing_ult(hg_handle_t handle)
ABT_xstream_self(&my_xstream); ABT_xstream_self(&my_xstream);
ABT_thread_self(&my_ult); ABT_thread_self(&my_ult);
my_tid = pthread_self(); my_tid = pthread_self();
printf("svc2: do_other_thing: mplex_id: %u, ult: %p, xstream %p, tid: %lu\n", printf("svc2: do_other_thing: ult: %p, xstream %p, tid: %lu\n",
hgi->target_id, my_ult, my_xstream, my_tid); my_ult, my_xstream, my_tid);
out.ret = 0; out.ret = 0;
...@@ -125,19 +125,19 @@ static void svc2_do_other_thing_ult(hg_handle_t handle) ...@@ -125,19 +125,19 @@ static void svc2_do_other_thing_ult(hg_handle_t handle)
} }
DEFINE_MARGO_RPC_HANDLER(svc2_do_other_thing_ult) 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_in_t, svc2_do_thing_out_t,
svc2_do_thing_ult, mplex_id, pool); svc2_do_thing_ult, provider_id, pool);
MARGO_REGISTER_MPLEX(mid, "svc2_do_other_thing", MARGO_REGISTER_PROVIDER(mid, "svc2_do_other_thing",
svc2_do_other_thing_in_t, svc2_do_other_thing_out_t, 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); 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() */ /* TODO: undo what was done in svc2_register() */
return; return;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <margo.h> #include <margo.h>
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);
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);
#endif /* __SVC2_SERVER */ #endif /* __SVC2_SERVER */
...@@ -23,6 +23,10 @@ extern "C" { ...@@ -23,6 +23,10 @@ extern "C" {
#include <mercury_macros.h> #include <mercury_macros.h>
#include <abt.h> #include <abt.h>
/* determine how much of the Mercury ID space to use for Margo provider IDs */
#define __MARGO_PROVIDER_ID_SIZE (sizeof(hg_id_t)/4)
#define __MARGO_RPC_HASH_SIZE (__MARGO_PROVIDER_ID_SIZE * 3)
#undef MERCURY_REGISTER #undef MERCURY_REGISTER
struct margo_instance; struct margo_instance;
...@@ -34,7 +38,8 @@ typedef ABT_eventual margo_request; ...@@ -34,7 +38,8 @@ typedef ABT_eventual margo_request;
#define MARGO_REQUEST_NULL ABT_EVENTUAL_NULL #define MARGO_REQUEST_NULL ABT_EVENTUAL_NULL
#define MARGO_CLIENT_MODE 0 #define MARGO_CLIENT_MODE 0
#define MARGO_SERVER_MODE 1 #define MARGO_SERVER_MODE 1
#define MARGO_DEFAULT_MPLEX_ID 0 #define MARGO_DEFAULT_PROVIDER_ID 0
#define MARGO_MAX_PROVIDER_ID ((1 << (8*__MARGO_PROVIDER_ID_SIZE))-1)
#define MARGO_PARAM_PROGRESS_TIMEOUT_UB 1 #define MARGO_PARAM_PROGRESS_TIMEOUT_UB 1
...@@ -148,45 +153,50 @@ int margo_shutdown_remote_instance( ...@@ -148,45 +153,50 @@ int margo_shutdown_remote_instance(
margo_instance_id mid, margo_instance_id mid,
hg_addr_t remote_addr); hg_addr_t remote_addr);
/** /**
* Registers an RPC with margo * Registers an RPC with margo that is associated with a provider instance
* *
* \param [in] mid Margo instance * \param [in] mid Margo instance
* \param [in] func_name unique function name for RPC * \param [in] func_name unique function name for RPC
* \param [in] in_proc_cb pointer to input proc callback * \param [in] in_proc_cb pointer to input proc callback
* \param [in] out_proc_cb pointer to output proc callback * \param [in] out_proc_cb pointer to output proc callback
* \param [in] rpc_cb RPC callback * \param [in] rpc_cb RPC callback
* \param [in] provider_id provider identifier
* \param [in] pool Argobots pool the handler will execute in
* *
* \return unique ID associated to the registered function * \return unique ID associated to the registered function
*/