swim-fd-internal.h 1.95 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
#include <abt.h>
#include <margo.h>

12 13 14 15
#ifdef __cplusplus
extern "C" {
#endif

16
/* SWIM protocol parameter defaults */
17 18 19 20 21 22 23 24 25 26
#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

/* internal swim context implementation */
struct swim_context
{
27 28 29
    margo_instance_id mid;
    /* void pointer to user group data */
    void *group_data;
30
    /* argobots pool for launching SWIM threads */
31 32 33 34 35 36 37
    ABT_pool swim_pool;
    /* swim protocol ULT handle */
    ABT_thread prot_thread;
    /* SWIM protocol parameters */
    double prot_period_len;
    int prot_susp_timeout;
    int prot_subgroup_sz;
38
    /* SWIM internal state */
39 40 41 42
    int shutdown_flag;
#if 0
    //ssg_member_id_t ping_target;
    //swim_member_inc_nr_t ping_target_inc_nr;
43 44
    int ping_target_acked;
    double dping_timeout;
45
    //ssg_member_id_t subgroup_members[SWIM_MAX_SUBGROUP_SIZE];
46 47 48
    /* current membership state */
    void *suspect_list;
    void *recent_update_list;
49 50 51 52 53 54 55 56 57 58 59
#endif
};

#if 0
typedef struct swim_member_update swim_member_update_t;

struct swim_member_update
{
    ssg_member_id_t id;
    swim_member_status_t status;
    swim_member_inc_nr_t inc_nr;
60 61
};

Shane Snyder's avatar
Shane Snyder committed
62
/* SWIM ping function prototypes */
63
void swim_register_ping_rpcs(
64
    ssg_group_t * g);
65
void swim_dping_send_ult(
66
    void * t_arg);
67
void swim_iping_send_ult(
68
    void * t_arg);
69

Shane Snyder's avatar
Shane Snyder committed
70 71
/* SWIM membership update function prototypes */
void swim_retrieve_membership_updates(
72 73
    ssg_group_t * g,
    swim_member_update_t * updates,
Shane Snyder's avatar
Shane Snyder committed
74 75
    int update_count);
void swim_apply_membership_updates(
76 77
    ssg_group_t * g,
    swim_member_update_t * updates,
Shane Snyder's avatar
Shane Snyder committed
78
    int update_count);
79
#endif
Shane Snyder's avatar
Shane Snyder committed
80

81 82 83
#ifdef __cplusplus
}
#endif