swim-fd-internal.h 1.31 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 13 14 15 16 17 18 19 20 21

#ifdef __cplusplus
extern "C" {
#endif

#include <ssg.h>

#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

22 23
typedef uint32_t swim_inc_nr_t;

24 25 26 27 28 29
/* internal swim context implementation */
struct swim_context
{
    /* argobots pool for launching SWIM threads */
    ABT_pool prot_pool;
    /* SWIM internal state */
30
    int ping_target;
31
    swim_inc_nr_t ping_target_inc_nr;
32 33
    int ping_target_acked;
    double dping_timeout;
34
    int subgroup_members[SWIM_MAX_SUBGROUP_SIZE];
35 36
    int shutdown_flag;
    /* current membership state */
37
    swim_inc_nr_t *member_inc_nrs;
38 39 40 41 42 43 44 45 46 47 48
    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;
};

void swim_register_ping_rpcs(
49
    ssg_t s);
50 51 52 53 54 55 56 57 58 59

void swim_dping_send_ult(
    void *t_arg);

void swim_iping_send_ult(
    void *t_arg);

#ifdef __cplusplus
}
#endif