GitLab maintenance scheduled for Tomorrow, 2020-01-30, from 17:00 to 18:00 CT - Services will be unavailable during this time.

torus.h 2.41 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
  /* message saved collective time */
  tw_stime saved_collective_init_time;
36 37 38 39

  /* for saving recv and total times*/
  tw_stime saved_recv_time;
  tw_stime saved_total_time;
40
  tw_stime saved_busy_time;
41

42 43 44 45 46 47
  /* packet ID */
  unsigned long long packet_ID;
  /* event type of the message */
  nodes_event_t	 type;

  /* for reverse computation */
48
  int saved_channel;
49 50 51 52 53 54 55 56

  /* 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;
57 58 59 60 61 62
  /* 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;
63 64 65 66 67 68 69 70 71 72 73

  /* 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;
74 75 76 77

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

78 79 80
  int source_channel;

  int saved_queue;
81
  /* chunk id of the flit (distinguishes flits) */
82
  uint64_t chunk_id;
83

84
  model_net_event_return event_rc;
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
  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
 */