Commit 9e4401b7 authored by Shane Snyder's avatar Shane Snyder
Browse files

update source/tests for new margo api changes

parent ab704b3f
......@@ -108,7 +108,7 @@ int ssg_group_attach_send(
/* send an attach request to the given group member address */
memcpy(&attach_req.group_descriptor, group_descriptor, sizeof(*group_descriptor));
attach_req.bulk_handle = bulk_handle;
hret = margo_forward(ssg_inst->mid, handle, &attach_req);
hret = margo_forward(handle, &attach_req);
if (hret != HG_SUCCESS) goto fini;
hret = margo_get_output(handle, &attach_resp);
......@@ -133,7 +133,7 @@ int ssg_group_attach_send(
if (hret != HG_SUCCESS) goto fini;
attach_req.bulk_handle = bulk_handle;
hret = margo_forward(ssg_inst->mid, handle, &attach_req);
hret = margo_forward(handle, &attach_req);
if (hret != HG_SUCCESS) goto fini;
margo_free_output(handle, &attach_resp);
......@@ -163,7 +163,7 @@ int ssg_group_attach_send(
sret = SSG_SUCCESS;
fini:
if (member_addr != HG_ADDR_NULL) margo_addr_free(ssg_inst->mid, member_addr);
if (handle != HG_HANDLE_NULL) margo_destroy(ssg_inst->mid, handle);
if (handle != HG_HANDLE_NULL) margo_destroy(handle);
if (bulk_handle != HG_BULK_NULL) margo_bulk_free(bulk_handle);
free(tmp_view_buf);
......@@ -233,12 +233,12 @@ static void ssg_group_attach_recv_ult(
attach_resp.group_name = g->name;
attach_resp.group_size = (int)g->view.size;
attach_resp.view_buf_size = view_buf_size;
margo_respond(ssg_inst->mid, handle, &attach_resp);
margo_respond(handle, &attach_resp);
margo_free_input(handle, &attach_req);
fini:
free(view_buf); /* TODO: cache this */
if (handle != HG_HANDLE_NULL) margo_destroy(ssg_inst->mid, handle);
if (handle != HG_HANDLE_NULL) margo_destroy(handle);
if (bulk_handle != HG_BULK_NULL) margo_bulk_free(bulk_handle);
return;
......
......@@ -144,7 +144,7 @@ static int swim_send_dping(
swim_pack_message(g, &(dping_req.msg));
/* send a direct ping that expires at the end of the protocol period */
hret = margo_forward_timed(ssg_inst->mid, handle, &dping_req,
hret = margo_forward_timed(handle, &dping_req,
swim_ctx->prot_period_len);
if (hret == HG_SUCCESS)
{
......@@ -166,7 +166,7 @@ static int swim_send_dping(
}
fini:
margo_destroy(ssg_inst->mid, handle);
margo_destroy(handle);
return(ret);
}
......@@ -198,11 +198,11 @@ static void swim_dping_recv_ult(hg_handle_t handle)
SSG_DEBUG(g, "SWIM: send dping ack to %d\n", (int)dping_req.msg.source_id);
/* respond to sender of the dping req */
margo_respond(ssg_inst->mid, handle, &dping_resp);
margo_respond(handle, &dping_resp);
margo_free_input(handle, &dping_req);
fini:
margo_destroy(ssg_inst->mid, handle);
margo_destroy(handle);
return;
}
DEFINE_MARGO_RPC_HANDLER(swim_dping_recv_ult)
......@@ -261,7 +261,7 @@ void swim_iping_send_ult(
* the dping timeout, which should cause this iping to timeout
* right at the end of the current protocol period.
*/
hret = margo_forward_timed(ssg_inst->mid, handle, &iping_req,
hret = margo_forward_timed(handle, &iping_req,
(swim_ctx->prot_period_len - swim_ctx->dping_timeout));
if (hret == HG_SUCCESS)
{
......@@ -290,7 +290,7 @@ void swim_iping_send_ult(
}
fini:
margo_destroy(ssg_inst->mid, handle);
margo_destroy(handle);
return;
}
......@@ -331,12 +331,12 @@ static void swim_iping_recv_ult(hg_handle_t handle)
(int)iping_req.msg.source_id, (int)iping_req.target_id);
/* respond to sender of the iping req */
margo_respond(ssg_inst->mid, handle, &iping_resp);
margo_respond(handle, &iping_resp);
}
margo_free_input(handle, &iping_req);
fini:
margo_destroy(ssg_inst->mid, handle);
margo_destroy(handle);
return;
}
DEFINE_MARGO_RPC_HANDLER(swim_iping_recv_ult)
......
......@@ -313,13 +313,8 @@ static void usage(void)
/* service a remote RPC for a no-op */
static void noop_ult(hg_handle_t handle)
{
margo_instance_id mid;
mid = margo_hg_handle_get_instance(handle);
assert(mid);
margo_respond(mid, handle, NULL);
margo_destroy(mid, handle);
margo_respond(handle, NULL);
margo_destroy(handle);
rpcs_serviced++;
if(rpcs_serviced == g_opts.iterations)
......@@ -352,13 +347,13 @@ static int run_benchmark(int iterations, hg_id_t id, ssg_member_id_t target,
for(i=0; i<iterations; i++)
{
tm1 = ABT_get_wtime();
ret = margo_forward(mid, handle, NULL);
ret = margo_forward(handle, NULL);
tm2 = ABT_get_wtime();
assert(ret == 0);
measurement_array[i] = tm2-tm1;
}
margo_destroy(mid, handle);
margo_destroy(handle);
return(0);
}
......
......@@ -164,10 +164,10 @@ int main(int argc, char *argv[])
DIE_IF(hret != HG_SUCCESS, "margo_addr_lookup");
hret = margo_create(mid, attacher_addr, group_id_forward_rpc_id, &handle);
DIE_IF(hret != HG_SUCCESS, "margo_create");
hret = margo_forward(mid, handle, &g_id);
hret = margo_forward(handle, &g_id);
DIE_IF(hret != HG_SUCCESS, "margo_forward");
margo_addr_free(mid, attacher_addr);
margo_destroy(mid, handle);
margo_destroy(handle);
}
}
else
......@@ -243,10 +243,10 @@ static void group_id_forward_recv_ult(hg_handle_t handle)
*g_id_p = ssg_group_id_dup(tmp_g_id);
margo_respond(mid, handle, NULL);
margo_respond(handle, NULL);
margo_free_input(handle, &tmp_g_id);
margo_destroy(mid, handle);
margo_destroy(handle);
return;
}
DEFINE_MARGO_RPC_HANDLER(group_id_forward_recv_ult)
......
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