simplenet-upd.h 1.7 KB
Newer Older
1 2 3 4 5 6 7 8 9
/*
 * Copyright (C) 2014 University of Chicago.
 * See COPYRIGHT notice in top-level directory.
 *
 */

#ifndef SIMPLENET_UPD_H
#define SIMPLENET_UPD_H

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

14 15 16 17 18 19 20 21 22 23 24 25 26 27
typedef struct sn_message sn_message;

/* types of events that will constitute triton requests */
enum sn_event_type 
{
    SN_MSG_READY = 1,  /* sender has transmitted msg to receiver */
    SN_MSG_START,      /* initiate a transmission */
};

struct sn_message
{
    int magic; /* magic number */
    enum sn_event_type event_type;
    tw_lpid src_gid; /* who transmitted this msg? */
28
    tw_lpid src_mn_lp; // src modelnet id, provided by sender
29
    tw_lpid final_dest_gid; /* who is eventually targetted with this msg? */
30
    tw_lpid dest_mn_lp; // destination modelnet id, provided by sender
31 32 33 34
    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 */
35
    model_net_event_return event_rc;
36 37 38 39 40 41 42 43 44 45
    int is_pull; /* this message represents a pull request from the destination LP to the source */
    uint64_t pull_size; /* data size to pull from dest LP */

    /* for reverse computation */
    tw_stime net_send_next_idle_saved;
    tw_stime net_recv_next_idle_saved;
    tw_stime send_time_saved;
    tw_stime recv_time_saved;
};

Jonathan Jenkins's avatar
Jonathan Jenkins committed
46 47 48 49
#ifdef __cplusplus
}
#endif

50 51 52 53 54 55 56 57 58
#endif /* end of include guard: SIMPLENET_UPD_H */
/*
 * Local variables:
 *  c-indent-level: 4
 *  c-basic-offset: 4
 * End:
 *
 * vim: ft=c ts=8 sts=4 sw=4 expandtab
 */