Commit 1db39f2d authored by Matthieu Dorier's avatar Matthieu Dorier

updated ssg.c to new Margo API

parent ebf4f8ea
......@@ -130,7 +130,6 @@ ssg_group_id_t ssg_group_create(
ssg_membership_update_cb update_cb,
void * update_cb_dat)
{
hg_class_t *hgcl = NULL;
hg_addr_t self_addr = HG_ADDR_NULL;
char *self_addr_str = NULL;
hg_size_t self_addr_str_size = 0;
......@@ -142,9 +141,6 @@ ssg_group_id_t ssg_group_create(
if (!ssg_inst) return group_id;
hgcl = margo_get_class(ssg_inst->mid);
if (!hgcl) return group_id;
/* generate a unique ID for this group */
tmp_descriptor = ssg_group_descriptor_create(group_name, group_addr_strs[0]);
if (tmp_descriptor == NULL) return group_id;
......@@ -159,13 +155,13 @@ ssg_group_id_t ssg_group_create(
}
/* get my address */
hret = HG_Addr_self(hgcl, &self_addr);
hret = margo_addr_self(ssg_inst->mid, &self_addr);
if (hret != HG_SUCCESS) goto fini;
hret = HG_Addr_to_string(hgcl, NULL, &self_addr_str_size, self_addr);
hret = margo_addr_to_string(ssg_inst->mid, NULL, &self_addr_str_size, self_addr);
if (hret != HG_SUCCESS) goto fini;
self_addr_str = malloc(self_addr_str_size);
if (self_addr_str == NULL) goto fini;
hret = HG_Addr_to_string(hgcl, self_addr_str, &self_addr_str_size, self_addr);
hret = margo_addr_to_string(ssg_inst->mid, self_addr_str, &self_addr_str_size, self_addr);
if (hret != HG_SUCCESS) goto fini;
/* allocate an SSG group data structure and initialize some of it */
......@@ -215,7 +211,7 @@ ssg_group_id_t ssg_group_create(
self_addr = HG_ADDR_NULL;
g = NULL;
fini:
if (hgcl && self_addr != HG_ADDR_NULL) HG_Addr_free(hgcl, self_addr);
if (self_addr != HG_ADDR_NULL) margo_addr_free(ssg_inst->mid, self_addr);
free(self_addr_str);
if (g)
{
......@@ -326,7 +322,6 @@ ssg_group_id_t ssg_group_create_mpi(
ssg_membership_update_cb update_cb,
void * update_cb_dat)
{
hg_class_t *hgcl = NULL;
hg_addr_t self_addr = HG_ADDR_NULL;
char *self_addr_str = NULL;
hg_size_t self_addr_str_size = 0;
......@@ -341,17 +336,14 @@ ssg_group_id_t ssg_group_create_mpi(
if (!ssg_inst) goto fini;
hgcl = margo_get_class(ssg_inst->mid);
if (!hgcl) goto fini;
/* get my address */
hret = HG_Addr_self(hgcl, &self_addr);
hret = margo_addr_self(ssg_inst->mid, &self_addr);
if (hret != HG_SUCCESS) goto fini;
hret = HG_Addr_to_string(hgcl, NULL, &self_addr_str_size, self_addr);
hret = margo_addr_to_string(ssg_inst->mid, NULL, &self_addr_str_size, self_addr);
if (hret != HG_SUCCESS) goto fini;
self_addr_str = malloc(self_addr_str_size);
if (self_addr_str == NULL) goto fini;
hret = HG_Addr_to_string(hgcl, self_addr_str, &self_addr_str_size, self_addr);
hret = margo_addr_to_string(ssg_inst->mid, self_addr_str, &self_addr_str_size, self_addr);
if (hret != HG_SUCCESS) goto fini;
self_addr_str_size_int = (int)self_addr_str_size; /* null char included in call */
......@@ -388,7 +380,7 @@ ssg_group_id_t ssg_group_create_mpi(
fini:
/* cleanup before returning */
if (hgcl && self_addr != HG_ADDR_NULL) HG_Addr_free(hgcl, self_addr);
if (self_addr != HG_ADDR_NULL) margo_addr_free(ssg_inst->mid, self_addr);
free(self_addr_str);
free(sizes);
free(sizes_psum);
......@@ -978,7 +970,7 @@ static void ssg_group_view_destroy(
for (i = 0; i < view->size; i++)
{
free(view->member_states[i].addr_str);
HG_Addr_free(margo_get_class(ssg_inst->mid), view->member_states[i].addr);
margo_addr_free(ssg_inst->mid, view->member_states[i].addr);
}
free(view->member_states);
......
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