torus.h 2.23 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * Copyright (C) 2014 University of Chicago.
 * See COPYRIGHT notice in top-level directory.
 *
 */

#ifndef TORUS_H
#define TORUS_H

typedef enum nodes_event_t nodes_event_t;
typedef struct nodes_message nodes_message;

/* event type of each torus message, can be packet generate, flit arrival, flit send or credit */
enum nodes_event_t
{
  GENERATE = 1,
  ARRIVAL, 
  SEND,
  CREDIT,
20
21
22
  T_COLLECTIVE_INIT,
  T_COLLECTIVE_FAN_IN,
  T_COLLECTIVE_FAN_OUT  
23
24
25
26
27
28
29
30
31
32
33
};

struct nodes_message
{
  /* category: comes from codes message */
  char category[CATEGORY_NAME_MAX];
  /* time the packet was generated */
  tw_stime travel_start_time;
  /* for reverse event computation*/
  tw_stime saved_available_time;

34
35
36
  /* message saved collective time */
  tw_stime saved_collective_init_time;
  
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  /* packet ID */
  unsigned long long packet_ID;
  /* event type of the message */
  nodes_event_t	 type;

  /* for reverse computation */
  int saved_src_dim;
  int saved_src_dir;

  /* coordinates of the destination torus nodes */
  int* dest;

  /* final destination LP ID, comes from codes, can be a server or any other I/O LP type */
  tw_lpid final_dest_gid;
  /* destination torus node of the message */
  tw_lpid dest_lp;
53
54
55
56
57
58
  /* LP ID of the sender, comes from codes, can be a server or any other I/O LP type. Should not change
     during network operations. */
  tw_lpid sender_svr;

  /* LP ID of the sending node, has to be a network node in the torus */
  tw_lpid sender_node;
59
60
61
62
63
64
65
66
67
68
69

  /* number of hops traversed by the packet */
  int my_N_hop;
  /* source dimension of the message */
  int source_dim;
  /* source direction of the message */
  int source_direction;
  /* next torus hop that the packet will traverse */
  int next_stop;
  /* size of the torus packet */
  uint64_t packet_size;
70
71
72
73

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

74
  /* chunk id of the flit (distinguishes flits) */
75
  int chunk_id;
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

  int is_pull;
  uint64_t pull_size;

  /* for codes local and remote events, only carried by the last packet of the message */
  int local_event_size_bytes;
  int remote_event_size_bytes;
};

#endif /* end of include guard: TORUS_H */

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