Commit ec8ef620 authored by Misbah Mubarak's avatar Misbah Mubarak

Merge branch 'nikhil/net-template' into 'master'

Template for new networks

See merge request !38
parents aa8ab8a8 d11b9210
......@@ -32,6 +32,7 @@ extern void free_tmp(void * ptr);
typedef struct message_list message_list;
struct message_list {
//CHANGE: add message types for new networks here
union {
terminal_message dfly_msg;
em_message em_msg;
......
......@@ -4,6 +4,7 @@
*
*/
//CHANGE: modify to match you header file name
#ifndef EXPRESS_MESH_H
#define EXPRESS_MESH_H
......@@ -13,76 +14,67 @@ extern "C" {
#include <ross.h>
//CHANGE: modify to match the struct
typedef struct net_message net_message;
//CHANGE: modify the struct name - add to message_list union in common-net.h
typedef struct em_message em_message;
struct em_message
{
/* magic number */
int magic;
/* 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];
/* 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;
tw_lpid sender_mn_lp; // source modelnet id
/* destination terminal ID */
tw_lpid dest_terminal_id;
int dest_terminal;
/* source terminal ID */
tw_lpid src_terminal_id;
short saved_channel;
short my_N_hop;
short hops[8];
//common entries:
int magic; /* magic number */
short type; /* event type of the flit */
/* Intermediate LP ID from which this message is coming */
unsigned int intm_lp_id;
short saved_vc;
short dim_change;
/* last hop of the message, can be a terminal, local router or global router */
int last_hop;
/* For routing */
uint64_t chunk_id;
uint64_t packet_size;
uint64_t message_id;
uint64_t total_size;
tw_stime travel_start_time; /* flit travel start time*/
unsigned long long packet_ID; /* packet ID of the flit */
char category[CATEGORY_NAME_MAX]; /* category: comes from codes */
int saved_remote_esize;
int remote_event_size_bytes;
int local_event_size_bytes;
tw_lpid final_dest_gid; /* final destination LP ID, this comes from codes can be a server or any other LP type*/
tw_lpid sender_lp; /*sending LP ID from CODES, can be a server or any other LP type */
tw_lpid sender_mn_lp; // source modelnet id (think NIC)
tw_lpid src_terminal_id; /* source terminal ID - mostly same as sender_mn_lp */
tw_lpid dest_terminal_id; /* destination modelnet id */
int dest_terminal; /* logical id of destination modelnet id */
// For buffer message
int vc_index;
int output_chan;
model_net_event_return event_rc;
/* packet/message identifier and status */
uint64_t chunk_id; //which chunk of packet I am
uint64_t packet_size; //what is the size of my packet
uint64_t message_id; //seq number at message level - NIC specified
uint64_t total_size; //total size of the message
int remote_event_size_bytes; // data size for target event at destination
int local_event_size_bytes; // data size for event at source
int is_pull;
uint64_t pull_size;
tw_stime msg_start_time;
/* for reverse computation */
//info for path traversal
short my_N_hop; /* hops traversed so far */
short hops[8]; /* can be used for storing different types of hops */
unsigned int intm_lp_id; /* Intermediate LP ID that sent this packet */
int last_hop; /* last hop of the message, can be a terminal, local router or global router */
int vc_index; /* stores port info */
int output_chan; /* virtual channel within port */
//info for reverse computation
short saved_channel;
short saved_vc;
model_net_event_return event_rc;
tw_stime saved_available_time;
tw_stime saved_avg_time;
tw_stime saved_rcv_time;
tw_stime saved_busy_time;
tw_stime saved_busy_time;
tw_stime saved_total_time;
tw_stime saved_hist_start_time;
tw_stime saved_sample_time;
tw_stime msg_start_time;
int saved_hist_num;
int saved_occupancy;
//CHANGE: info for specific networks
short dim_change;
};
#ifdef __cplusplus
}
#endif
#endif
#endif
/*
* Copyright (C) 2014 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
//CHANGE: modify to match you header file name
#ifndef NET_TEMPLATE_H
#define NET_TEMPLATE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <ross.h>
//CHANGE: modify to match the struct
typedef struct net_message net_message;
//CHANGE: modify the struct name - add to message_list union in common-net.h
struct net_message
{
//common entries:
int magic; /* magic number */
short type; /* event type of the flit */
tw_stime travel_start_time; /* flit travel start time*/
unsigned long long packet_ID; /* packet ID of the flit */
char category[CATEGORY_NAME_MAX]; /* category: comes from codes */
tw_lpid final_dest_gid; /* final destination LP ID, this comes from codes can be a server or any other LP type*/
tw_lpid sender_lp; /*sending LP ID from CODES, can be a server or any other LP type */
tw_lpid sender_mn_lp; // source modelnet id (think NIC)
tw_lpid src_terminal_id; /* source terminal ID - mostly same as sender_mn_lp */
tw_lpid dest_terminal_id; /* destination modelnet id */
int dest_terminal; /* logical id of destination modelnet id */
/* packet/message identifier and status */
uint64_t chunk_id; //which chunk of packet I am
uint64_t packet_size; //what is the size of my packet
uint64_t message_id; //seq number at message level - NIC specified
uint64_t total_size; //total size of the message
int remote_event_size_bytes; // data size for target event at destination
int local_event_size_bytes; // data size for event at source
int is_pull;
uint64_t pull_size;
tw_stime msg_start_time;
//info for path traversal
short my_N_hop; /* hops traversed so far */
short hops[8]; /* can be used for storing different types of hops */
unsigned int intm_lp_id; /* Intermediate LP ID that sent this packet */
int last_hop; /* last hop of the message, can be a terminal, local router or global router */
int vc_index; /* stores port info */
int output_chan; /* virtual channel within port */
//info for reverse computation
short saved_channel;
short saved_vc;
model_net_event_return event_rc;
tw_stime saved_available_time;
tw_stime saved_avg_time;
tw_stime saved_rcv_time;
tw_stime saved_busy_time;
tw_stime saved_total_time;
tw_stime saved_hist_start_time;
tw_stime saved_sample_time;
//CHANGE: add info for specific networks
};
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
This diff is collapsed.
......@@ -31,6 +31,7 @@ TESTS += tests/lp-io-test.sh \
tests/modelnet-test-torus.sh \
tests/modelnet-test-loggp.sh \
tests/modelnet-test-dragonfly.sh \
tests/modelnet-test-em.sh \
tests/modelnet-test-slimfly.sh \
tests/modelnet-test-dragonfly-synthetic.sh \
tests/modelnet-test-dragonfly-custom-synthetic.sh \
......@@ -66,6 +67,7 @@ EXTRA_DIST += tests/download-traces.sh \
tests/modelnet-test-dragonfly-traces.sh \
tests/modelnet-test-dragonfly-custom-synthetic.sh \
tests/modelnet-test-dragonfly-custom-traces.sh \
tests/modelnet-test-em.sh \
tests/modelnet-test-fattree-synthetic.sh \
tests/modelnet-test-slimfly.sh \
tests/modelnet-test-slimfly-synthetic.sh \
......
LPGROUPS
{
MODELNET_GRP
{
repetitions="64";
server="3";
modelnet_express_mesh="3";
modelnet_express_mesh_router="1";
}
}
PARAMS
{
message_size="512";
packet_size="4096";
chunk_size="4096";
modelnet_order=( "express_mesh", "express_mesh_router" );
#modelnet_scheduler="fcfs";
modelnet_scheduler="round-robin";
n_dims="3";
dim_length="4,4,4";
gap="1";
num_cn="3";
num_vcs="1";
link_bandwidth="12.5";
cn_bandwidth="12.5";
vc_size="65536";
cn_vc_size="65536";
routing="static";
soft_delay="0";
router_delay="90";
}
#!/bin/bash
tests/modelnet-test --sync=1 -- tests/conf/modelnet-test-em.conf
......@@ -187,8 +187,14 @@ int main(
{
strcpy(router_name, "slimfly_router");
}
if(net_id == EXPRESS_MESH)
{
strcpy(router_name, "modelnet_express_mesh_router");
}
if(net_id == SLIMFLY || net_id == DRAGONFLY)
if(net_id == SLIMFLY || net_id == DRAGONFLY || net_id == EXPRESS_MESH)
{
num_routers = codes_mapping_get_lp_count("MODELNET_GRP", 0,
router_name, NULL, 1);
......@@ -356,11 +362,8 @@ static void handle_kickoff_event(
int opt_offset = 0;
int total_lps = num_servers * 2 + num_routers;
if(net_id == DRAGONFLY && (lp->gid % lps_per_rep == num_servers_per_rep - 1))
opt_offset = num_servers_per_rep + num_routers_per_rep; /* optional offset due to dragonfly mapping */
if(net_id == SLIMFLY && (lp->gid % lps_per_rep == num_servers_per_rep -1))
opt_offset = num_servers_per_rep + num_routers_per_rep;
if((net_id == DRAGONFLY || net_id == SLIMFLY || net_id == EXPRESS_MESH) && (lp->gid % lps_per_rep == num_servers_per_rep - 1))
opt_offset = num_servers_per_rep + num_routers_per_rep;
/* each server sends a request to the next highest server */
int dest_id = (lp->gid + offset + opt_offset)%total_lps;
......@@ -451,12 +454,9 @@ static void handle_ack_event(
// printf("\n m->src %d lp->gid %d ", m->src, lp->gid);
int opt_offset = 0;
if(net_id == DRAGONFLY && (lp->gid % lps_per_rep == num_servers_per_rep - 1))
if((net_id == DRAGONFLY || net_id == SLIMFLY || net_id == EXPRESS_MESH) && (lp->gid % lps_per_rep == num_servers_per_rep - 1))
opt_offset = num_servers_per_rep + num_routers_per_rep; /* optional offset due to dragonfly mapping */
if(net_id == SLIMFLY && (lp->gid % lps_per_rep == num_servers_per_rep -1))
opt_offset = num_servers_per_rep + num_routers_per_rep;
tw_lpid dest_id = (lp->gid + offset + opt_offset)%(num_servers*2 + num_routers);
/* in the "pull" case, src should actually be self */
......@@ -512,12 +512,9 @@ static void handle_req_event(
// printf("\n m->src %d lp->gid %d ", m->src, lp->gid);
int opt_offset = 0;
if(net_id == DRAGONFLY && (m->src % lps_per_rep == num_servers_per_rep - 1))
if((net_id == DRAGONFLY || net_id == SLIMFLY || net_id == EXPRESS_MESH) && (m->src % lps_per_rep == num_servers_per_rep - 1))
opt_offset = num_servers_per_rep + num_routers_per_rep; /* optional offset due to dragonfly mapping */
if(net_id == SLIMFLY && (m->src % lps_per_rep == num_servers_per_rep -1))
opt_offset = num_servers_per_rep + num_routers_per_rep;
assert(lp->gid == (m->src + offset + opt_offset)%(num_servers*2 + num_routers));
ns->msg_recvd_count++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment