Commit b1b4e799 authored by Philip Carns's avatar Philip Carns

handler for eager write

parent 3023c330
...@@ -162,6 +162,60 @@ static void bake_bulk_write_ult(hg_handle_t handle) ...@@ -162,6 +162,60 @@ static void bake_bulk_write_ult(hg_handle_t handle)
} }
DEFINE_MARGO_RPC_HANDLER(bake_bulk_write_ult) DEFINE_MARGO_RPC_HANDLER(bake_bulk_write_ult)
/* service a remote RPC that writes to a bulk region in eager mode */
static void bake_bulk_eager_write_ult(hg_handle_t handle)
{
bake_bulk_eager_write_out_t out;
bake_bulk_eager_write_in_t in;
hg_return_t hret;
char* buffer;
hg_bulk_t bulk_handle;
struct hg_info *hgi;
margo_instance_id mid;
pmemobj_region_id_t* prid;
// printf("Got RPC request to write bulk region.\n");
memset(&out, 0, sizeof(out));
hgi = HG_Get_info(handle);
assert(hgi);
mid = margo_hg_class_to_instance(hgi->hg_class);
hret = HG_Get_input(handle, &in);
if(hret != HG_SUCCESS)
{
out.ret = -1;
HG_Respond(handle, NULL, NULL, &out);
HG_Destroy(handle);
return;
}
prid = (pmemobj_region_id_t*)in.rid.data;
/* find memory address for target object */
buffer = pmemobj_direct(prid->oid);
if(!buffer)
{
out.ret = -1;
HG_Free_input(handle, &in);
HG_Respond(handle, NULL, NULL, &out);
HG_Destroy(handle);
return;
}
memcpy(buffer, in.buffer, in.size);
out.ret = 0;
HG_Free_input(handle, &in);
HG_Respond(handle, NULL, NULL, &out);
HG_Destroy(handle);
return;
}
DEFINE_MARGO_RPC_HANDLER(bake_bulk_eager_write_ult)
/* service a remote RPC that persists to a bulk region */ /* service a remote RPC that persists to a bulk region */
static void bake_bulk_persist_ult(hg_handle_t handle) static void bake_bulk_persist_ult(hg_handle_t handle)
{ {
......
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