Commit 8274da0d authored by Neil McGlohon's avatar Neil McGlohon
Browse files

Add DFDally work into its own model for merging

parent 312fb670
...@@ -24,6 +24,7 @@ extern "C" { ...@@ -24,6 +24,7 @@ extern "C" {
#include "net/dragonfly.h" #include "net/dragonfly.h"
#include "net/dragonfly-custom.h" #include "net/dragonfly-custom.h"
#include "net/dragonfly-plus.h" #include "net/dragonfly-plus.h"
#include "net/dragonfly-dally.h"
#include "net/slimfly.h" #include "net/slimfly.h"
#include "net/fattree.h" #include "net/fattree.h"
#include "net/loggp.h" #include "net/loggp.h"
...@@ -133,6 +134,7 @@ typedef struct model_net_wrap_msg { ...@@ -133,6 +134,7 @@ typedef struct model_net_wrap_msg {
terminal_message m_dfly; // dragonfly terminal_message m_dfly; // dragonfly
terminal_custom_message m_custom_dfly; // dragonfly-custom terminal_custom_message m_custom_dfly; // dragonfly-custom
terminal_plus_message m_dfly_plus; // dragonfly plus terminal_plus_message m_dfly_plus; // dragonfly plus
terminal_dally_message m_dally_dfly; // dragonfly dally
slim_terminal_message m_slim; // slimfly slim_terminal_message m_slim; // slimfly
fattree_message m_fat; // fattree fattree_message m_fat; // fattree
loggp_message m_loggp; // loggp loggp_message m_loggp; // loggp
......
...@@ -76,6 +76,8 @@ typedef struct mn_stats mn_stats; ...@@ -76,6 +76,8 @@ typedef struct mn_stats mn_stats;
X(EXPRESS_MESH_ROUTER, "modelnet_express_mesh_router", "express_mesh_router", &express_mesh_router_method)\ X(EXPRESS_MESH_ROUTER, "modelnet_express_mesh_router", "express_mesh_router", &express_mesh_router_method)\
X(DRAGONFLY_PLUS, "modelnet_dragonfly_plus", "dragonfly_plus", &dragonfly_plus_method)\ X(DRAGONFLY_PLUS, "modelnet_dragonfly_plus", "dragonfly_plus", &dragonfly_plus_method)\
X(DRAGONFLY_PLUS_ROUTER, "modelnet_dragonfly_plus_router", "dragonfly_plus_router", &dragonfly_plus_router_method)\ X(DRAGONFLY_PLUS_ROUTER, "modelnet_dragonfly_plus_router", "dragonfly_plus_router", &dragonfly_plus_router_method)\
X(DRAGONFLY_DALLY, "modelnet_dragonfly_dally", "dragonfly_dally", &dragonfly_dally_method)\
X(DRAGONFLY_DALLY_ROUTER, "modelnet_dragonfly_dally_router", "dragonfly_dally_router", &dragonfly_dally_router_method)\
X(MAX_NETS, NULL, NULL, NULL) X(MAX_NETS, NULL, NULL, NULL)
#define X(a,b,c,d) a, #define X(a,b,c,d) a,
......
/*
* Copyright (C) 2014 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#ifndef DRAGONFLY_DALLY_H
#define DRAGONFLY_DALLY_H
#ifdef __cplusplus
extern "C" {
#endif
#include <ross.h>
typedef struct terminal_dally_message terminal_dally_message;
/* this message is used for both dragonfly compute nodes and routers */
struct terminal_dally_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];
/* store category hash in the event */
uint32_t category_hash;
/* 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 of the dragonfly */
tw_lpid dest_terminal_id;
/* source terminal ID of the dragonfly */
unsigned int src_terminal_id;
/* message originating router id. MM: Can we calculate it through
* sender_mn_lp??*/
unsigned int origin_router_id;
/* number of hops traversed by the packet */
short my_N_hop;
short my_l_hop, my_g_hop;
short saved_channel;
short saved_vc;
int next_stop;
short nonmin_done;
/* Intermediate LP ID from which this message is coming */
unsigned int intm_lp_id;
/* last hop of the message, can be a terminal, local router or global router */
short last_hop;
/* For routing */
int intm_rtr_id;
int saved_src_dest;
int saved_src_chan;
uint32_t chunk_id;
uint32_t packet_size;
uint32_t message_id;
uint32_t total_size;
int remote_event_size_bytes;
int local_event_size_bytes;
// For buffer message
short vc_index;
int output_chan;
model_net_event_return event_rc;
int is_pull;
uint32_t pull_size;
int path_type;
/* for reverse computation */
short num_rngs;
short num_cll;
int qos_index;
short last_saved_qos;
short qos_reset1;
short qos_reset2;
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_sample_time;
tw_stime msg_start_time;
tw_stime saved_busy_time_ross;
tw_stime saved_fin_chunks_ross;
};
#ifdef __cplusplus
}
#endif
#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
*/
...@@ -94,6 +94,8 @@ nobase_include_HEADERS = \ ...@@ -94,6 +94,8 @@ nobase_include_HEADERS = \
codes/net/common-net.h \ codes/net/common-net.h \
codes/net/dragonfly.h \ codes/net/dragonfly.h \
codes/net/dragonfly-custom.h \ codes/net/dragonfly-custom.h \
codes/net/dragonfly-dally.h \
codes/net/dragonfly-plus.h \
codes/net/slimfly.h \ codes/net/slimfly.h \
codes/net/fattree.h \ codes/net/fattree.h \
codes/net/loggp.h \ codes/net/loggp.h \
...@@ -162,6 +164,7 @@ src_libcodes_la_SOURCES = \ ...@@ -162,6 +164,7 @@ src_libcodes_la_SOURCES = \
src/networks/model-net/dragonfly.c \ src/networks/model-net/dragonfly.c \
src/networks/model-net/dragonfly-custom.C \ src/networks/model-net/dragonfly-custom.C \
src/networks/model-net/dragonfly-plus.C \ src/networks/model-net/dragonfly-plus.C \
src/networks/model-net/dragonfly-dally.C \
src/networks/model-net/slimfly.c \ src/networks/model-net/slimfly.c \
src/networks/model-net/fattree.c \ src/networks/model-net/fattree.c \
src/networks/model-net/loggp.c \ src/networks/model-net/loggp.c \
...@@ -196,6 +199,7 @@ bin_PROGRAMS += src/network-workloads/model-net-synthetic-custom-dfly ...@@ -196,6 +199,7 @@ bin_PROGRAMS += src/network-workloads/model-net-synthetic-custom-dfly
bin_PROGRAMS += src/network-workloads/model-net-synthetic-slimfly bin_PROGRAMS += src/network-workloads/model-net-synthetic-slimfly
bin_PROGRAMS += src/network-workloads/model-net-synthetic-fattree bin_PROGRAMS += src/network-workloads/model-net-synthetic-fattree
bin_PROGRAMS += src/network-workloads/model-net-synthetic-dfly-plus bin_PROGRAMS += src/network-workloads/model-net-synthetic-dfly-plus
bin_PROGRAMS += src/network-workloads/model-net-synthetic-dally-dfly
src_workload_codes_workload_dump_SOURCES = \ src_workload_codes_workload_dump_SOURCES = \
...@@ -210,6 +214,7 @@ src_network_workloads_model_net_mpi_replay_CFLAGS = $(AM_CFLAGS) ...@@ -210,6 +214,7 @@ src_network_workloads_model_net_mpi_replay_CFLAGS = $(AM_CFLAGS)
src_network_workloads_model_net_synthetic_SOURCES = src/network-workloads/model-net-synthetic.c src_network_workloads_model_net_synthetic_SOURCES = src/network-workloads/model-net-synthetic.c
src_network_workloads_model_net_synthetic_custom_dfly_SOURCES = src/network-workloads/model-net-synthetic-custom-dfly.c src_network_workloads_model_net_synthetic_custom_dfly_SOURCES = src/network-workloads/model-net-synthetic-custom-dfly.c
src_network_workloads_model_net_synthetic_dfly_plus_SOURCES = src/network-workloads/model-net-synthetic-dfly-plus.c src_network_workloads_model_net_synthetic_dfly_plus_SOURCES = src/network-workloads/model-net-synthetic-dfly-plus.c
src_network_workloads_model_net_synthetic_dally_dfly_SOURCES = src/network-workloads/model-net-synthetic-dally-dfly.c
src_networks_model_net_topology_test_SOURCES = src/networks/model-net/topology-test.c src_networks_model_net_topology_test_SOURCES = src/networks/model-net/topology-test.c
#bin_PROGRAMS += src/network-workload/codes-nw-test #bin_PROGRAMS += src/network-workload/codes-nw-test
......
LPGROUPS
{
MODELNET_GRP
{
repetitions="1040";
# name of this lp changes according to the model
nw-lp="8";
# these lp names will be the same for dragonfly-custom model
modelnet_dragonfly_dally="8";
modelnet_dragonfly_dally_router="1";
}
}
PARAMS
{
adaptive_threshold="131072";
num_qos_levels="2";
qos_bandwidth="30,70";
minimal-bias="1";
df-dally-vc = "1";
# packet size in the network
packet_size="4096";
modelnet_order=( "dragonfly_dally","dragonfly_dally_router" );
# scheduler options
modelnet_scheduler="fcfs";
# chunk size in the network (when chunk size = packet size, packets will not be
# divided into chunks)
chunk_size="4096";
# modelnet_scheduler="round-robin";
num_router_rows="1";
# intra-group columns for routers
num_router_cols="16";
# number of groups in the network
num_groups="65";
# buffer size in bytes for local virtual channels
local_vc_size="16384";
#buffer size in bytes for global virtual channels
global_vc_size="16384";
#buffer size in bytes for compute node virtual channels
cn_vc_size="32768";
#bandwidth in GiB/s for local channels
local_bandwidth="2.0";
# bandwidth in GiB/s for global channels
global_bandwidth="2.0";
# bandwidth in GiB/s for compute node-router channels
cn_bandwidth="2.0";
# Number of row channels
num_row_chans="1";
# Number of column channels
num_col_chans="1";
# ROSS message size
message_size="656";
# number of compute nodes connected to router, dictated by dragonfly config
# file
num_cns_per_router="8";
# number of global channels per router
num_global_channels="8";
# network config file for intra-group connections
intra-group-connections="../src/network-workloads/conf/dragonfly-dally/dfdally_8k_intra";
# network config file for inter-group connections
inter-group-connections="../src/network-workloads/conf/dragonfly-dally/dfdally_8k_inter";
# routing protocol to be used
routing="prog-adaptive";
}
/*
* Copyright (C) 2015 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
/*
* The test program generates some synthetic traffic patterns for the model-net network models.
* currently it only support the dragonfly network model uniform random and nearest neighbor traffic patterns.
*/
#include "codes/model-net.h"
#include "codes/lp-io.h"
#include "codes/codes.h"
#include "codes/codes_mapping.h"
#include "codes/configuration.h"
#include "codes/lp-type-lookup.h"
static int net_id = 0;
static int traffic = 1;
static double arrival_time = 1000.0;
static int PAYLOAD_SZ = 2048;
/* whether to pull instead of push */
static int num_servers_per_rep = 0;
static int num_routers_per_grp = 0;
static int num_nodes_per_grp = 0;
static int num_nodes_per_cn = 0;
static int num_groups = 0;
static unsigned long long num_nodes = 0;
static char lp_io_dir[256] = {'\0'};
static lp_io_handle io_handle;
static unsigned int lp_io_use_suffix = 0;
static int do_lp_io = 0;
static int num_msgs = 20;
static tw_stime sampling_interval = 800000;
static tw_stime sampling_end_time = 1600000;
typedef struct svr_msg svr_msg;
typedef struct svr_state svr_state;
/* global variables for codes mapping */
static char group_name[MAX_NAME_LENGTH];
static char lp_type_name[MAX_NAME_LENGTH];
static int group_index, lp_type_index, rep_id, offset;
/* type of events */
enum svr_event
{
KICKOFF, /* kickoff event */
REMOTE, /* remote event */
LOCAL /* local event */
};
/* type of synthetic traffic */
enum TRAFFIC
{
UNIFORM = 1, /* sends message to a randomly selected node */
RAND_PERM = 2,
NEAREST_GROUP = 3, /* sends message to the node connected to the neighboring router */
NEAREST_NEIGHBOR = 4, /* sends message to the next node (potentially connected to the same router) */
RANDOM_OTHER_GROUP = 5
};
struct svr_state
{
int msg_sent_count; /* requests sent */
int msg_recvd_count; /* requests recvd */
int local_recvd_count; /* number of local messages received */
tw_stime start_ts; /* time that we started sending requests */
tw_stime end_ts; /* time that we ended sending requests */
int dest_id;
};
struct svr_msg
{
enum svr_event svr_event_type;
tw_lpid src; /* source of this request or ack */
int incremented_flag; /* helper for reverse computation */
model_net_event_return event_rc;
};
static void svr_init(
svr_state * ns,
tw_lp * lp);
static void svr_event(
svr_state * ns,
tw_bf * b,
svr_msg * m,
tw_lp * lp);
static void svr_rev_event(
svr_state * ns,
tw_bf * b,
svr_msg * m,
tw_lp * lp);
static void svr_finalize(
svr_state * ns,
tw_lp * lp);
tw_lptype svr_lp = {
(init_f) svr_init,
(pre_run_f) NULL,
(event_f) svr_event,
(revent_f) svr_rev_event,
(commit_f) NULL,
(final_f) svr_finalize,
(map_f) codes_mapping,
sizeof(svr_state),
};
// /* setup for the ROSS event tracing
// */
// void dally_svr_event_collect(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
// {
// (void)lp;
// (void)collect_flag;
// int type = (int) m->svr_event_type;
// memcpy(buffer, &type, sizeof(type));
// }
// /* can add in any model level data to be collected along with simulation engine data
// * in the ROSS instrumentation. Will need to update the last field in
// * svr_model_types[0] for the size of the data to save in each function call
// */
// void dally_svr_model_stat_collect(svr_state *s, tw_lp *lp, char *buffer)
// {
// (void)s;
// (void)lp;
// (void)buffer;
// return;
// }
// st_model_types dally_svr_model_types[] = {
// {(ev_trace_f) dally_svr_event_collect,
// sizeof(int),
// (model_stat_f) dally_svr_model_stat_collect,
// 0,
// NULL,
// NULL,
// 0},
// {NULL, 0, NULL, 0, NULL, NULL, 0}
// };
// static const st_model_types *dally_svr_get_model_stat_types(void)
// {
// return(&dally_svr_model_types[0]);
// }
// void dally_svr_register_model_types()
// {
// st_model_type_register("nw-lp", dally_svr_get_model_stat_types());
// }
const tw_optdef app_opt [] =
{
TWOPT_GROUP("Model net synthetic traffic " ),
TWOPT_UINT("traffic", traffic, "UNIFORM RANDOM=1, NEAREST NEIGHBOR=2 "),
TWOPT_UINT("num_messages", num_msgs, "Number of messages to be generated per terminal "),
TWOPT_UINT("payload_sz",PAYLOAD_SZ, "size of the message being sent "),
TWOPT_STIME("sampling-interval", sampling_interval, "the sampling interval "),
TWOPT_STIME("sampling-end-time", sampling_end_time, "sampling end time "),
TWOPT_STIME("arrival_time", arrival_time, "INTER-ARRIVAL TIME"),
TWOPT_CHAR("lp-io-dir", lp_io_dir, "Where to place io output (unspecified -> no output"),
TWOPT_UINT("lp-io-use-suffix", lp_io_use_suffix, "Whether to append uniq suffix to lp-io directory (default 0)"),
TWOPT_END()
};
const tw_lptype* svr_get_lp_type()
{
return(&svr_lp);
}
static void svr_add_lp_type()
{
lp_type_register("nw-lp", svr_get_lp_type());
}
static void issue_event(
svr_state * ns,
tw_lp * lp)
{
(void)ns;
tw_event *e;
svr_msg *m;
tw_stime kickoff_time;
/* each server sends a dummy event to itself that will kick off the real
* simulation
*/
/* skew each kickoff event slightly to help avoid event ties later on */
kickoff_time = 1.1 * g_tw_lookahead + tw_rand_exponential(lp->rng, arrival_time);
e = tw_event_new(lp->gid, kickoff_time, lp);
m = tw_event_data(e);
m->svr_event_type = KICKOFF;
tw_event_send(e);
}
static void svr_init(
svr_state * ns,
tw_lp * lp)
{
ns->start_ts = 0.0;
ns->dest_id = -1;
issue_event(ns, lp);
return;
}
static void handle_kickoff_rev_event(
svr_state * ns,
tw_bf * b,
svr_msg * m,
tw_lp * lp)
{
if(m->incremented_flag)
return;
if(b->c1)
tw_rand_reverse_unif(lp->rng);
if(b->c8)
tw_rand_reverse_unif(lp->rng);
if(traffic == RANDOM_OTHER_GROUP) {
tw_rand_reverse_unif(lp->rng);
tw_rand_reverse_unif(lp->rng);
}
model_net_event_rc2(lp, &m->event_rc);
ns->msg_sent_count--;
tw_rand_reverse_unif(lp->rng);
}
static void handle_kickoff_event(
svr_state * ns,
tw_bf * b,
svr_msg * m,
tw_lp * lp)
{
if(ns->msg_sent_count >= num_msgs)
{
m->incremented_flag = 1;
return;
}
m->incremented_flag = 0;
char anno[MAX_NAME_LENGTH];
tw_lpid local_dest = -1, global_dest = -1;
svr_msg * m_local = malloc(sizeof(svr_msg));
svr_msg * m_remote = malloc(sizeof(svr_msg));
m_local->svr_event_type = LOCAL;
m_local->src = lp->gid;
memcpy(m_remote, m_local, sizeof(svr_msg));
m_remote->svr_event_type = REMOTE;
assert(net_id == DRAGONFLY || net_id == DRAGONFLY_DALLY); /* only supported for dragonfly model right now. */
ns->start_ts = tw_now(lp);
codes_mapping_get_lp_info(lp->gid, group_name, &group_index, lp_type_name, &lp_type_index, anno, &rep_id, &offset);
int local_id = codes_mapping_get_lp_relative_id(lp->gid, 0, 0);
/* in case of uniform random traffic, send to a random destination. */
if(traffic == UNIFORM)
{
b->c1 = 1;
local_dest = tw_rand_integer(lp->rng, 0, num_nodes - 1);
}
else if(traffic == NEAREST_GROUP)
{
local_dest = (local_id + num_nodes_per_grp) % num_nodes;
//printf("\n LP %ld sending to %ld num nodes %d ", local_id, local_dest, num_nodes);
}
else if(traffic == NEAREST_NEIGHBOR)
{
local_dest = (local_id + 1) % num_nodes;
// printf("\n LP %ld sending to %ld num nodes %d ", rep_id * 2 + offset, local_dest, num_nodes);
}
else if(traffic == RAND_PERM)
{
if(ns->dest_id == -1)
{
b->c8 = 1;
ns->dest_id = tw_rand_integer(lp->rng, 0, num_nodes - 1);
local_dest = ns->dest_id;
}
else
{
local_dest = ns->dest_id;
}
}
else if(traffic == RANDOM_OTHER_GROUP)
{
int my_group_id = local_id / num_nodes_per_grp;
int other_groups[num_groups-1];
int added =0;
for(int i = 0; i < num_groups; i++)
{
if(i != my_group_id) {
other_groups[added] = i;
added++;
}
}
int rand_group = other_groups[tw_rand_integer(lp->rng,0,added -1)];
int rand_node_intra_id = tw_rand_integer(lp->rng, 0, num_nodes_per_grp-1);
local_dest = (rand_group * num_nodes_per_grp) + rand_node_intra_id;
printf("\n LP %ld sending to %ld num nodes %d ", local_id, local_dest, num_nodes);
}
assert(local_dest < num_nodes);
// codes_mapping_get_lp_id(group_name, lp_type_name, anno, 1, local_dest / num_servers_per_rep, local_dest % num_servers_per_rep, &global_dest);
global_dest = codes_mapping_get_lpid_from_relative(local_dest, group_name, lp_type_name, NULL, 0);
ns->msg_sent_count++;
m->event_rc = model_net_event(net_id, "test", global_dest, PAYLOAD_SZ, 0.0, sizeof(svr_msg), (const void*)m_remote, sizeof(svr_msg), (const void*)m_local, lp);
issue_event(ns, lp);
return;
}
static void handle_remote_rev_event(
svr_state * ns,
tw_bf * b,
svr_msg * m,
tw_lp * lp)
{
(void)b;
(void)m;
(void)lp;
ns->msg_recvd_count--;
}
static void handle_remote_event(
svr_state * ns,
tw_bf * b,
svr_msg * m,
tw_lp * lp)
{
(void)b;
(void)m;