From 887dc82c0493fa2563136e4950a91cf15bd3a73a Mon Sep 17 00:00:00 2001 From: mubarak Date: Tue, 18 Jul 2017 10:03:37 -0400 Subject: [PATCH] Adding threshold for dumpi traces, fixing background traffic reverse handler --- .../modelnet-test-dragonfly-theta.conf | 4 ++-- src/network-workloads/model-net-mpi-replay.c | 9 +++++++-- .../methods/codes-dumpi-trace-nw-wrkld.c | 17 ++++++++++++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/network-workloads/conf/dragonfly-custom/modelnet-test-dragonfly-theta.conf b/src/network-workloads/conf/dragonfly-custom/modelnet-test-dragonfly-theta.conf index e983ce4..e2e61e2 100644 --- a/src/network-workloads/conf/dragonfly-custom/modelnet-test-dragonfly-theta.conf +++ b/src/network-workloads/conf/dragonfly-custom/modelnet-test-dragonfly-theta.conf @@ -13,13 +13,13 @@ LPGROUPS PARAMS { # packet size in the network - packet_size="1024"; + packet_size="2048"; modelnet_order=( "dragonfly_custom","dragonfly_custom_router" ); # scheduler options modelnet_scheduler="fcfs"; # chunk size in the network (when chunk size = packet size, packets will not be # divided into chunks) - chunk_size="1024"; + chunk_size="2048"; # modelnet_scheduler="round-robin"; # number of routers within each group # this is dictated by the dragonfly configuration files diff --git a/src/network-workloads/model-net-mpi-replay.c b/src/network-workloads/model-net-mpi-replay.c index 59de538..df647c6 100644 --- a/src/network-workloads/model-net-mpi-replay.c +++ b/src/network-workloads/model-net-mpi-replay.c @@ -423,7 +423,11 @@ static void notify_background_traffic_rc( (void)ns; (void)bf; (void)m; - tw_rand_reverse_unif(lp->rng); + + int num_jobs = codes_jobmap_get_num_jobs(jobmap_ctx); + + for(int i = 0; i < num_jobs - 1; i++) + tw_rand_reverse_unif(lp->rng); } static void notify_background_traffic( @@ -2591,7 +2595,8 @@ int modelnet_mpi_replay(MPI_Comm comm, int* argc, char*** argv ) int ret = lp_io_flush(io_handle, MPI_COMM_CODES); assert(ret == 0 || !"lp_io_flush failure"); } - printf("\n Synthetic traffic stats: data received per proc %lf bytes \n", g_total_syn_data/num_syn_clients); + if(is_synthetic) + printf("\n Synthetic traffic stats: data received per proc %lf bytes \n", g_total_syn_data/num_syn_clients); model_net_report_stats(net_id); diff --git a/src/workload/methods/codes-dumpi-trace-nw-wrkld.c b/src/workload/methods/codes-dumpi-trace-nw-wrkld.c index 04f44e5..812d6c3 100644 --- a/src/workload/methods/codes-dumpi-trace-nw-wrkld.c +++ b/src/workload/methods/codes-dumpi-trace-nw-wrkld.c @@ -46,6 +46,7 @@ extern struct codes_jobmap_ctx *jobmap_ctx; static struct qhash_table *rank_tbl = NULL; static int rank_tbl_pop = 0; +static unsigned int max_threshold = INT_MAX; /* context of the MPI workload */ typedef struct rank_mpi_context { @@ -54,6 +55,7 @@ typedef struct rank_mpi_context // whether we've seen an init op (needed for timing correctness) int is_init; int num_reqs; + unsigned int num_ops; int64_t my_rank; double last_op_time; double init_time; @@ -785,6 +787,7 @@ int dumpi_trace_nw_workload_load(const char* params, int app_id, int rank) my_ctx->is_init = 0; my_ctx->num_reqs = 0; my_ctx->dumpi_mpi_array = dumpi_init_op_data(); + my_ctx->num_ops = 0; if(rank < 10) sprintf(file_name, "%s000%d.bin", dumpi_params->file_name, rank); @@ -931,8 +934,20 @@ int dumpi_trace_nw_workload_load(const char* params, int app_id, int rank) while(active && !finalize_reached) { num_calls++; + my_ctx->num_ops++; #ifdef ENABLE_CORTEX - active = cortex_undumpi_read_single_call(profile, callarr, transarr, (void*)my_ctx, &finalize_reached); + if(my_ctx->num_ops < max_threshold) + active = cortex_undumpi_read_single_call(profile, callarr, transarr, (void*)my_ctx, &finalize_reached); + else + { + struct codes_workload_op op; + op.op_type = CODES_WK_END; + + op.start_time = my_ctx->last_op_time; + op.end_time = my_ctx->last_op_time + 1; + dumpi_insert_next_op(my_ctx->dumpi_mpi_array, &op); + break; + } #else active = undumpi_read_single_call(profile, callarr, (void*)my_ctx, &finalize_reached); #endif -- 2.26.2