simplep2p.h 1.85 KB
Newer Older
1 2 3 4 5 6
/*
 * Copyright (C) 2014 University of Chicago.
 * See COPYRIGHT notice in top-level directory.
 *
 */

7 8
#ifndef SIMPLEP2P_H
#define SIMPLEP2P_H
9

Jonathan Jenkins's avatar
Jonathan Jenkins committed
10 11 12 13
#ifdef __cplusplus
extern "C" {
#endif

14
typedef struct sp_message sp_message;
15

16
enum sp_event_type 
17
{
18 19
    SP_MSG_READY = 1,  /* sender has transmitted msg to receiver */
    SP_MSG_START,      /* initiate a transmission */
20 21
};

22
struct sp_message
23 24
{
    int magic; /* magic number */
25
    enum sp_event_type event_type;
26
    tw_lpid src_gid; /* who transmitted this msg? */
27
    tw_lpid src_mn_lp; // src modelnet id, provided by sender
28
    tw_lpid final_dest_gid; /* who is eventually targetted with this msg? */
29
    tw_lpid dest_mn_lp; // destination modelnet id, provided by sender
30
    /* relative ID of the sending simplep2p message (for latency/bandwidth lookup) */
31 32 33 34 35 36 37
    int src_mn_rel_id;
    int dest_mn_rel_id; /* included to make rc easier */
    uint64_t net_msg_size_bytes;     /* size of modeled network message */
    int event_size_bytes;     /* size of simulator event message that will be tunnelled to destination */
    int local_event_size_bytes;     /* size of simulator event message that delivered locally upon local completion */
    char category[CATEGORY_NAME_MAX]; /* category for communication */
    
38
    model_net_event_return event_rc;
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
    int is_pull;
    uint64_t pull_size; 

    /* for reverse computation */
    // TODO: clean up
    tw_stime send_next_idle_saved;
    tw_stime recv_next_idle_saved;
    tw_stime send_time_saved;
    tw_stime recv_time_saved;
    tw_stime send_next_idle_all_saved;
    tw_stime send_prev_idle_all_saved;
    tw_stime recv_next_idle_all_saved;
    tw_stime recv_prev_idle_all_saved;
};

Jonathan Jenkins's avatar
Jonathan Jenkins committed
54 55 56 57
#ifdef __cplusplus
}
#endif

58
#endif /* end of include guard: SIMPLEP2P_H */
59 60 61 62 63 64 65 66 67 68

/*
 * Local variables:
 *  c-indent-level: 4
 *  c-basic-offset: 4
 * End:
 *
 * vim: ft=c ts=8 sts=4 sw=4 expandtab
 */