Commit 38b6d8de authored by David Rich's avatar David Rich Committed by Rob Latham
Browse files

Avoid margo_create for now. Problem with handle caching?

parent 3f56b38a
...@@ -62,7 +62,9 @@ hg_return_t kv_open(kv_context *context, const char *server_addr, const char *db ...@@ -62,7 +62,9 @@ hg_return_t kv_open(kv_context *context, const char *server_addr, const char *db
ret = margo_addr_lookup(context->mid, server_addr, &(context->svr_addr)); ret = margo_addr_lookup(context->mid, server_addr, &(context->svr_addr));
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
ret = margo_create(context->mid, context->svr_addr, // grab hg_context for mid
hg_context_t *hg_context = margo_get_context(context->mid);
ret = HG_Create(hg_context, context->svr_addr,
context->open_id, &handle); context->open_id, &handle);
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
...@@ -79,22 +81,22 @@ hg_return_t kv_open(kv_context *context, const char *server_addr, const char *db ...@@ -79,22 +81,22 @@ hg_return_t kv_open(kv_context *context, const char *server_addr, const char *db
/* put/get handles: can have as many in flight as we have registered. /* put/get handles: can have as many in flight as we have registered.
* BAKE has a handle-caching mechanism we should consult. * BAKE has a handle-caching mechanism we should consult.
* should margo be caching handles? */ * should margo be caching handles? */
ret = margo_create(context->mid, context->svr_addr, ret = HG_Create(hg_context, context->svr_addr,
context->put_id, &(context->put_handle)); context->put_id, &(context->put_handle));
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
ret = margo_create(context->mid, context->svr_addr, ret = HG_Create(hg_context, context->svr_addr,
context->bulk_put_id, &(context->bulk_put_handle)); context->bulk_put_id, &(context->bulk_put_handle));
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
ret = margo_create(context->mid, context->svr_addr, ret = HG_Create(hg_context, context->svr_addr,
context->get_id, &(context->get_handle)); context->get_id, &(context->get_handle));
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
ret = margo_create(context->mid, context->svr_addr, ret = HG_Create(hg_context, context->svr_addr,
context->bulk_get_id, &(context->bulk_get_handle)); context->bulk_get_id, &(context->bulk_get_handle));
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
ret = margo_create(context->mid, context->svr_addr, ret = HG_Create(hg_context, context->svr_addr,
context->bench_id, &(context->bench_handle)); context->bench_id, &(context->bench_handle));
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
ret = margo_create(context->mid, context->svr_addr, ret = HG_Create(hg_context, context->svr_addr,
context->shutdown_id, &(context->shutdown_handle)); context->shutdown_id, &(context->shutdown_handle));
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
...@@ -190,7 +192,9 @@ hg_return_t kv_close(kv_context *context) ...@@ -190,7 +192,9 @@ hg_return_t kv_close(kv_context *context)
put_in_t close_in; put_in_t close_in;
put_out_t close_out; put_out_t close_out;
ret = margo_create(context->mid, context->svr_addr, // grab hg_context for mid
hg_context_t *hg_context = margo_get_context(context->mid);
ret = HG_Create(hg_context, context->svr_addr,
context->close_id, &handle); context->close_id, &handle);
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
ret = margo_forward(handle, &close_in); ret = margo_forward(handle, &close_in);
...@@ -217,10 +221,12 @@ bench_result *kv_benchmark(kv_context *context, int count) { ...@@ -217,10 +221,12 @@ bench_result *kv_benchmark(kv_context *context, int count) {
ret = margo_create(context->mid, context->svr_addr, ret = margo_create(context->mid, context->svr_addr,
context->bench_id, &(context->bench_handle) ); context->bench_id, &(context->bench_handle) );
bench_in.count = count; // grab hg_context for mid
ret = margo_create(context->mid, context->svr_addr, hg_context_t *hg_context = margo_get_context(context->mid);
ret = HG_Create(hg_context, context->svr_addr,
context->bench_id, &handle); context->bench_id, &handle);
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
bench_in.count = count;
ret = margo_forward(context->bench_handle, &bench_in); ret = margo_forward(context->bench_handle, &bench_in);
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
ret = margo_get_output(context->bench_handle, &bench_out); ret = margo_get_output(context->bench_handle, &bench_out);
......
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