...
 
Commits (5)
......@@ -41,6 +41,8 @@ include $(top_srcdir)/src/Makefile.subdir
include $(top_srcdir)/tests/Makefile.subdir
include $(top_srcdir)/doc/Makefile.subdir
LDADD += -lcgraph
if USE_DEBUG
AM_CPPFLAGS += -g
AM_CFLAGS += -g
......
......@@ -31,6 +31,7 @@ extern "C" {
#include "net/simplep2p.h"
#include "net/torus.h"
#include "net/express-mesh.h"
#include "net/network-graph.h"
extern int model_net_base_magic;
......@@ -140,6 +141,7 @@ typedef struct model_net_wrap_msg {
sp_message m_sp2p; // simplep2p
nodes_message m_torus; // torus
em_message m_em; // express-mesh
network_graph_message m_ng; // express-mesh
// add new ones here
} msg;
} model_net_wrap_msg;
......
......@@ -74,6 +74,8 @@ typedef struct mn_stats mn_stats;
X(LOGGP, "modelnet_loggp", "loggp", &loggp_method)\
X(EXPRESS_MESH, "modelnet_express_mesh", "express_mesh", &express_mesh_method)\
X(EXPRESS_MESH_ROUTER, "modelnet_express_mesh_router", "express_mesh_router", &express_mesh_router_method)\
X(NETWORK_GRAPH, "modelnet_network_graph", "network_graph", &network_graph_method)\
X(NETWORK_GRAPH_ROUTER, "modelnet_network_graph_router", "network_graph_router", &network_graph_router_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(MAX_NETS, NULL, NULL, NULL)
......
......@@ -36,6 +36,7 @@ struct message_list {
union {
terminal_message dfly_msg;
em_message em_msg;
network_graph_message net_graph_msg;
};
char* event_data;
message_list *next;
......
/*
* Copyright (C) 2014 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
//CHANGE: modify to match you header file name
#ifndef NETWORK_GRAPH_H
#define NETWORK_GRAPH_H
#ifdef __cplusplus
extern "C" {
#endif
#include <ross.h>
//CHANGE: modify to match the struct
typedef struct network_graph_message network_graph_message;
//CHANGE: modify the struct name - add to message_list union in common-net.h
struct network_graph_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 */
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_vc;
short saved_port;
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;
};
#ifdef __cplusplus
}
#endif
#endif
......@@ -99,6 +99,7 @@ nobase_include_HEADERS = \
codes/net/slimfly.h \
codes/net/fattree.h \
codes/net/loggp.h \
codes/net/network-graph.h \
codes/net/simplenet-upd.h \
codes/net/simplep2p.h \
codes/net/express-mesh.h \
......@@ -166,6 +167,7 @@ src_libcodes_la_SOURCES = \
src/networks/model-net/dragonfly-plus.C \
src/networks/model-net/slimfly.c \
src/networks/model-net/fattree.c \
src/networks/model-net/network-graph.c \
src/networks/model-net/loggp.c \
src/networks/model-net/simplep2p.c \
src/networks/model-net/model-net-lp.c \
......
......@@ -73,6 +73,9 @@ typedef struct model_net_base_state {
static void model_net_base_lp_init(
model_net_base_state * ns,
tw_lp * lp);
static void model_net_base_prerun(
model_net_base_state * ns,
tw_lp * lp);
static void model_net_base_event(
model_net_base_state * ns,
tw_bf * b,
......@@ -112,7 +115,7 @@ static void handle_sched_next_rc(
/* ROSS function pointer table for this LP */
tw_lptype model_net_base_lp = {
(init_f) model_net_base_lp_init,
(pre_run_f) NULL,
(pre_run_f) model_net_base_prerun,
(event_f) model_net_base_event,
(revent_f) model_net_base_event_rc,
(commit_f) NULL,
......@@ -385,6 +388,10 @@ void model_net_base_configure(){
offsetof(model_net_wrap_msg, msg.m_em);
msg_offsets[EXPRESS_MESH_ROUTER] =
offsetof(model_net_wrap_msg, msg.m_em);
msg_offsets[NETWORK_GRAPH] =
offsetof(model_net_wrap_msg, msg.m_ng);
msg_offsets[NETWORK_GRAPH_ROUTER] =
offsetof(model_net_wrap_msg, msg.m_ng);
// perform the configuration(s)
// This part is tricky, as we basically have to look up all annotations that
......@@ -406,7 +413,7 @@ void model_net_base_configure(){
}
}
if (a == num_params){
// found a new annotation
// found a new annotatio
annos[num_params++] = amap->annotations[n].ptr;
}
}
......@@ -525,6 +532,14 @@ void model_net_base_lp_init(
}
}
void model_net_base_prerun(
model_net_base_state * ns,
tw_lp * lp) {
if(ns->sub_type->pre_run != NULL) {
ns->sub_type->pre_run(ns->sub_state, lp);
}
}
void model_net_base_event(
model_net_base_state * ns,
tw_bf * b,
......
......@@ -32,6 +32,10 @@ extern struct model_net_method dragonfly_custom_router_method;
extern struct model_net_method loggp_method;
extern struct model_net_method express_mesh_method;
extern struct model_net_method express_mesh_router_method;
extern struct model_net_method express_mesh_method;
extern struct model_net_method express_mesh_router_method;
extern struct model_net_method network_graph_method;
extern struct model_net_method network_graph_router_method;
#define X(a,b,c,d) b,
char * model_net_lp_config_names[] = {
......
This diff is collapsed.