Commit 96f09981 authored by Misbah Mubarak's avatar Misbah Mubarak
Browse files

Adding message ID parameter to model-net event, ID generation is yet to be done

parent a9d21e30
...@@ -28,6 +28,7 @@ struct model_net_method ...@@ -28,6 +28,7 @@ struct model_net_method
void (*mn_register)(tw_lptype *base_type); void (*mn_register)(tw_lptype *base_type);
tw_stime (*model_net_method_packet_event)( tw_stime (*model_net_method_packet_event)(
model_net_request const * req, model_net_request const * req,
uint64_t message_id,
uint64_t message_offset, // offset in the context of the whole message uint64_t message_offset, // offset in the context of the whole message
uint64_t packet_size, // needed in case message < packet uint64_t packet_size, // needed in case message < packet
tw_stime offset, tw_stime offset,
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define CREDIT_SIZE 8 #define CREDIT_SIZE 8
#define MEAN_PROCESS 1.0 #define MEAN_PROCESS 1.0
#define MAX_GEN_PACKETS 2000000
/* collective specific parameters */ /* collective specific parameters */
#define TREE_DEGREE 4 #define TREE_DEGREE 4
...@@ -118,7 +119,7 @@ typedef struct router_state router_state; ...@@ -118,7 +119,7 @@ typedef struct router_state router_state;
/* dragonfly compute node data structure */ /* dragonfly compute node data structure */
struct terminal_state struct terminal_state
{ {
unsigned long long packet_counter; uint64_t packet_counter;
// Dragonfly specific parameters // Dragonfly specific parameters
unsigned int router_id; unsigned int router_id;
...@@ -163,6 +164,8 @@ struct terminal_state ...@@ -163,6 +164,8 @@ struct terminal_state
const char * anno; const char * anno;
const dragonfly_param *params; const dragonfly_param *params;
//struct qhash_head hash_link;
}; };
/* terminal event type (1-4) */ /* terminal event type (1-4) */
...@@ -763,6 +766,7 @@ void router_setup(router_state * r, tw_lp * lp) ...@@ -763,6 +766,7 @@ void router_setup(router_state * r, tw_lp * lp)
/* dragonfly packet event , generates a dragonfly packet on the compute node */ /* dragonfly packet event , generates a dragonfly packet on the compute node */
static tw_stime dragonfly_packet_event( static tw_stime dragonfly_packet_event(
model_net_request const * req, model_net_request const * req,
uint64_t message_id,
uint64_t message_offset, uint64_t message_offset,
uint64_t packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
...@@ -1206,6 +1210,7 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -1206,6 +1210,7 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg,
if(msg->path_type != MINIMAL && msg->path_type != NON_MINIMAL) if(msg->path_type != MINIMAL && msg->path_type != NON_MINIMAL)
printf("\n Wrong message path type %d ", msg->path_type); printf("\n Wrong message path type %d ", msg->path_type);
#if DEBUG == 1 #if DEBUG == 1
if( msg->packet_ID == TRACK && msg->chunk_id == num_chunks-1) if( msg->packet_ID == TRACK && msg->chunk_id == num_chunks-1)
{ {
...@@ -1864,6 +1869,13 @@ static int do_adaptive_routing( router_state * s, ...@@ -1864,6 +1869,13 @@ static int do_adaptive_routing( router_state * s,
minimal_out_port = get_output_port(s, bf, msg, lp, minimal_next_stop); minimal_out_port = get_output_port(s, bf, msg, lp, minimal_next_stop);
int nonmin_next_stop = get_next_stop(s, bf, msg, lp, NON_MINIMAL, dest_router_id, intm_id); int nonmin_next_stop = get_next_stop(s, bf, msg, lp, NON_MINIMAL, dest_router_id, intm_id);
nonmin_out_port = get_output_port(s, bf, msg, lp, nonmin_next_stop); nonmin_out_port = get_output_port(s, bf, msg, lp, nonmin_next_stop);
int nomin_vc = 0;
if(nonmin_out_port < s->params->num_routers) {
nomin_vc = msg->my_l_hop;
} else if(nonmin_out_port < (s->params->num_routers +
s->params->num_global_channels)) {
nomin_vc = msg->my_g_hop;
}
int min_vc = 0; int min_vc = 0;
if(minimal_out_port < s->params->num_routers) { if(minimal_out_port < s->params->num_routers) {
min_vc = msg->my_l_hop; min_vc = msg->my_l_hop;
...@@ -1910,7 +1922,9 @@ static int do_adaptive_routing( router_state * s, ...@@ -1910,7 +1922,9 @@ static int do_adaptive_routing( router_state * s,
int nonmin_hist_count = s->cur_hist_num[nonmin_out_chan] + int nonmin_hist_count = s->cur_hist_num[nonmin_out_chan] +
(s->prev_hist_num[min_out_chan]/2); (s->prev_hist_num[min_out_chan]/2);
if(num_min_hops * (min_port_count - min_hist_count) <= (num_nonmin_hops * ((q_avg + 1) - nonmin_hist_count))) { int nonmin_port_count = s->vc_occupancy[nonmin_out_port][nomin_vc];
//if(num_min_hops * (min_port_count - min_hist_count) <= (num_nonmin_hops * ((q_avg + 1) - nonmin_hist_count))) {
if(min_port_count <= nonmin_port_count) {
msg->path_type = MINIMAL; msg->path_type = MINIMAL;
next_stop = minimal_next_stop; next_stop = minimal_next_stop;
msg->intm_group_id = -1; msg->intm_group_id = -1;
......
...@@ -111,6 +111,7 @@ static void loggp_set_params(const char * config_file, loggp_param * params); ...@@ -111,6 +111,7 @@ static void loggp_set_params(const char * config_file, loggp_param * params);
/* Issues a loggp packet event call */ /* Issues a loggp packet event call */
static tw_stime loggp_packet_event( static tw_stime loggp_packet_event(
model_net_request const * req, model_net_request const * req,
uint64_t message_id,
uint64_t message_offset, uint64_t message_offset,
uint64_t packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
...@@ -603,6 +604,7 @@ static void handle_msg_start_event( ...@@ -603,6 +604,7 @@ static void handle_msg_start_event(
* It takes the packets from modelnet layer and calls underlying loggp methods*/ * It takes the packets from modelnet layer and calls underlying loggp methods*/
static tw_stime loggp_packet_event( static tw_stime loggp_packet_event(
model_net_request const * req, model_net_request const * req,
uint64_t message_id,
uint64_t message_offset, uint64_t message_offset,
uint64_t packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
......
...@@ -264,7 +264,9 @@ int fcfs_next( ...@@ -264,7 +264,9 @@ int fcfs_next(
"from %lu to %lu at %1.5e (last:%d)\n", "from %lu to %lu at %1.5e (last:%d)\n",
lp->gid, psize, q->rem, q->req.src_lp, q->req.final_dest_lp, lp->gid, psize, q->rem, q->req.src_lp, q->req.final_dest_lp,
tw_now(lp), is_last_packet); tw_now(lp), is_last_packet);
*poffset = s->method->model_net_method_packet_event(&q->req,
/* TODO: Add correct message ID here */
*poffset = s->method->model_net_method_packet_event(&q->req, 0,
q->req.msg_size - q->rem, psize, 0.0, &q->sched_params, q->req.msg_size - q->rem, psize, 0.0, &q->sched_params,
q->remote_event, q->local_event, lp, is_last_packet); q->remote_event, q->local_event, lp, is_last_packet);
} }
......
...@@ -93,6 +93,7 @@ static void sn_configure(); ...@@ -93,6 +93,7 @@ static void sn_configure();
/* Issues a simplenet packet event call */ /* Issues a simplenet packet event call */
static tw_stime simplenet_packet_event( static tw_stime simplenet_packet_event(
model_net_request const * req, model_net_request const * req,
uint64_t message_id,
uint64_t message_offset, uint64_t message_offset,
uint64_t packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
...@@ -516,6 +517,7 @@ static void handle_msg_start_event( ...@@ -516,6 +517,7 @@ static void handle_msg_start_event(
* It takes the packets from modelnet layer and calls underlying simplenet methods*/ * It takes the packets from modelnet layer and calls underlying simplenet methods*/
static tw_stime simplenet_packet_event( static tw_stime simplenet_packet_event(
model_net_request const * req, model_net_request const * req,
uint64_t message_id,
uint64_t message_offset, uint64_t message_offset,
uint64_t packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
......
...@@ -125,6 +125,7 @@ static void simple_wan_collective_rc(); ...@@ -125,6 +125,7 @@ static void simple_wan_collective_rc();
/* Issues a simplep2p packet event call */ /* Issues a simplep2p packet event call */
static tw_stime simplep2p_packet_event( static tw_stime simplep2p_packet_event(
model_net_request const * req, model_net_request const * req,
uint64_t message_id,
uint64_t message_offset, uint64_t message_offset,
uint64_t packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
...@@ -796,6 +797,7 @@ static void handle_msg_start_event( ...@@ -796,6 +797,7 @@ static void handle_msg_start_event(
* It takes the packets from modelnet layer and calls underlying simplep2p methods*/ * It takes the packets from modelnet layer and calls underlying simplep2p methods*/
static tw_stime simplep2p_packet_event( static tw_stime simplep2p_packet_event(
model_net_request const * req, model_net_request const * req,
uint64_t message_id,
uint64_t message_offset, uint64_t message_offset,
uint64_t packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
......
...@@ -348,6 +348,7 @@ static int torus_get_msg_sz(void) ...@@ -348,6 +348,7 @@ static int torus_get_msg_sz(void)
/* torus packet event , generates a torus packet on the compute node */ /* torus packet event , generates a torus packet on the compute node */
static tw_stime torus_packet_event( static tw_stime torus_packet_event(
model_net_request const * req, model_net_request const * req,
uint64_t message_id,
uint64_t message_offset, uint64_t message_offset,
uint64_t packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
......
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