dragonfly.h 2.79 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 DRAGONFLY_H
#define DRAGONFLY_H

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

14 15
#include <ross.h>

16 17 18
void dragonfly_register_evcol();
void router_register_evcol();

19 20 21 22 23
typedef struct terminal_message terminal_message;

/* this message is used for both dragonfly compute nodes and routers */
struct terminal_message
{
24 25
  /* magic number */
  int magic;
26 27 28 29 30 31 32 33
  /* flit travel start time*/
  tw_stime travel_start_time;
 /* packet ID of the flit  */
  unsigned long long packet_ID;
  /* event type of the flit */
  short  type;
  /* category: comes from codes */
  char category[CATEGORY_NAME_MAX];
34 35 36 37

  /* store category hash in the event */
  uint32_t category_hash;

38 39 40 41
  /* final destination LP ID, this comes from codes can be a server or any other LP type*/
  tw_lpid final_dest_gid;
  /*sending LP ID from CODES, can be a server or any other LP type */
  tw_lpid sender_lp;
42
  tw_lpid sender_mn_lp; // source modelnet id
43
 /* destination terminal ID of the dragonfly */
44
  tw_lpid dest_terminal_id;
45 46
  /* source terminal ID of the dragonfly */
  unsigned int src_terminal_id;
47 48
  /* local LP ID to calculate the radix of the sender node/router */
  unsigned int local_id;
49 50 51
  /* message originating router id */
  unsigned int origin_router_id;

52 53
  /* number of hops traversed by the packet */
  short my_N_hop;
54 55 56
  short my_l_hop, my_g_hop;
  short saved_channel;

57 58
  /* Intermediate LP ID from which this message is coming */
  unsigned int intm_lp_id;
59
  short new_vc;
60
  short saved_vc;
61 62
  
  int saved_src_dest;
63
  /* last hop of the message, can be a terminal, local router or global router */
64
  int last_hop;
65 66
   /* For routing */
   int intm_group_id;
67
   uint64_t chunk_id;
68
   uint64_t packet_size;
69 70 71 72
   uint64_t message_id;
   uint64_t total_size;

   int saved_remote_esize;
73 74
   int remote_event_size_bytes;
   int local_event_size_bytes;
75

76
  // For buffer message
77
   int vc_index;
78
   int sender_radix;
79
   int output_chan;
80
   model_net_event_return event_rc;
81 82
   int is_pull;
   uint64_t pull_size;
83 84

   /* for reverse computation */   
85
   int path_type;
86
   tw_stime saved_available_time;
87
   tw_stime saved_avg_time;
88
   tw_stime saved_rcv_time;
89 90
   tw_stime saved_busy_time; 
   tw_stime saved_total_time;
91
   tw_stime saved_hist_start_time;
92
   tw_stime saved_sample_time;
93 94
   tw_stime msg_start_time;

95
   int saved_hist_num;
96
   int saved_occupancy;
97

98 99 100 101 102 103 104

   /* for reverse computation of a node's fan in*/
   int saved_fan_nodes;
   tw_lpid sender_svr;

  /* LP ID of the sending node, has to be a network node in the dragonfly */
   tw_lpid sender_node;
105
   tw_lpid next_stop;
106 107
};

Jonathan Jenkins's avatar
Jonathan Jenkins committed
108 109 110 111
#ifdef __cplusplus
}
#endif

112 113 114 115 116 117 118 119 120 121
#endif /* end of include guard: DRAGONFLY_H */

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