Commit 4edd57c3 authored by Misbah Mubarak's avatar Misbah Mubarak

(i) Adding sampling for dragonfly compute node LPs (ii) Adding file I/O reader...

(i) Adding sampling for dragonfly compute node LPs (ii) Adding file I/O reader that translates the binary format to text
parent f0c850cc
......@@ -65,19 +65,18 @@ struct terminal_message
int sender_radix;
int output_chan;
model_net_event_return event_rc;
int is_pull;
uint64_t pull_size;
int is_pull;
uint64_t pull_size;
/* for reverse computation */
int path_type;
tw_stime saved_available_time;
tw_stime saved_avg_time;
tw_stime saved_rcv_time;
tw_stime saved_busy_time;
tw_stime saved_total_time;
tw_stime saved_hist_start_time;
tw_stime saved_sample_time;
tw_stime msg_start_time;
int saved_hist_num;
......@@ -91,8 +90,6 @@ struct terminal_message
/* LP ID of the sending node, has to be a network node in the dragonfly */
tw_lpid sender_node;
tw_lpid next_stop;
struct dfly_qhash_entry * saved_hash;
};
#endif /* end of include guard: DRAGONFLY_H */
......
......@@ -23,6 +23,6 @@ PARAMS
local_bandwidth="5.25";
global_bandwidth="4.7";
cn_bandwidth="5.25";
message_size="552";
message_size="560";
routing="adaptive";
}
......@@ -157,7 +157,7 @@ void nw_test_init(nw_state* s, tw_lp* lp)
params = (char*)&params_d;
}
/* In this case, the LP will not generate any workload related events*/
if(s->nw_id >= params_d.num_net_traces)
if(s->nw_id >= (tw_lpid)params_d.num_net_traces)
{
//printf("\n network LP not generating events %d ", (int)s->nw_id);
return;
......
......@@ -1179,7 +1179,7 @@ void nw_test_finalize(nw_state* s, tw_lp* lp)
int written = 0;
if(!s->nw_id)
written = sprintf(s->output_buf, "# Format <LP ID> <Terminal ID> <Total sends> <Total Recvs> <Bytes sent> <Bytes recvd> <Send time> <Comm. time> <Compute time>");
if(s->nw_id < num_net_traces)
if(s->nw_id < (tw_lpid)num_net_traces)
{
int count_irecv = qlist_count(&s->pending_recvs_queue);
int count_isend = qlist_count(&s->arrival_queue);
......@@ -1314,6 +1314,7 @@ int main( int argc, char** argv )
net_id = *net_ids;
free(net_ids);
//model_net_enable_sampling(5000000, g_tw_ts_end);
codes_mapping_setup();
......
......@@ -343,8 +343,6 @@ int main(
tw_opt_add(app_opt);
tw_init(&argc, &argv);
g_tw_ts_end = s_to_ns(60*60*24*365); /* one year, in nsecs */
if(argc < 2)
{
printf("\n Usage: mpirun <args> --sync=2/3 mapping_file_name.conf (optional --nkp) ");
......@@ -367,6 +365,10 @@ int main(
net_id = *net_ids;
free(net_ids);
/* 5 days of simulation time */
g_tw_ts_end = s_to_ns(5 * 24 * 60 * 60);
//model_net_enable_sampling(8000, 10000);
if(net_id != DRAGONFLY)
{
printf("\n The test works with dragonfly model configuration only! ");
......
This diff is collapsed.
/* usage mpirun -np n ./read_file_io
n is the number of input bgp-log files */
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <mpi.h>
struct dfly_samples
{
uint64_t terminal_id;
long fin_chunks_sample;
long data_size_sample;
double fin_hops_sample;
double fin_chunks_time;
double busy_time_sample;
double end_time;
};
static struct dfly_samples * event_array = NULL;
int main( int argc, char** argv )
{
int my_rank;
int size;
int i = 0;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
FILE* pFile;
FILE* writeFile;
char buffer_read[64];
char buffer_write[64];
sprintf(buffer_read, "dragonfly-sampling-%d.bin", my_rank);
pFile = fopen(buffer_read, "r+");
struct stat st;
stat(buffer_read, &st);
long in_sz = st.st_size;
event_array = malloc(in_sz);
sprintf(buffer_write, "dragonfly-write-log.%d", my_rank);
writeFile = fopen(buffer_write, "w+");
if(pFile == NULL || writeFile == NULL)
{
fputs("\n File error ", stderr);
return -1;
}
fseek(pFile, 0L, SEEK_SET);
fread(event_array, sizeof(struct dfly_samples), in_sz / sizeof(struct dfly_samples), pFile);
fprintf(writeFile, " Rank ID \t Finished chunks \t Data size \t Finished hops \t Time spent \t Busy time \t Sample end time");
for(i = 0; i < in_sz / sizeof(struct dfly_samples); i++)
{
fprintf(writeFile, "\n %ld \t %ld \t %ld \t %lf \t %lf \t %lf \t %lf ", event_array[i].terminal_id,
event_array[i].fin_chunks_sample,
event_array[i].data_size_sample,
event_array[i].fin_hops_sample,
event_array[i].fin_chunks_time,
event_array[i].busy_time_sample,
event_array[i].end_time);
}
fclose(pFile);
fclose(writeFile);
MPI_Finalize();
}
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