Commit 795e4c82 authored by Shane Snyder's avatar Shane Snyder

most of swim refactoring complete

parent 66416549
......@@ -139,7 +139,7 @@ static void ssg_get_swim_member_addr(
static void ssg_get_swim_member_state(
void *group_data,
swim_member_id_t id,
swim_member_state_t *state);
swim_member_state_t **state);
static void ssg_gen_rand_member_list(
ssg_group_t *g);
......@@ -216,7 +216,7 @@ static void ssg_get_swim_member_addr(
static void ssg_get_swim_member_state(
void *group_data,
swim_member_id_t id,
swim_member_state_t *state)
swim_member_state_t **state)
{
ssg_group_t *g = (ssg_group_t *)group_data;
ssg_member_id_t ssg_id = (ssg_member_id_t)id;
......@@ -227,7 +227,7 @@ static void ssg_get_swim_member_state(
HASH_FIND(hh, g->view.member_map, &ssg_id, sizeof(ssg_member_id_t), ms);
/* XXX ASSERT */
*state = ms->swim_state;
*state = &ms->swim_state;
return;
}
......
......@@ -58,6 +58,8 @@ struct swim_context
int ping_target_acked;
/* argobots pool for launching SWIM threads */
ABT_pool swim_pool;
/* mutex for modifying SWIM group state */
ABT_mutex swim_mutex;
/* swim protocol ULT handle */
ABT_thread prot_thread;
/* SWIM protocol parameters */
......@@ -66,9 +68,7 @@ struct swim_context
int prot_subgroup_sz;
/* current membership state */
void *suspect_list;
#if 0
void *recent_update_list;
#endif
/* XXX */
int shutdown_flag;
};
......@@ -88,17 +88,15 @@ void swim_dping_send_ult(
void swim_iping_send_ult(
void * t_arg);
#if 0
/* SWIM membership update function prototypes */
void swim_retrieve_membership_updates(
ssg_group_t * g,
swim_member_update_t * updates,
int update_count);
swim_context_t *swim_ctx,
swim_member_update_t *updates,
hg_size_t *update_count);
void swim_apply_membership_updates(
ssg_group_t * g,
swim_member_update_t * updates,
int update_count);
#endif
swim_context_t *swim_ctx,
swim_member_update_t *updates,
hg_size_t update_count);
#ifdef __cplusplus
}
......
......@@ -31,6 +31,7 @@ typedef struct swim_message_s
{
swim_member_id_t source_id;
swim_member_inc_nr_t source_inc_nr;
hg_size_t pb_buf_count;
swim_member_update_t pb_buf[SWIM_MAX_PIGGYBACK_ENTRIES]; //TODO: dynamic array?
} swim_message_t;
......@@ -342,28 +343,25 @@ static void swim_pack_message(swim_context_t *swim_ctx, swim_message_t *msg)
msg->source_id = swim_ctx->self_id;
msg->source_inc_nr = swim_ctx->self_inc_nr;
#if 0
/* piggyback a set of membership states on this message */
swim_retrieve_membership_updates(g, msg->pb_buf, SWIM_MAX_PIGGYBACK_ENTRIES);
#endif
msg->pb_buf_count = SWIM_MAX_PIGGYBACK_ENTRIES;
swim_retrieve_membership_updates(swim_ctx, msg->pb_buf, &msg->pb_buf_count);
return;
}
static void swim_unpack_message(swim_context_t *swim_ctx, swim_message_t *msg)
{
#if 0
swim_member_update_t sender_update;
/* apply (implicit) sender update */
sender_update.id = msg->source_id;
sender_update.status = SWIM_MEMBER_ALIVE;
sender_update.inc_nr = msg->source_inc_nr;
swim_apply_membership_updates(g, &sender_update, 1);
swim_apply_membership_updates(swim_ctx, &sender_update, 1);
/* update membership status using piggybacked membership updates */
swim_apply_membership_updates(g, msg->pb_buf, SWIM_MAX_PIGGYBACK_ENTRIES);
#endif
swim_apply_membership_updates(swim_ctx, msg->pb_buf, msg->pb_buf_count);
return;
}
......
This diff is collapsed.
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