From 49d4681dedc0b4440bb7831b4e348c64731b235e Mon Sep 17 00:00:00 2001 From: mubarak Date: Tue, 26 Jan 2016 16:40:56 -0500 Subject: [PATCH] Updating documentation for sampling, minor file open fixes --- src/network-workloads/README_synthetic.txt | 12 ++++++++++++ .../conf/modelnet-synthetic-dragonfly.conf | 6 +++--- src/networks/model-net/dragonfly.c | 6 +++--- src/networks/model-net/read-dragonfly-sample.c | 4 ++-- tests/conf/modelnet-test-dragonfly.conf | 2 -- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/network-workloads/README_synthetic.txt b/src/network-workloads/README_synthetic.txt index 7c08dc4..a49a320 100644 --- a/src/network-workloads/README_synthetic.txt +++ b/src/network-workloads/README_synthetic.txt @@ -8,6 +8,18 @@ This pattern performs better with non-minimal and adaptive routing algorithms. - Nearest neighbor traffic: it sends traffic to the next node, potentially connected to the same router. + +SAMPLING: + - The modelnet_enable_sampling function takes a sampling interval "t" and + an end time. Over this end time, dragonfly model will collect compute + node and router samples after every "t" simulated nanoseconds. The + sampling output files can be specified in the config file using + cn_sample_file and rt_sample_file arguments. An example utility that + reads the binary files and translates it into text can be found at + src/networks/model-net/read-dragonfly-sample.c (Note that the router + radix aka RADIX needs to be tuned with the dragonfly configuration + in the utility to enable continguous array allocation). + HOW TO RUN: ROSS optimistic mode: diff --git a/src/network-workloads/conf/modelnet-synthetic-dragonfly.conf b/src/network-workloads/conf/modelnet-synthetic-dragonfly.conf index 82ea7f0..a4c5c77 100644 --- a/src/network-workloads/conf/modelnet-synthetic-dragonfly.conf +++ b/src/network-workloads/conf/modelnet-synthetic-dragonfly.conf @@ -5,13 +5,13 @@ LPGROUPS repetitions="264"; server="4"; modelnet_dragonfly="4"; - dragonfly_router="1"; + modelnet_dragonfly_router="1"; } } PARAMS { packet_size="512"; - modelnet_order=( "dragonfly" ); + modelnet_order=( "dragonfly", "dragonfly_router" ); # scheduler options modelnet_scheduler="fcfs"; chunk_size="32"; @@ -25,5 +25,5 @@ PARAMS global_bandwidth="4.7"; cn_bandwidth="5.25"; message_size="512"; - routing="nonminimal"; + routing="adaptive"; } diff --git a/src/networks/model-net/dragonfly.c b/src/networks/model-net/dragonfly.c index 1797839..37c0d29 100644 --- a/src/networks/model-net/dragonfly.c +++ b/src/networks/model-net/dragonfly.c @@ -2001,7 +2001,7 @@ void dragonfly_rsample_fin(router_state * s, int j = 0; int size_sample = sizeof(tw_lpid) + p->radix * (sizeof(int64_t) + sizeof(tw_stime)) + sizeof(tw_stime); - FILE * fp = fopen(cn_fn, "wa"); + FILE * fp = fopen(cn_fn, "a"); fseek(fp, sample_rtr_bytes_written, SEEK_SET); for(; i < s->op_arr_size; i++) @@ -2145,12 +2145,12 @@ void dragonfly_sample_fin(terminal_state * s, fclose(fp); } char rt_fn[MAX_NAME_LENGTH]; - if(strncmp(router_sample_file, "", 10) == 0) + if(strncmp(cn_sample_file, "", 10) == 0) sprintf(rt_fn, "dragonfly-cn-sampling-%ld.bin", g_tw_mynode); else sprintf(rt_fn, "%s-%ld.bin", cn_sample_file, g_tw_mynode); - FILE * fp = fopen(rt_fn, "wa"); + FILE * fp = fopen(rt_fn, "a"); fseek(fp, sample_bytes_written, SEEK_SET); fwrite(s->sample_stat, sizeof(struct dfly_cn_sample), s->op_arr_size, fp); fclose(fp); diff --git a/src/networks/model-net/read-dragonfly-sample.c b/src/networks/model-net/read-dragonfly-sample.c index 9f36669..8fe7ca1 100644 --- a/src/networks/model-net/read-dragonfly-sample.c +++ b/src/networks/model-net/read-dragonfly-sample.c @@ -53,7 +53,7 @@ int main( int argc, char** argv ) char buffer_read[64]; char buffer_write[64]; - sprintf(buffer_read, "dragonfly-cn-sampling-%d.bin", my_rank); + sprintf(buffer_read, "dragonfly-sample-ur-%d.bin", my_rank); pFile = fopen(buffer_read, "r+"); struct stat st; @@ -90,7 +90,7 @@ int main( int argc, char** argv ) char buffer_rtr_read[64]; char buffer_rtr_write[64]; - sprintf(buffer_rtr_read, "dragonfly-router-sampling-%d.bin", my_rank); + sprintf(buffer_rtr_read, "dragonfly-router-ur-%d.bin", my_rank); pFile = fopen(buffer_rtr_read, "r+"); struct stat st2; diff --git a/tests/conf/modelnet-test-dragonfly.conf b/tests/conf/modelnet-test-dragonfly.conf index ae49e1c..7c754a9 100644 --- a/tests/conf/modelnet-test-dragonfly.conf +++ b/tests/conf/modelnet-test-dragonfly.conf @@ -25,6 +25,4 @@ PARAMS cn_bandwidth="5.25"; message_size="368"; routing="nonminimal"; - cn_sample_file = "dragonfly-sample-ur"; - rt_sample_file = "dragonfly-router-ur"; } -- 2.26.2