Commit b2b6666b authored by Noah Wolfe's avatar Noah Wolfe Committed by Nikhil

Misc stats collection updates

- Add injection load functionality to workload file
- Correspondingly adjusted stats collection to include load
- Cleaned up log file offsets to match header
parent 43d9a5b4
......@@ -27,7 +27,8 @@ static int num_servers = 0;
static int offset = 2;
static int traffic = 1;
static double arrival_time = 1000.0;
static double load = 0.0; //Percent utilization of terminal uplink
static double MEAN_INTERVAL = 0.0;
/* whether to pull instead of push */
static int do_pull = 0;
......@@ -47,6 +48,21 @@ static char group_name[MAX_NAME_LENGTH];
static char lp_type_name[MAX_NAME_LENGTH];
static int group_index, lp_type_index, rep_id, offset;
/* convert GiB/s and bytes to ns */
static tw_stime bytes_to_ns(uint64_t bytes, double GB_p_s)
{
tw_stime time;
/* bytes to GB */
time = ((double)bytes)/(1024.0*1024.0*1024.0);
/* GiB to s */
time = time / GB_p_s;
/* s to ns */
time = time * 1000.0 * 1000.0 * 1000.0;
return(time);
}
/* type of events */
enum svr_event
{
......@@ -111,6 +127,7 @@ const tw_optdef app_opt [] =
TWOPT_GROUP("Model net synthetic traffic " ),
TWOPT_UINT("traffic", traffic, "UNIFORM RANDOM=1, NEAREST NEIGHBOR=2 "),
TWOPT_STIME("arrival_time", arrival_time, "INTER-ARRIVAL TIME"),
TWOPT_STIME("load", load, "percentage of terminal link bandiwdth to inject packets"),
TWOPT_END()
};
......@@ -136,8 +153,34 @@ static void issue_event(
* simulation
*/
int this_packet_size = 0;
double this_link_bandwidth = 0.0;
configuration_get_value_int(&config, "PARAMS", "packet_size", NULL, &this_packet_size);
if(!this_packet_size) {
this_packet_size = 0;
fprintf(stderr, "Packet size not specified, setting to %d\n", this_packet_size);
exit(0);
}
configuration_get_value_double(&config, "PARAMS", "link_bandwidth", NULL, &this_link_bandwidth);
if(!this_link_bandwidth) {
this_link_bandwidth = 4.7;
fprintf(stderr, "Bandwidth of channels not specified, setting to %lf\n", this_link_bandwidth);
}
if(arrival_time!=0)
{
MEAN_INTERVAL = arrival_time;
}
if(load != 0)
{
MEAN_INTERVAL = bytes_to_ns(this_packet_size, load*this_link_bandwidth);
}
/* skew each kickoff event slightly to help avoid event ties later on */
kickoff_time = 1.1 * g_tw_lookahead + tw_rand_exponential(lp->rng, arrival_time);
// kickoff_time = 1.1 * g_tw_lookahead + tw_rand_exponential(lp->rng, arrival_time);
kickoff_time = g_tw_lookahead + tw_rand_exponential(lp->rng, MEAN_INTERVAL);
e = tw_event_new(lp->gid, kickoff_time, lp);
m = tw_event_data(e);
......@@ -412,8 +455,8 @@ int main(
if(fattree_results_log_header == NULL)
printf("\n Failed to open results log header file %s in synthetic-fattree\n",temp_filename_header);
printf("Printing Simulation Parameters/Results Log File\n");
fprintf(fattree_results_log_header,", <Workload>, ");
fprintf(fattree_results_log,"%16.3d, ",traffic);
fprintf(fattree_results_log_header,", <Workload>, <Load>, <Mean Interval>, ");
fprintf(fattree_results_log,"%11.3d, %5.2f, %15.2f, ",traffic, load, MEAN_INTERVAL);
fclose(fattree_results_log_header);
fclose(fattree_results_log);
}
......@@ -489,7 +532,7 @@ int main(
idx++;
}
fprintf(fattree_results_log_header,"<Total Events>, <Rollbacks>, <GVT Computations>, <Net Events>, <Running Time>, <Efficiency>, <Event Rate>");
fprintf(fattree_results_log,"%12llu, %10llu, %16d, %10llu, %17.4f, %10.2f, %22.2f\n",total_events,rollbacks,gvt_computations,net_events,running_time,efficiency,event_rate);
fprintf(fattree_results_log,"%14llu, %11llu, %18d, %12llu, %14.4f, %12.2f, %12.2f\n",total_events,rollbacks,gvt_computations,net_events,running_time,efficiency,event_rate);
fclose(fattree_results_log);
fclose(fattree_results_log_header);
fclose(fattree_ross_csv_log);
......
......@@ -1014,7 +1014,7 @@ static void fattree_report_stats()
printf("\n Failed to open results log header file %s \n",temp_filename_header);
printf("Printing Simulation Parameters/Results Log File\n");
fprintf(fattree_results_log_header,"<Avg Hops/Total Packets>, <Avg Time/Total Packets>, <Max Latency>, <Total Finished Chunks>");
fprintf(fattree_results_log,"%10.3lf, %15.3lf, %11.3lf, %16.3lld, ", (float)avg_hops/total_finished_packets, avg_time/(total_finished_packets),max_time,total_finished_chunks);
fprintf(fattree_results_log,"%24.3lf, %24.3lf, %13.3lf, %23.3lld, ", (float)avg_hops/total_finished_packets, avg_time/(total_finished_packets),max_time,total_finished_chunks);
fclose(fattree_results_log_header);
fclose(fattree_results_log);
#endif
......@@ -2224,22 +2224,22 @@ void fattree_terminal_final( ft_terminal_state * s, tw_lp * lp )
if(fattree_results_log_header == NULL)
printf("\n Failed to open results log header file %s in terminal_final\n",temp_filename_header);
printf("Printing Simulation Parameters/Results Log File\n");
fprintf(fattree_results_log_header," <Num Levels>,");
fprintf(fattree_results_log," %3d,",s->params->num_levels);
fprintf(fattree_results_log_header,"<Num Levels>,");
fprintf(fattree_results_log," %11d,",s->params->num_levels);
for(int j=0; j<s->params->num_levels; j++)
{
fprintf(fattree_results_log_header," <L%d Switch Radix>,",j);
fprintf(fattree_results_log," %9d,",s->params->switch_radix[j]);
fprintf(fattree_results_log," %17d,",s->params->switch_radix[j]);
}
for(int j=0; j<s->params->num_levels; j++)
{
fprintf(fattree_results_log_header," <L%d Num Switches>,",j);
fprintf(fattree_results_log," %9d,",s->params->num_switches[j]);
fprintf(fattree_results_log," %17d,",s->params->num_switches[j]);
temp_num_switches += s->params->num_switches[j];
}
fprintf(fattree_results_log_header,"<Num Terminals>, <Num Switches>, <Synch>, <Num LPs>, <Sim End Time>, <Batch Size>, <GVT Interval>, <Num KP>, ");
fprintf(fattree_results_log,"%10.3d, %9d, %9.3d, %11.3d, %5.3d, %12.3d, %10.3d, %8.3d, ", (s->params->switch_radix[0]/2)*s->params->num_switches[0],temp_num_switches, g_tw_synchronization_protocol, tw_nnodes(),(int)g_tw_ts_end,(int)g_tw_mblock,(int)g_tw_gvt_interval, (int)g_tw_nkp);
fprintf(fattree_results_log,"%15.3d, %14d, %7.3d, %9.3d, %14.3d, %12.3d, %14.3d, %8.3d, ", (s->params->switch_radix[0]/2)*s->params->num_switches[0],temp_num_switches, g_tw_synchronization_protocol, tw_nnodes(),(int)g_tw_ts_end,(int)g_tw_mblock,(int)g_tw_gvt_interval, (int)g_tw_nkp);
fclose(fattree_results_log_header);
fclose(fattree_results_log);
#endif
......
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