swim-fd-internal.h 2.04 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
#include "swim-fd.h"

14 15 16 17
#ifdef __cplusplus
extern "C" {
#endif

18
/* SWIM protocol parameter defaults */
19 20 21 22 23 24 25 26 27 28
#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
{
29 30 31
    margo_instance_id mid;
    /* void pointer to user group data */
    void *group_data;
32 33
    /* XXX group mgmt callbacks */
    swim_group_mgmt_callbacks_t swim_callbacks;
34
    /* argobots pool for launching SWIM threads */
35 36 37 38 39 40 41
    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;
42
    /* SWIM internal state */
43
    int shutdown_flag;
44 45 46
    hg_addr_t dping_target_addr;
    swim_member_state_t dping_target_state;
    int dping_target_acked;
47
    double dping_timeout;
48 49
    hg_addr_t iping_subgroup_addrs[SWIM_MAX_SUBGROUP_SIZE];
#if 0
50 51 52
    /* current membership state */
    void *suspect_list;
    void *recent_update_list;
53 54 55 56 57 58 59 60 61 62 63
#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;
64 65
};

Shane Snyder's avatar
Shane Snyder committed
66
/* SWIM ping function prototypes */
67
void swim_register_ping_rpcs(
68
    ssg_group_t * g);
69
void swim_dping_send_ult(
70
    void * t_arg);
71
void swim_iping_send_ult(
72
    void * t_arg);
73

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

85 86 87
#ifdef __cplusplus
}
#endif