swim-fd-internal.h 1.83 KB
Newer Older
1
/*
Shane Snyder's avatar
Shane Snyder committed
2 3
 * Copyright (c) 2016 UChicago Argonne, LLC
 *
4 5 6
 * See COPYRIGHT in top-level directory.
 */

Shane Snyder's avatar
Shane Snyder committed
7
#pragma once
8 9 10 11 12

#ifdef __cplusplus
extern "C" {
#endif

13
/* SWIM protocol parameter defaults */
14 15 16 17 18 19 20
#define SWIM_DEF_PROTOCOL_PERIOD_LEN    2000.0  /* milliseconds */
#define SWIM_DEF_SUSPECT_TIMEOUT        5       /* protocol period lengths */
#define SWIM_DEF_SUBGROUP_SIZE          2
#define SWIM_MAX_SUBGROUP_SIZE          5
#define SWIM_MAX_PIGGYBACK_ENTRIES      8
#define SWIM_MAX_PIGGYBACK_TX_COUNT     50

Shane Snyder's avatar
Shane Snyder committed
21 22 23 24
typedef struct swim_member_update swim_member_update_t;

struct swim_member_update
{
25
    ssg_member_id_t id;
Shane Snyder's avatar
Shane Snyder committed
26 27 28
    swim_member_status_t status;
    swim_member_inc_nr_t inc_nr;
};
29

30 31 32 33 34 35
/* internal swim context implementation */
struct swim_context
{
    /* argobots pool for launching SWIM threads */
    ABT_pool prot_pool;
    /* SWIM internal state */
36
    ssg_member_id_t ping_target;
Shane Snyder's avatar
Shane Snyder committed
37
    swim_member_inc_nr_t ping_target_inc_nr;
38 39
    int ping_target_acked;
    double dping_timeout;
40
    ssg_member_id_t subgroup_members[SWIM_MAX_SUBGROUP_SIZE];
41 42
    int shutdown_flag;
    /* current membership state */
Shane Snyder's avatar
Shane Snyder committed
43
    swim_member_inc_nr_t *member_inc_nrs;
44 45 46 47 48 49 50 51 52 53
    void *suspect_list;
    void *recent_update_list;
    /* SWIM protocol parameters */
    double prot_period_len;
    int prot_susp_timeout;
    int prot_subgroup_sz;
    /* swim protocol ULT handle */
    ABT_thread prot_thread;
};

Shane Snyder's avatar
Shane Snyder committed
54
/* SWIM ping function prototypes */
55
void swim_register_ping_rpcs(
56
    ssg_group_t * g);
57
void swim_dping_send_ult(
58
    void * t_arg);
59
void swim_iping_send_ult(
60
    void * t_arg);
61

Shane Snyder's avatar
Shane Snyder committed
62 63
/* SWIM membership update function prototypes */
void swim_retrieve_membership_updates(
64 65
    ssg_group_t * g,
    swim_member_update_t * updates,
Shane Snyder's avatar
Shane Snyder committed
66 67
    int update_count);
void swim_apply_membership_updates(
68 69
    ssg_group_t * g,
    swim_member_update_t * updates,
Shane Snyder's avatar
Shane Snyder committed
70 71
    int update_count);

72 73 74
#ifdef __cplusplus
}
#endif