Commit 0547a991 authored by Misbah Mubarak's avatar Misbah Mubarak
Browse files

updating MPI sim layer for blocking receives, updating dragonfly model for the...

updating MPI sim layer for blocking receives, updating dragonfly model for the message remainders, checking for negative byte size in dumpi traces
parent 8f702e82
......@@ -189,7 +189,7 @@ struct codes_workload_op
/* TODO: not sure why source rank is here */
int source_rank;/* source rank of MPI send message */
int dest_rank; /* dest rank of MPI send message */
int num_bytes; /* number of bytes to be transferred over the network */
int64_t num_bytes; /* number of bytes to be transferred over the network */
int16_t data_type; /* MPI data type to be matched with the recv */
int count; /* number of elements to be received */
int tag; /* tag of the message */
......
......@@ -107,7 +107,7 @@ struct mpi_msgs_queue
int tag;
int source_rank;
int dest_rank;
int num_bytes;
uint64_t num_bytes;
tw_stime req_init_time;
dumpi_req_id req_id;
struct qlist_head ql;
......@@ -204,7 +204,7 @@ struct nw_message
{
tw_lpid src_rank;
tw_lpid dest_rank;
int num_bytes;
int64_t num_bytes;
int num_matched;
int data_type;
double sim_start_time;
......@@ -222,7 +222,7 @@ struct nw_message
double saved_recv_time;
double saved_wait_time;
double saved_delay;
int saved_num_bytes;
int64_t saved_num_bytes;
struct codes_workload_op * saved_op;
} rc;
};
......@@ -285,6 +285,21 @@ static void print_waiting_reqs(int32_t * reqs, int count)
for(i = 0; i < count; i++ )
printf(" %d ", reqs[i]);
}
static void print_msgs_queue(struct qlist_head * head, int is_send)
{
if(is_send)
printf("\n Send msgs queue: ");
else
printf("\n Recv msgs queue: ");
struct qlist_head * ent = NULL;
mpi_msgs_queue * current = NULL;
qlist_for_each(ent, head)
{
current = qlist_entry(ent, mpi_msgs_queue, ql);
printf(" \n Source %d Dest %d bytes %d tag %d ", current->source_rank, current->dest_rank, current->num_bytes, current->tag);
}
}
static void print_completed_queue(struct qlist_head * head)
{
printf("\n Completed queue: ");
......@@ -370,8 +385,8 @@ static int notify_posted_wait(nw_state* s,
wait_elem->num_completed,
wait_elem->count,
lp->gid);
if(wait_elem->num_completed > wait_elem->count)
tw_lp_suspend(lp, 1, 0);
// if(wait_elem->num_completed > wait_elem->count)
// tw_lp_suspend(lp, 1, 0);
if(wait_elem->num_completed == wait_elem->count)
{
......@@ -522,7 +537,7 @@ static void codes_exec_mpi_wait_all(
struct completed_requests* current = NULL;
qlist_for_each(ent, &s->completed_reqs)
{
current = qlist_entry(ent, completed_requests, ql);
current = qlist_entry(ent, struct completed_requests, ql);
if(current->req_id == req_id)
num_matched++;
}
......@@ -590,6 +605,8 @@ static int rm_matching_rcv(nw_state * ns,
if(qi->op_type == CODES_WK_IRECV)
update_completed_queue(ns, bf, m, lp, qi->req_id);
else if(qi->op_type == CODES_WK_RECV)
codes_issue_next_event(lp);
qlist_del(&qi->ql);
......@@ -811,11 +828,9 @@ static void codes_exec_mpi_send(nw_state* s,
m->rc.saved_num_bytes = mpi_op->u.send.num_bytes;
/* model-net event */
tw_lpid dest_rank;
codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id,
lp_type_name, &mapping_type_id, annotation, &mapping_rep_id, &mapping_offset);
if(net_id == DRAGONFLY) /* special handling for the dragonfly case */
{
dest_rank = codes_mapping_get_lpid_from_relative(global_dest_rank, NULL, "nw-lp", NULL, 0);
// if(net_id == DRAGONFLY) /* special handling for the dragonfly case */
/* {
int num_routers, lps_per_rep, factor;
num_routers = codes_mapping_get_lp_count(lp_group_name, 1,
"modelnet_dragonfly_router", NULL, 1);
......@@ -825,11 +840,11 @@ static void codes_exec_mpi_send(nw_state* s,
}
else
{
/* other cases like torus/simplenet/loggp etc. */
codes_mapping_get_lp_id(lp_group_name, lp_type_name, NULL, 1,
*/ /* other cases like torus/simplenet/loggp etc. */
/* codes_mapping_get_lp_id(lp_group_name, lp_type_name, NULL, 1,
global_dest_rank, mapping_offset, &dest_rank);
}
*/
num_bytes_sent += mpi_op->u.send.num_bytes;
s->num_bytes_sent += mpi_op->u.send.num_bytes;
......@@ -880,13 +895,13 @@ static void codes_exec_mpi_send(nw_state* s,
{
if(mpi_op->op_type == CODES_WK_ISEND)
{
fprintf(workload_log, "\n (%lf) APP %d MPI ISEND SOURCE %ld DEST %ld BYTES %ld ",
tw_now(lp), s->app_id, s->nw_id, global_dest_rank, mpi_op->u.send.num_bytes);
fprintf(workload_log, "\n (%lf) APP %d MPI ISEND SOURCE %ld DEST %ld TAG %d BYTES %ld ",
tw_now(lp), s->app_id, s->nw_id, global_dest_rank, mpi_op->u.send.tag, mpi_op->u.send.num_bytes);
}
else
fprintf(workload_log, "\n (%lf) APP ID %d MPI SEND SOURCE %ld DEST %ld BYTES %ld ",
tw_now(lp), s->app_id, s->nw_id, global_dest_rank, mpi_op->u.send.num_bytes);
}
fprintf(workload_log, "\n (%lf) APP ID %d MPI SEND SOURCE %ld DEST %ld TAG %d BYTES %ld ",
tw_now(lp), s->app_id, s->nw_id, global_dest_rank, mpi_op->u.send.tag, mpi_op->u.send.num_bytes);
}
/* isend executed, now get next MPI operation from the queue */
if(mpi_op->op_type == CODES_WK_ISEND)
codes_issue_next_event(lp);
......@@ -1004,6 +1019,8 @@ static void update_arrival_queue_rc(nw_state* s,
}
if(qi->op_type == CODES_WK_IRECV)
update_completed_queue_rc(s, bf, m, lp);
else if(qi->op_type == CODES_WK_RECV)
codes_issue_next_event_rc(lp);
}
else if(m->fwd.found_match < 0)
{
......@@ -1125,7 +1142,6 @@ void nw_test_init(nw_state* s, tw_lp* lp)
return;
}
if (strcmp(workload_type, "dumpi") == 0){
strcpy(params_d.file_name, file_name_of_job[lid.job]);
params_d.num_net_traces = num_traces_of_job[lid.job];
......@@ -1409,7 +1425,8 @@ void nw_test_finalize(nw_state* s, tw_lp* lp)
}
int count_irecv = qlist_count(&s->pending_recvs_queue);
int count_isend = qlist_count(&s->arrival_queue);
printf("\n LP %llu unmatched irecvs %d unmatched sends %d Total sends %ld receives %ld collectives %ld delays %ld wait alls %ld waits %ld send time %lf wait %lf",
if(count_irecv || count_isend)
printf("\n LP %llu unmatched irecvs %d unmatched sends %d Total sends %ld receives %ld collectives %ld delays %ld wait alls %ld waits %ld send time %lf wait %lf",
lp->gid, count_irecv, count_isend, s->num_sends, s->num_recvs, s->num_cols, s->num_delays, s->num_waitall, s->num_wait, s->send_time, s->wait_time);
written += sprintf(s->output_buf + written, "\n %llu %llu %ld %ld %ld %ld %lf %lf %lf", lp->gid, s->nw_id, s->num_sends, s->num_recvs, s->num_bytes_sent,
......@@ -1422,6 +1439,11 @@ void nw_test_finalize(nw_state* s, tw_lp* lp)
if(s->elapsed_time > max_time )
max_time = s->elapsed_time;
if(count_irecv || count_isend)
{
print_msgs_queue(&s->pending_recvs_queue, 0);
print_msgs_queue(&s->arrival_queue, 1);
}
if(enable_sampling)
{
fseek(workload_agg_log, sample_bytes_written, SEEK_SET);
......
......@@ -5,7 +5,7 @@
*/
// Local router ID: 0 --- total_router-1
// Router LP ID
// Router LP ID
// Terminal LP ID
#include <ross.h>
......@@ -60,7 +60,7 @@ static int minimal_count=0, nonmin_count=0;
static int num_routers_per_mgrp = 0;
typedef struct dragonfly_param dragonfly_param;
/* annotation-specific parameters (unannotated entry occurs at the
/* annotation-specific parameters (unannotated entry occurs at the
* last index) */
static uint64_t num_params = 0;
static dragonfly_param * all_params = NULL;
......@@ -92,7 +92,7 @@ struct terminal_message_list {
terminal_message_list *prev;
};
void init_terminal_message_list(terminal_message_list *this,
void init_terminal_message_list(terminal_message_list *this,
terminal_message *inmsg) {
this->msg = *inmsg;
this->event_data = NULL;
......@@ -200,13 +200,13 @@ struct terminal_state
/* collective init time */
tw_stime collective_init_time;
/* node ID in the tree */
/* node ID in the tree */
tw_lpid node_id;
/* messages sent & received in collectives may get interchanged several times so we have to save the
/* messages sent & received in collectives may get interchanged several times so we have to save the
origin server information in the node's state */
tw_lpid origin_svr;
tw_lpid origin_svr;
/* parent node ID of the current node */
tw_lpid parent_node_id;
/* array of children to be allocated in terminal_init*/
......@@ -256,7 +256,7 @@ struct terminal_state
struct dfly_cn_sample * sample_stat;
int op_arr_size;
int max_arr_size;
/* for logging forward and reverse events */
long fwd_events;
long rev_events;
......@@ -311,8 +311,8 @@ struct router_state
int op_arr_size;
int max_arr_size;
int* global_channel;
int* global_channel;
tw_stime* next_output_available_time;
tw_stime* cur_hist_start_time;
tw_stime* last_buf_full;
......@@ -327,7 +327,7 @@ struct router_state
int *in_send_loop;
int *queued_count;
struct rc_stack * st;
int** vc_occupancy;
int64_t* link_traffic;
int64_t * link_traffic_sample;
......@@ -337,12 +337,12 @@ struct router_state
int* prev_hist_num;
int* cur_hist_num;
char output_buf[4096];
char output_buf2[4096];
struct dfly_router_sample * rsamples;
long fwd_events;
long rev_events;
};
......@@ -367,7 +367,7 @@ static int dragonfly_rank_hash_compare(
struct dfly_qhash_entry *tmp = NULL;
tmp = qhash_entry(link, struct dfly_qhash_entry, hash_link);
if (tmp->key.message_id == message_key->message_id
&& tmp->key.sender_id == message_key->sender_id)
return 1;
......@@ -377,12 +377,12 @@ static int dragonfly_rank_hash_compare(
static int dragonfly_hash_func(void *k, int table_size)
{
struct dfly_hash_key *tmp = (struct dfly_hash_key *)k;
//uint32_t pc = 0, pb = 0;
//uint32_t pc = 0, pb = 0;
//bj_hashlittle2(tmp, sizeof(*tmp), &pc, &pb);
uint64_t key = (~tmp->message_id) + (tmp->message_id << 18);
key = key * 21;
key = ~key ^ (tmp->sender_id >> 4);
key = key * tmp->sender_id;
key = key * tmp->sender_id;
return (int)(key & (table_size - 1));
//return (int)(pc % (table_size - 1));
}
......@@ -410,35 +410,35 @@ static int dragonfly_get_msg_sz(void)
static void free_tmp(void * ptr)
{
struct dfly_qhash_entry * dfly = ptr;
struct dfly_qhash_entry * dfly = ptr;
free(dfly->remote_event_data);
free(dfly);
}
static void append_to_terminal_message_list(
static void append_to_terminal_message_list(
terminal_message_list ** thisq,
terminal_message_list ** thistail,
int index,
int index,
terminal_message_list *msg) {
if(thisq[index] == NULL) {
thisq[index] = msg;
} else {
thistail[index]->next = msg;
msg->prev = thistail[index];
}
}
thistail[index] = msg;
}
static void prepend_to_terminal_message_list(
static void prepend_to_terminal_message_list(
terminal_message_list ** thisq,
terminal_message_list ** thistail,
int index,
int index,
terminal_message_list *msg) {
if(thisq[index] == NULL) {
thistail[index] = msg;
} else {
thisq[index]->prev = msg;
msg->next = thisq[index];
}
}
thisq[index] = msg;
}
......@@ -540,13 +540,13 @@ static void dragonfly_read_config(const char * anno, dragonfly_param *params){
MAX_NAME_LENGTH);
configuration_get_value(&config, "PARAMS", "rt_sample_file", anno, router_sample_file,
MAX_NAME_LENGTH);
char routing_str[MAX_NAME_LENGTH];
configuration_get_value(&config, "PARAMS", "routing", anno, routing_str,
MAX_NAME_LENGTH);
if(strcmp(routing_str, "minimal") == 0)
routing = MINIMAL;
else if(strcmp(routing_str, "nonminimal")==0 ||
else if(strcmp(routing_str, "nonminimal")==0 ||
strcmp(routing_str,"non-minimal")==0)
routing = NON_MINIMAL;
else if (strcmp(routing_str, "adaptive") == 0)
......@@ -555,7 +555,7 @@ static void dragonfly_read_config(const char * anno, dragonfly_param *params){
routing = PROG_ADAPTIVE;
else
{
fprintf(stderr,
fprintf(stderr,
"No routing protocol specified, setting to minimal routing\n");
routing = -1;
}
......@@ -574,7 +574,7 @@ static void dragonfly_read_config(const char * anno, dragonfly_param *params){
p->num_cn * p->total_routers, p->total_routers, p->num_groups,
p->radix);
}
p->cn_delay = bytes_to_ns(p->chunk_size, p->cn_bandwidth);
p->local_delay = bytes_to_ns(p->chunk_size, p->local_bandwidth);
p->global_delay = bytes_to_ns(p->chunk_size, p->global_bandwidth);
......@@ -612,7 +612,7 @@ static void dragonfly_report_stats()
MPI_Reduce( &total_msg_sz, &final_msg_sz, 1, MPI_LONG_LONG, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce( &dragonfly_total_time, &avg_time, 1,MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce( &dragonfly_max_latency, &max_time, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD);
MPI_Reduce( &packet_gen, &total_gen, 1, MPI_LONG, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce( &packet_fin, &total_fin, 1, MPI_LONG, MPI_SUM, 0, MPI_COMM_WORLD);
if(routing == ADAPTIVE || routing == PROG_ADAPTIVE)
......@@ -623,13 +623,13 @@ static void dragonfly_report_stats()
/* print statistics */
if(!g_tw_mynode)
{
printf(" Average number of hops traversed %f average chunk latency %lf us maximum chunk latency %lf us avg message size %lf bytes finished messages %lld finished chunks %lld \n",
{
printf(" Average number of hops traversed %f average chunk latency %lf us maximum chunk latency %lf us avg message size %lf bytes finished messages %lld finished chunks %lld \n",
(float)avg_hops/total_finished_chunks, avg_time/(total_finished_chunks*1000), max_time/1000, (float)final_msg_sz/total_finished_msgs, total_finished_msgs, total_finished_chunks);
if(routing == ADAPTIVE || routing == PROG_ADAPTIVE)
printf("\n ADAPTIVE ROUTING STATS: %d chunks routed minimally %d chunks routed non-minimally completed packets %lld \n",
printf("\n ADAPTIVE ROUTING STATS: %d chunks routed minimally %d chunks routed non-minimally completed packets %lld \n",
total_minimal_packets, total_nonmin_packets, total_finished_chunks);
printf("\n Total packets generated %ld finished %ld \n", total_gen, total_fin);
}
return;
......@@ -694,17 +694,17 @@ void dragonfly_collective_init(terminal_state * s,
}
/* initialize a dragonfly compute node terminal */
void
terminal_init( terminal_state * s,
void
terminal_init( terminal_state * s,
tw_lp * lp )
{
s->packet_gen = 0;
s->packet_fin = 0;
uint32_t h1 = 0, h2 = 0;
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM_TERM, strlen(LP_METHOD_NM_TERM), &h1, &h2);
terminal_magic_num = h1 + h2;
int i;
char anno[MAX_NAME_LENGTH];
......@@ -725,12 +725,12 @@ terminal_init( terminal_state * s,
int num_lps = codes_mapping_get_lp_count(lp_group_name, 1, LP_CONFIG_NM_TERM,
s->anno, 0);
s->terminal_id = (mapping_rep_id * num_lps) + mapping_offset;
s->terminal_id = (mapping_rep_id * num_lps) + mapping_offset;
s->router_id=(int)s->terminal_id / (s->params->num_routers/2);
s->terminal_available_time = 0.0;
s->packet_counter = 0;
s->finished_msgs = 0;
s->finished_chunks = 0;
s->finished_packets = 0;
......@@ -757,9 +757,9 @@ terminal_init( terminal_state * s,
if(!s->rank_tbl)
tw_error(TW_LOC, "\n Hash table not initialized! ");
s->terminal_msgs =
s->terminal_msgs =
(terminal_message_list**)malloc(1*sizeof(terminal_message_list*));
s->terminal_msgs_tail =
s->terminal_msgs_tail =
(terminal_message_list**)malloc(1*sizeof(terminal_message_list*));
s->terminal_msgs[0] = NULL;
s->terminal_msgs_tail[0] = NULL;
......@@ -771,14 +771,14 @@ terminal_init( terminal_state * s,
return;
}
/* sets up the router virtual channels, global channels,
/* sets up the router virtual channels, global channels,
* local channels, compute node channels */
void router_setup(router_state * r, tw_lp * lp)
{
uint32_t h1 = 0, h2 = 0;
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM_ROUT, strlen(LP_METHOD_NM_ROUT), &h1, &h2);
router_magic_num = h1 + h2;
char anno[MAX_NAME_LENGTH];
codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id, NULL,
&mapping_type_id, anno, &mapping_rep_id, &mapping_offset);
......@@ -816,16 +816,16 @@ void router_setup(router_state * r, tw_lp * lp)
r->link_traffic_sample = (int64_t*)malloc(p->radix * sizeof(int64_t));
r->cur_hist_num = (int*)malloc(p->radix * sizeof(int));
r->prev_hist_num = (int*)malloc(p->radix * sizeof(int));
r->vc_occupancy = (int**)malloc(p->radix * sizeof(int*));
r->in_send_loop = (int*)malloc(p->radix * sizeof(int));
r->pending_msgs =
r->pending_msgs =
(terminal_message_list***)malloc(p->radix * sizeof(terminal_message_list**));
r->pending_msgs_tail =
r->pending_msgs_tail =
(terminal_message_list***)malloc(p->radix * sizeof(terminal_message_list**));
r->queued_msgs =
r->queued_msgs =
(terminal_message_list***)malloc(p->radix * sizeof(terminal_message_list**));
r->queued_msgs_tail =
r->queued_msgs_tail =
(terminal_message_list***)malloc(p->radix * sizeof(terminal_message_list**));
r->queued_count = (int*)malloc(p->radix * sizeof(int));
r->last_buf_full = (tw_stime*)malloc(p->radix * sizeof(tw_stime));
......@@ -845,16 +845,16 @@ void router_setup(router_state * r, tw_lp * lp)
r->link_traffic_sample[i] = 0;
r->cur_hist_num[i] = 0;
r->prev_hist_num[i] = 0;
r->queued_count[i] = 0;
r->queued_count[i] = 0;
r->in_send_loop[i] = 0;
r->vc_occupancy[i] = (int*)malloc(p->num_vcs * sizeof(int));
r->pending_msgs[i] = (terminal_message_list**)malloc(p->num_vcs *
r->pending_msgs[i] = (terminal_message_list**)malloc(p->num_vcs *
sizeof(terminal_message_list*));
r->pending_msgs_tail[i] = (terminal_message_list**)malloc(p->num_vcs *
r->pending_msgs_tail[i] = (terminal_message_list**)malloc(p->num_vcs *
sizeof(terminal_message_list*));
r->queued_msgs[i] = (terminal_message_list**)malloc(p->num_vcs *
r->queued_msgs[i] = (terminal_message_list**)malloc(p->num_vcs *
sizeof(terminal_message_list*));
r->queued_msgs_tail[i] = (terminal_message_list**)malloc(p->num_vcs *
r->queued_msgs_tail[i] = (terminal_message_list**)malloc(p->num_vcs *
sizeof(terminal_message_list*));
for(int j = 0; j < p->num_vcs; j++) {
r->vc_occupancy[i][j] = 0;
......@@ -867,7 +867,7 @@ void router_setup(router_state * r, tw_lp * lp)
#if DEBUG == 1
// printf("\n LP ID %d VC occupancy radix %d Router %d is connected to ", lp->gid, p->radix, r->router_id);
#endif
#endif
//round the number of global channels to the nearest even number
#if USE_DIRECT_SCHEME
int first = r->router_id % p->num_routers;
......@@ -885,7 +885,7 @@ void router_setup(router_state * r, tw_lp * lp)
first += p->num_routers;
}
#else
int router_offset = (r->router_id % p->num_routers) *
int router_offset = (r->router_id % p->num_routers) *
(p->num_global_channels / 2) + 1;
for(int i=0; i < p->num_global_channels; i++)
{
......@@ -900,11 +900,11 @@ void router_setup(router_state * r, tw_lp * lp)
}
if(r->global_channel[i]<0)
{
r->global_channel[i]=p->total_routers+r->global_channel[i];
r->global_channel[i]=p->total_routers+r->global_channel[i];
}
#if DEBUG == 1
printf("\n channel %d ", r->global_channel[i]);
#endif
#endif
}
#endif
......@@ -912,7 +912,7 @@ void router_setup(router_state * r, tw_lp * lp)
printf("\n");
#endif
return;
}
}
/* dragonfly packet event , generates a dragonfly packet on the compute node */
......@@ -934,7 +934,7 @@ static tw_stime dragonfly_packet_event(
terminal_message * msg;
char* tmp_ptr;
xfer_to_nic_time = codes_local_latency(sender);
xfer_to_nic_time = codes_local_latency(sender);
//e_new = tw_event_new(sender->gid, xfer_to_nic_time+offset, sender);
//msg = tw_event_data(e_new);
e_new = model_net_method_event_new(sender->gid, xfer_to_nic_time+offset,
......@@ -953,7 +953,7 @@ static tw_stime dragonfly_packet_event(
msg->message_id = req->msg_id;
msg->is_pull = req->is_pull;
msg->pull_size = req->pull_size;
msg->magic = terminal_magic_num;
msg->magic = terminal_magic_num;
msg->msg_start_time = req->msg_start_time;
if(is_last_pckt) /* Its the last packet so pass in remote and local event information*/
......@@ -984,7 +984,7 @@ static void dragonfly_packet_event_rc(tw_lp *sender)
}
/* given two group IDs, find the router of the src_gid that connects to the dest_gid*/
tw_lpid getRouterFromGroupID(int dest_gid,
tw_lpid getRouterFromGroupID(int dest_gid,
int src_gid,
int num_routers,
int total_groups)
......@@ -999,13 +999,13 @@ tw_lpid getRouterFromGroupID(int dest_gid,
int group_begin = src_gid * num_routers;
int group_end = (src_gid * num_routers) + num_routers-1;
int offset = (dest_gid * num_routers - group_begin) / num_routers;
if((dest_gid * num_routers) < group_begin)
offset = (group_begin - dest_gid * num_routers) / num_routers; // take absolute value
int half_channel = num_routers / 4;
int index = (offset - 1)/(half_channel * num_routers);
offset=(offset - 1) % (half_channel * num_routers);
// If the destination router is in the same group
......@@ -1018,10 +1018,10 @@ tw_lpid getRouterFromGroupID(int dest_gid,
return router_id;
#endif
}
}
/*When a packet is sent from the current router and a buffer slot becomes available, a credit is sent back to schedule another packet event*/
void router_credit_send(router_state * s, terminal_message * msg,
void router_credit_send(router_state * s, terminal_message * msg,
tw_lp * lp, int sq) {
tw_event * buf_e;
tw_stime ts;
......@@ -1031,7 +1031,7 @@ void router_credit_send(router_state * s, terminal_message * msg,
int is_terminal = 0;
const dragonfly_param *p = s->params;
// Notify sender terminal about available buffer space
if(msg->last_hop == TERMINAL) {
dest = msg->src_terminal_id;
......@@ -1045,9 +1045,9 @@ void router_credit_send(router_state * s, terminal_message * msg,
printf("\n Invalid message type");
ts = g_tw_lookahead + p->credit_delay + tw_rand_unif(lp->rng);
if (is_terminal) {
buf_e = model_net_method_event_new(dest, ts, lp, DRAGONFLY,
buf_e = model_net_method_event_new(dest, ts, lp, DRAGONFLY,
(void**)&buf_msg, NULL);
buf_msg->magic = terminal_magic_num;
} else {
......@@ -1055,7 +1055,7 @@ void router_credit_send(router_state * s, terminal_message * msg,
(void**)&buf_msg, NULL);
buf_msg->magic = router_magic_num;
}
if(sq == -1) {
buf_msg->vc_index = msg->vc_index;
buf_msg->output_chan = msg->output_chan;
......@@ -1063,7 +1063,7 @@ void router_credit_send(router_state * s, terminal_message * msg,
buf_msg->vc_index = msg->saved_vc;
buf_msg->output_chan = msg->saved_channel;
}