Commit 23f47038 authored by Neil McGlohon's avatar Neil McGlohon

dfp: fix qos_data type to unsigned long longs

parent a385f143
...@@ -313,19 +313,19 @@ struct terminal_state ...@@ -313,19 +313,19 @@ struct terminal_state
struct mn_stats dragonfly_stats_array[CATEGORY_MAX]; struct mn_stats dragonfly_stats_array[CATEGORY_MAX];
int * qos_status; int * qos_status;
int * qos_data; unsigned long long* qos_data;
int num_term_rc_windows; int num_term_rc_windows;
int rc_index; int rc_index;
int* last_qos_status; int* last_qos_status;
int* last_qos_data; unsigned long long* last_qos_data;
int last_qos_lvl; int last_qos_lvl;
int is_monitoring_bw; int is_monitoring_bw;
struct rc_stack *st; struct rc_stack *st;
int issueIdle; int issueIdle;
int * terminal_length; unsigned long long * terminal_length;
const char *anno; const char *anno;
const dragonfly_plus_param *params; const dragonfly_plus_param *params;
...@@ -503,10 +503,10 @@ struct router_state ...@@ -503,10 +503,10 @@ struct router_state
int is_monitoring_bw; int is_monitoring_bw;
int* last_qos_lvl; int* last_qos_lvl;
int** qos_status; int** qos_status;
int** qos_data; unsigned long long** qos_data;
/* for reverse handler of qos */ /* for reverse handler of qos */
int* last_qos_status; int* last_qos_status;
int* last_qos_data; unsigned long long* last_qos_data;
tw_stime *busy_time; tw_stime *busy_time;
tw_stime *busy_time_sample; tw_stime *busy_time_sample;
...@@ -1309,12 +1309,12 @@ void terminal_plus_init(terminal_state *s, tw_lp *lp) ...@@ -1309,12 +1309,12 @@ void terminal_plus_init(terminal_state *s, tw_lp *lp)
/* How much data has been transmitted on the virtual channel group within /* How much data has been transmitted on the virtual channel group within
* the window */ * the window */
s->qos_data = (int*)calloc(num_qos_levels, sizeof(int)); s->qos_data = (unsigned long long*)calloc(num_qos_levels, sizeof(unsigned long long));
s->vc_occupancy = (int*)calloc(num_qos_levels, sizeof(int)); s->vc_occupancy = (int*)calloc(num_qos_levels, sizeof(int));
/* for reverse handlers */ /* for reverse handlers */
s->last_qos_status = (int*)calloc(s->num_term_rc_windows * num_qos_levels, sizeof(int)); s->last_qos_status = (int*)calloc(s->num_term_rc_windows * num_qos_levels, sizeof(int));
s->last_qos_data = (int*)calloc(s->num_term_rc_windows * num_qos_levels, sizeof(int)); s->last_qos_data = (unsigned long long*)calloc(s->num_term_rc_windows * num_qos_levels, sizeof(unsigned long long));
for(i = 0; i < num_qos_levels; i++) for(i = 0; i < num_qos_levels; i++)
{ {
...@@ -1338,7 +1338,7 @@ void terminal_plus_init(terminal_state *s, tw_lp *lp) ...@@ -1338,7 +1338,7 @@ void terminal_plus_init(terminal_state *s, tw_lp *lp)
s->terminal_msgs_tail[i] = NULL; s->terminal_msgs_tail[i] = NULL;
} }
s->terminal_length = (int*)calloc(num_qos_levels, sizeof(int)); s->terminal_length = (unsigned long long*)calloc(num_qos_levels, sizeof(unsigned long long));
s->in_send_loop = 0; s->in_send_loop = 0;
s->issueIdle = 0; s->issueIdle = 0;
...@@ -1393,7 +1393,7 @@ void router_plus_setup(router_state *r, tw_lp *lp) ...@@ -1393,7 +1393,7 @@ void router_plus_setup(router_state *r, tw_lp *lp)
/* history window for bandwidth reverse computation */ /* history window for bandwidth reverse computation */
int num_qos_levels = p->num_qos_levels; int num_qos_levels = p->num_qos_levels;
r->last_qos_status = (int*)calloc(r->num_rtr_rc_windows * r->params->radix * num_qos_levels, sizeof(int)); r->last_qos_status = (int*)calloc(r->num_rtr_rc_windows * r->params->radix * num_qos_levels, sizeof(int));
r->last_qos_data = (int*)calloc(r->num_rtr_rc_windows * r->params->radix * num_qos_levels, sizeof(int)); r->last_qos_data = (unsigned long long*)calloc(r->num_rtr_rc_windows * r->params->radix * num_qos_levels, sizeof(unsigned long long));
// Determine if router is a spine or a leaf // Determine if router is a spine or a leaf
int intra_group_id = r->router_id % p->num_routers; int intra_group_id = r->router_id % p->num_routers;
...@@ -1428,7 +1428,7 @@ void router_plus_setup(router_state *r, tw_lp *lp) ...@@ -1428,7 +1428,7 @@ void router_plus_setup(router_state *r, tw_lp *lp)
r->link_traffic_sample = (int64_t *) calloc(p->radix, sizeof(int64_t)); r->link_traffic_sample = (int64_t *) calloc(p->radix, sizeof(int64_t));
r->vc_occupancy = (int **) calloc(p->radix, sizeof(int *)); r->vc_occupancy = (int **) calloc(p->radix, sizeof(int *));
r->qos_data = (int**)calloc(p->radix, sizeof(int*)); r->qos_data = (unsigned long long**)calloc(p->radix, sizeof(unsigned long long*));
r->last_qos_lvl = (int*)calloc(p->radix, sizeof(int)); r->last_qos_lvl = (int*)calloc(p->radix, sizeof(int));
r->qos_status = (int**)calloc(p->radix, sizeof(int*)); r->qos_status = (int**)calloc(p->radix, sizeof(int*));
r->in_send_loop = (int *) calloc(p->radix, sizeof(int)); r->in_send_loop = (int *) calloc(p->radix, sizeof(int));
...@@ -1469,7 +1469,7 @@ void router_plus_setup(router_state *r, tw_lp *lp) ...@@ -1469,7 +1469,7 @@ void router_plus_setup(router_state *r, tw_lp *lp)
(terminal_plus_message_list **) calloc(p->num_vcs, sizeof(terminal_plus_message_list *)); (terminal_plus_message_list **) calloc(p->num_vcs, sizeof(terminal_plus_message_list *));
r->qos_status[i] = (int*)calloc(num_qos_levels, sizeof(int)); r->qos_status[i] = (int*)calloc(num_qos_levels, sizeof(int));
r->qos_data[i] = (int*)calloc(num_qos_levels, sizeof(int)); r->qos_data[i] = (unsigned long long*)calloc(num_qos_levels, sizeof(unsigned long long));
for(int j = 0; j < num_qos_levels; j++) for(int j = 0; j < num_qos_levels; j++)
{ {
...@@ -1571,7 +1571,7 @@ void issue_rtr_bw_monitor_event(router_state * s, tw_bf * bf, terminal_plus_mess ...@@ -1571,7 +1571,7 @@ void issue_rtr_bw_monitor_event(router_state * s, tw_bf * bf, terminal_plus_mess
{ {
s->num_rtr_rc_windows *= 2; s->num_rtr_rc_windows *= 2;
int * tmp1 = (int*)calloc(s->num_rtr_rc_windows * s->params->radix * num_qos_levels, sizeof(int)); int * tmp1 = (int*)calloc(s->num_rtr_rc_windows * s->params->radix * num_qos_levels, sizeof(int));
int * tmp2 = (int*)calloc(s->num_rtr_rc_windows * s->params->radix * num_qos_levels, sizeof(int)); unsigned long long * tmp2 = (unsigned long long*)calloc(s->num_rtr_rc_windows * s->params->radix * num_qos_levels, sizeof(unsigned long long));
/* now copy elements one by one. can't use memcpy with 2d array. */ /* now copy elements one by one. can't use memcpy with 2d array. */
for(int i = 0; i < num_rtr_rc_windows; i++) for(int i = 0; i < num_rtr_rc_windows; i++)
{ {
...@@ -1678,7 +1678,7 @@ void issue_bw_monitor_event(terminal_state * s, tw_bf * bf, terminal_plus_messag ...@@ -1678,7 +1678,7 @@ void issue_bw_monitor_event(terminal_state * s, tw_bf * bf, terminal_plus_messag
{ {
s->num_term_rc_windows *= 2; s->num_term_rc_windows *= 2;
int * tmp1 = (int*)calloc(s->num_term_rc_windows * num_qos_levels, sizeof(int)); int * tmp1 = (int*)calloc(s->num_term_rc_windows * num_qos_levels, sizeof(int));
int * tmp2 = (int*)calloc(s->num_term_rc_windows * num_qos_levels, sizeof(int)); unsigned long long * tmp2 = (unsigned long long*)calloc(s->num_term_rc_windows * num_qos_levels, sizeof(unsigned long long));
/* now copy elements one by one. can't use memcpy with 2d array. */ /* now copy elements one by one. can't use memcpy with 2d array. */
for(int i = 0; i < s->num_term_rc_windows; i++) for(int i = 0; i < s->num_term_rc_windows; i++)
......
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