Commit 45b4630b authored by Misbah Mubarak's avatar Misbah Mubarak

cleanup synthetic traffic pattern code

parent ba8d7172
lib_LIBRARIES += src/libcodes-net.a
EXTRA_DIST += \
src/models/mpi-trace-replay/README.txt \
src/models/mpi-trace-replay/conf/modelnet-mpi-test.conf \
src/models/mpi-trace-replay/conf/modelnet-mpi-test-cry-router.conf \
src/models/mpi-trace-replay/conf/modelnet-mpi-test-dragonfly.conf \
src/models/mpi-trace-replay/conf/modelnet-mpi-test-mini-fe.conf \
src/models/mpi-trace-replay/conf/modelnet-mpi-test-torus.conf \
src/models/network-workloads/README.txt \
src/models/network-workloads/conf/modelnet-mpi-test.conf \
src/models/network-workloads/conf/modelnet-mpi-test-cry-router.conf \
src/models/network-workloads/conf/modelnet-mpi-test-dragonfly.conf \
src/models/network-workloads/conf/modelnet-mpi-test-mini-fe.conf \
src/models/network-workloads/conf/modelnet-mpi-test-torus.conf \
src/models/networks/model-net/doc/README \
src/models/networks/model-net/doc/README.dragonfly.txt \
src/models/networks/model-net/doc/README.loggp.txt \
......@@ -37,26 +37,26 @@ src_libcodes_net_a_SOURCES = \
src/models/networks/model-net/model-net-sched.c \
src/models/networks/model-net/model-net-sched-impl.h \
src/models/networks/model-net/model-net-sched-impl.c \
src/models/mpi-trace-replay/model-net-mpi-wrklds.c \
src/models/mpi-trace-replay/model-net-synthetic.c \
src/models/mpi-trace-replay/model-net-dumpi-traces-dump.c
bin_PROGRAMS += src/models/mpi-trace-replay/model-net-mpi-wrklds
bin_PROGRAMS += src/models/mpi-trace-replay/model-net-dumpi-traces-dump
bin_PROGRAMS += src/models/mpi-trace-replay/model-net-synthetic
src_models_mpi_trace_replay_model_net_mpi_wrklds_SOURCES = src/models/mpi-trace-replay/model-net-mpi-wrklds.c
src_models_mpi_trace_replay_model_net_mpi_wrklds_LDADD = $(testlib) $(CODES_BASE_LIBS)
src_models_mpi_trace_replay_model_net_mpi_wrklds_LDFLAGS = $(CODES_BASE_LDFLAGS)
src_models_mpi_trace_replay_model_net_mpi_wrklds_CFLAGS = ${CODES_BASE_CFLAGS}
src_models_mpi_trace_replay_model_net_synthetic_SOURCES = src/models/mpi-trace-replay/model-net-synthetic.c
src_models_mpi_trace_replay_model_net_synthetic_LDADD = $(testlib) $(CODES_BASE_LIBS)
src_models_mpi_trace_replay_model_net_synthetic_LDFLAGS = $(CODES_BASE_LDFLAGS)
src_models_mpi_trace_replay_model_net_synthetic_CFLAGS = ${CODES_BASE_CFLAGS}
src_models_mpi_trace_replay_model_net_dumpi_traces_dump_SOURCES = src/models/mpi-trace-replay/model-net-dumpi-traces-dump.c
src_models_mpi_trace_replay_model_net_dumpi_traces_dump_LDADD = $(testlib) $(CODES_BASE_LIBS)
src_models_mpi_trace_replay_model_net_dumpi_traces_dump_LDFLAGS = $(CODES_BASE_LDFLAGS)
src_models_mpi_trace_replay_model_net_dumpi_traces_dump_CFLAGS = ${CODES_BASE_CFLAGS}
src/models/network-workloads/model-net-mpi-wrklds.c \
src/models/network-workloads/model-net-synthetic.c \
src/models/network-workloads/model-net-dumpi-traces-dump.c
bin_PROGRAMS += src/models/network-workloads/model-net-mpi-wrklds
bin_PROGRAMS += src/models/network-workloads/model-net-dumpi-traces-dump
bin_PROGRAMS += src/models/network-workloads/model-net-synthetic
src_models_network_workloads_model_net_mpi_wrklds_SOURCES = src/models/network-workloads/model-net-mpi-wrklds.c
src_models_network_workloads_model_net_mpi_wrklds_LDADD = $(testlib) $(CODES_BASE_LIBS)
src_models_network_workloads_model_net_mpi_wrklds_LDFLAGS = $(CODES_BASE_LDFLAGS)
src_models_network_workloads_model_net_mpi_wrklds_CFLAGS = ${CODES_BASE_CFLAGS}
src_models_network_workloads_model_net_synthetic_SOURCES = src/models/network-workloads/model-net-synthetic.c
src_models_network_workloads_model_net_synthetic_LDADD = $(testlib) $(CODES_BASE_LIBS)
src_models_network_workloads_model_net_synthetic_LDFLAGS = $(CODES_BASE_LDFLAGS)
src_models_network_workloads_model_net_synthetic_CFLAGS = ${CODES_BASE_CFLAGS}
src_models_network_workloads_model_net_dumpi_traces_dump_SOURCES = src/models/network-workloads/model-net-dumpi-traces-dump.c
src_models_network_workloads_model_net_dumpi_traces_dump_LDADD = $(testlib) $(CODES_BASE_LIBS)
src_models_network_workloads_model_net_dumpi_traces_dump_LDFLAGS = $(CODES_BASE_LDFLAGS)
src_models_network_workloads_model_net_dumpi_traces_dump_CFLAGS = ${CODES_BASE_CFLAGS}
************ Synthetic traffic with dragonfly network model **********
- traffic patterns supported: uniform random and nearest neighbor traffic.
- traffic patterns supported: uniform random, nearest neighbor traffic.
- Uniform random traffic: sends messages to a randomly selected destination node. It is uniformly distributed throughout the network and gives a better performance with minimal routing and therefore higher simulation event rate.
- Nearest neighbor traffic: with minimal routing, it sends traffic to the single global channel connecting two groups (it congests the network when using minimal routing). May have a low simulation event rate because of the congestion being simulated.
- Nearest group traffic: with minimal routing, it sends traffic to the single global channel connecting two groups (it congests the network when using minimal routing). May have a low simulation event rate because of the congestion being simulated.
- Nearest neighbor traffic: it sends traffic to the next node, potentially connected to the same router.
HOW TO RUN:
ROSS optimistic mode:
......@@ -14,4 +14,4 @@ ROSS serial mode:
options:
arrival_time: inter-arrival time between the messages. Smaller inter-arrival time means messages will arrive more frequently (smaller inter-arrival time can cause congestion in the network and may overflow the network buffers).
traffic: 1 for uniform random traffic, 2 for nearest neighbor traffic.
traffic: 1 for uniform random traffic, 2 for nearest group traffic and 3 for nearest neighbor traffic.
......@@ -6,6 +6,7 @@
/*
* The test program generates some synthetic traffic patterns for the model-net network models.
* currently it only support the dragonfly network model uniform random and nearest neighbor traffic patterns.
*/
#include "codes/model-net.h"
......@@ -27,9 +28,13 @@ static double arrival_time = 1000.0;
/* whether to pull instead of push */
static int do_pull = 0;
static int num_routers_per_rep = 0;
static int num_servers_per_rep = 0;
static int num_routers_per_grp = 0;
static int num_nodes_per_grp = 0;
static int num_reps = 0;
static int num_groups = 0;
static int num_nodes = 0;
typedef struct svr_msg svr_msg;
typedef struct svr_state svr_state;
......@@ -50,8 +55,9 @@ enum svr_event
/* type of synthetic traffic */
enum TRAFFIC
{
UNIFORM = 1,
NEAREST_NEIGHBOR = 2
UNIFORM = 1, /* sends message to a randomly selected node */
NEAREST_GROUP = 2, /* sends message to the node connected to the neighboring router */
NEAREST_NEIGHBOR = 3 /* sends message to the next node (potentially connected to the same router) */
};
struct svr_state
......@@ -175,34 +181,26 @@ static void handle_kickoff_event(
ns->start_ts = tw_now(lp);
int num_routers_per_grp;
configuration_get_value_int(&config, "PARAMS", "num_routers", anno, &num_routers_per_grp);
num_servers_per_rep = codes_mapping_get_lp_count("MODELNET_GRP", 1,
"server", NULL, 1);
num_routers_per_rep = codes_mapping_get_lp_count("MODELNET_GRP", 1,
"dragonfly_router", NULL, 1);
int lps_per_rep = num_servers_per_rep * 2 + num_routers_per_rep;
int num_groups = (num_routers_per_grp * (num_routers_per_grp/2) + 1);
int num_nodes = num_groups * num_routers_per_grp * (num_routers_per_grp / 2);
int num_nodes_per_grp = num_routers_per_grp * (num_routers_per_grp / 2);
codes_mapping_get_lp_info(lp->gid, group_name, &group_index, lp_type_name, &lp_type_index, anno, &rep_id, &offset);
/* in case of uniform random traffic, send to a random destination. */
if(traffic == UNIFORM)
{
local_dest = tw_rand_integer(lp->rng, 0, num_nodes - 1);
//printf("\n LP %ld sending to %d ", lp->gid, local_dest);
// printf("\n LP %ld sending to %d ", lp->gid, local_dest);
}
else if(traffic == NEAREST_NEIGHBOR)
else if(traffic == NEAREST_GROUP)
{
local_dest = (rep_id * 2 + offset + num_nodes_per_grp) % num_nodes;
//printf("\n LP %ld sending to %ld num nodes %d ", rep_id * 2 + offset, local_dest, num_nodes);
// printf("\n LP %ld sending to %ld num nodes %d ", rep_id * 2 + offset, local_dest, num_nodes);
}
else if(traffic == NEAREST_NEIGHBOR)
{
local_dest = (rep_id * 2 + offset + 2) % num_nodes;
// printf("\n LP %ld sending to %ld num nodes %d ", rep_id * 2 + offset, local_dest, num_nodes);
}
assert(local_dest < num_nodes);
codes_mapping_get_lp_id(group_name, lp_type_name, anno, 1, local_dest / num_servers_per_rep, local_dest % num_servers_per_rep, &global_dest);
ns->msg_sent_count++;
model_net_event(net_id, "test", global_dest, PAYLOAD_SZ, 0.0, sizeof(svr_msg), (const void*)m_remote, sizeof(svr_msg), (const void*)m_local, lp);
issue_event(ns, lp);
......@@ -322,11 +320,13 @@ int main(
int rank;
int num_nets;
int *net_ids;
char* anno;
lp_io_handle handle;
tw_opt_add(app_opt);
tw_init(&argc, &argv);
offset = 1;
if(argc < 2)
{
......@@ -350,14 +350,19 @@ int main(
net_id = *net_ids;
free(net_ids);
num_servers_per_rep = codes_mapping_get_lp_count("MODELNET_GRP", 0, "server",
NULL, 1);
if(net_id == DRAGONFLY)
if(net_id != DRAGONFLY)
{
num_routers = codes_mapping_get_lp_count("MODELNET_GRP", 0,
"dragonfly_router", NULL, 1);
offset = 1;
printf("\n The test works with dragonfly model configuration only! ");
MPI_Finalize();
return 0;
}
num_servers_per_rep = codes_mapping_get_lp_count("MODELNET_GRP", 1, "server",
NULL, 1);
configuration_get_value_int(&config, "PARAMS", "num_routers", anno, &num_routers_per_grp);
num_groups = (num_routers_per_grp * (num_routers_per_grp/2) + 1);
num_nodes = num_groups * num_routers_per_grp * (num_routers_per_grp / 2);
num_nodes_per_grp = num_routers_per_grp * (num_routers_per_grp / 2);
if(lp_io_prepare("modelnet-test", LP_IO_UNIQ_SUFFIX, &handle, MPI_COMM_WORLD) < 0)
{
......
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