Commit 6e313ec0 authored by Philip Carns's avatar Philip Carns

skeleton rpc handler for bulk write

parent d5199990
......@@ -76,3 +76,32 @@ static void bake_bulk_create_ult(hg_handle_t handle)
}
DEFINE_MARGO_RPC_HANDLER(bake_bulk_create_ult)
/* service a remote RPC that writes to a bulk region */
static void bake_bulk_write_ult(hg_handle_t handle)
{
bake_bulk_write_out_t out;
bake_bulk_write_in_t in;
hg_return_t hret;
printf("Got RPC request to write bulk region.\n");
memset(&out, 0, sizeof(out));
hret = HG_Get_input(handle, &in);
if(hret != HG_SUCCESS)
{
out.ret = -1;
HG_Respond(handle, NULL, NULL, &out);
HG_Destroy(handle);
return;
}
/* TODO: implement */
out.ret = -1;
HG_Respond(handle, NULL, NULL, &out);
HG_Destroy(handle);
return;
}
DEFINE_MARGO_RPC_HANDLER(bake_bulk_write_ult)
......@@ -34,6 +34,7 @@ MERCURY_GEN_PROC(bake_bulk_write_in_t,
((hg_bulk_t)(bulk_handle)))
MERCURY_GEN_PROC(bake_bulk_write_out_t,
((int32_t)(ret)))
DECLARE_MARGO_RPC_HANDLER(bake_bulk_write_ult)
/* TODO: where should the encoder defs live? Not in bake-bulk-rpc.c because
* we don't really need the rpc handlers to be linked into clients...
......
......@@ -105,6 +105,9 @@ int main(int argc, char **argv)
MERCURY_REGISTER(hg_class, "bake_bulk_create_rpc", bake_bulk_create_in_t,
bake_bulk_create_out_t,
bake_bulk_create_ult_handler);
MERCURY_REGISTER(hg_class, "bake_bulk_write_rpc", bake_bulk_write_in_t,
bake_bulk_write_out_t,
bake_bulk_write_ult_handler);
/* NOTE: at this point this server ULT has two options. It can wait on
* whatever mechanism it wants to (however long the daemon should run and
......
......@@ -22,6 +22,7 @@ struct bake_instance
struct bake_instance g_binst; /* TODO: replace later, hard coded global instance */
static hg_id_t g_bake_bulk_shutdown_id; /* TODO: probably not global in the long run either */
static hg_id_t g_bake_bulk_create_id; /* TODO: probably not global in the long run either */
static hg_id_t g_bake_bulk_write_id; /* TODO: probably not global in the long run either */
int bake_probe_instance(
const char *mercury_dest,
......@@ -67,6 +68,12 @@ int bake_probe_instance(
bake_bulk_create_in_t,
bake_bulk_create_out_t,
NULL);
g_bake_bulk_write_id =
MERCURY_REGISTER(g_binst.hg_class,
"bake_bulk_write_rpc",
bake_bulk_write_in_t,
bake_bulk_write_out_t,
NULL);
g_binst.mid = margo_init(0, 0, g_binst.hg_context);
if(!g_binst.mid)
......
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