Commit 040378d3 authored by Noah's avatar Noah Committed by Nikhil

Many changes. Bug in sending to destination model-net server lp

parent 841248bb
......@@ -35,6 +35,9 @@ struct fattree_message
int last_hop;
int intm_id; //to find which port I connect to sender with
/* message originating router id */
unsigned int origin_switch_id;
/* number of hops traversed by the packet */
short my_N_hop;
......@@ -42,6 +45,7 @@ struct fattree_message
short vc_index;
short vc_off;
int is_pull;
model_net_event_return event_rc;
uint64_t pull_size;
/* for reverse computation */
......@@ -50,6 +54,7 @@ struct fattree_message
tw_stime saved_credit_time;
uint64_t packet_size;
tw_stime msg_start_time;
tw_stime saved_busy_time;
tw_stime saved_sample_time;
tw_stime saved_avg_time;
tw_stime saved_rcv_time;
......
......@@ -11,7 +11,7 @@ LPGROUPS
PARAMS
{
ft_type="1";
packet_size="1024";
packet_size="32";
message_size="512";
modelnet_scheduler="fcfs";
#modelnet_scheduler="round-robin";
......
......@@ -134,7 +134,7 @@ static void issue_event(
*/
/* skew each kickoff event slightly to help avoid event ties later on */
kickoff_time = g_tw_lookahead + arrival_time + tw_rand_exponential(lp->rng, (double)arrival_time/100);
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);
......@@ -146,6 +146,8 @@ static void svr_init(
svr_state * ns,
tw_lp * lp)
{
ns->start_ts = 0.0;
issue_event(ns, lp);
return;
}
......@@ -165,7 +167,8 @@ static void handle_kickoff_event(
svr_msg * m,
tw_lp * lp)
{
char* anno;
// char* anno;
char anno[MAX_NAME_LENGTH];
tw_lpid local_dest = -1, global_dest = -1;
svr_msg * m_local = malloc(sizeof(svr_msg));
......@@ -198,14 +201,18 @@ static void handle_kickoff_event(
local_dest = (rep_id * 2 + offset + 2) % num_nodes;
// printf("\n LP %ld sending to %ld num nodes %d ", rep_id * 2 + offset, local_dest, num_nodes);
}
*/// assert(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);
printf("global_dest:%d local_dest:%d\n",(int)global_dest,(int)local_dest);
//printf("localGID:%d global_dest:%d local_dest:%d\n",(int)lp->gid,(int)global_dest,(int)local_dest);
//printf("global_src,%d, local_src, %d, global_dest,%d, local_dest,%d,\n",(int)lp->gid,floor((int)lp->gid/11)*4 + (int)lp->gid % 11, (int)global_dest,(int)local_dest);
ns->msg_sent_count++;
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);
//printf("LP:%d localID:%d Here\n",(int)lp->gid, (int)local_dest);
issue_event(ns, lp);
//printf("Just Checking net_id:%d\n",net_id);
return;
}
......@@ -308,7 +315,7 @@ static void svr_event(
handle_kickoff_event(ns, b, m, lp);
break;
default:
printf("\n Invalid message type %d ", m->svr_event_type);
printf("\n LP: %d has received invalid message from src lpID: %d of message type:%d", (int)lp->gid, (int)m->src, m->svr_event_type);
assert(0);
break;
}
......@@ -323,7 +330,6 @@ int main(
int rank;
int num_nets;
int *net_ids;
char* anno;
lp_io_handle handle;
......@@ -353,7 +359,7 @@ int main(
net_ids = model_net_configure(&num_nets);
assert(num_nets==1);
//assert(num_nets==1);
net_id = *net_ids;
free(net_ids);
......@@ -365,7 +371,7 @@ int main(
}
num_servers_per_rep = codes_mapping_get_lp_count("MODELNET_GRP", 1, "server",
NULL, 1);
configuration_get_value_int(&config, "PARAMS", "num_routers", anno, &num_routers_per_grp);
configuration_get_value_int(&config, "PARAMS", "num_routers", NULL, &num_routers_per_grp);
num_groups = (num_routers_per_grp * (num_routers_per_grp/2) + 1);
num_nodes = num_groups * num_routers_per_grp * (num_routers_per_grp / 2);
......@@ -373,7 +379,7 @@ int main(
num_nodes = codes_mapping_get_lp_count("MODELNET_GRP", 0, "server", NULL, 1);
printf("num_nodes:%d \n",num_nodes);
if(lp_io_prepare("modelnet-test", LP_IO_UNIQ_SUFFIX, &handle, MPI_COMM_WORLD) < 0)
{
......
This diff is collapsed.
......@@ -260,6 +260,8 @@ void model_net_base_configure(){
offsetof(model_net_wrap_msg, msg.m_dfly);
msg_offsets[SLIMFLY] =
offsetof(model_net_wrap_msg, msg.m_slim);
msg_offsets[FATTREE] =
offsetof(model_net_wrap_msg, msg.m_fat);
msg_offsets[LOGGP] =
offsetof(model_net_wrap_msg, msg.m_loggp);
......
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