Commit 1f87f5ba authored by Misbah Mubarak's avatar Misbah Mubarak

Adding function definitions for getting node/router counts, adding missing...

Adding function definitions for getting node/router counts, adding missing function in dragonfly-topology struct, moving and updatign topology-test
parent 24aced8c
......@@ -179,7 +179,7 @@ src_util_templates_lp_template_dummy_main_SOURCES = \
# get rid of annoying unused function in template
bin_PROGRAMS += src/workload/codes-workload-dump
bin_PROGRAMS += src/networks/topology-test
bin_PROGRAMS += src/networks/model-net/topology-test
bin_PROGRAMS += src/network-workloads/model-net-mpi-replay
bin_PROGRAMS += src/network-workloads/model-net-dumpi-traces-dump
bin_PROGRAMS += src/network-workloads/model-net-synthetic
......@@ -198,7 +198,7 @@ src_network_workloads_model_net_mpi_replay_SOURCES = \
src_network_workloads_model_net_mpi_replay_CFLAGS = $(AM_CFLAGS)
src_network_workloads_model_net_synthetic_SOURCES = src/network-workloads/model-net-synthetic.c
src_network_workloads_model_net_synthetic_custom_dfly_SOURCES = src/network-workloads/model-net-synthetic-custom-dfly.c
src_networks_topology_test_SOURCES = src/networks/topology-test.c
src_networks_model_net_topology_test_SOURCES = src/networks/model-net/topology-test.c
#bin_PROGRAMS += src/network-workload/codes-nw-test
......
......@@ -26,7 +26,7 @@
#include <cortex/topology.h>
#endif
#define DUMP_CONNECTIONS 1
#define DUMP_CONNECTIONS 0
#define CREDIT_SIZE 8
#define DFLY_HASH_TABLE_SIZE 4999
......@@ -3226,13 +3226,21 @@ struct model_net_method dragonfly_custom_router_method =
#ifdef ENABLE_CORTEX
static int dragonfly_custom_get_number_of_compute_nodes(void* topo) {
// TODO
return -1;
const dragonfly_param * params = &all_params[num_params-1];
if(!params)
return -1.0;
return params->total_terminals;
}
static int dragonfly_custom_get_number_of_routers(void* topo) {
// TODO
return -1;
const dragonfly_param * params = &all_params[num_params-1];
if(!params)
return -1.0;
return params->total_routers;
}
static double dragonfly_custom_get_router_link_bandwidth(void* topo, router_id_t r1, router_id_t r2) {
......@@ -3478,7 +3486,7 @@ static void dragonfly_custom_get_router_compute_node_list(void* topo, router_id_
// connected to this router. It is assumed that enough memory has been allocated for the
// "nodes" variable to hold all the ids.
const dragonfly_param * params = &all_params[num_params-1];
for(int i = 0; i < params->num_cn; i++)
nodes[i] = r * params->num_cn + i;
}
......@@ -3509,6 +3517,7 @@ cortex_topology dragonfly_custom_cortex_topology = {
// .get_router_compute_node_count =
dragonfly_custom_get_router_compute_node_count,
// .get_router_compute_node_list = dragonfly_custom_get_router_compute_node_list,
dragonfly_custom_get_router_compute_node_list
};
}
......
......@@ -6,13 +6,17 @@
#include "codes/codes.h"
#include <cortex/topology.h>
#include "codes/model-net.h"
/* TODO: Replace NUM_NODES and num_routers once we have functions to fetch
* topology node and router counts. Right now it is hard coded for Theta. */
#define NUM_NODES 3456
extern struct cortex_topology dragonfly_custom_cortex_topology;
int main(int argc, char** argv) {
if(argc < 2)
{
printf("\n Usage: %s dragonfly-config-file ", argv[0]);
return -1;
}
int* net_ids;
int num_nets;
......@@ -28,7 +32,6 @@ int main(int argc, char** argv) {
/* TODO: Replace NUM_NODES and num_routers once we have functions to fetch
* topology node and router counts. Right now it is hard coded for Theta. */
int num_routers = NUM_NODES/4;
void * topo_arg = NULL;
double local_bandwidth, global_bandwidth, cn_bandwidth;
......@@ -42,6 +45,10 @@ int main(int argc, char** argv) {
configuration_get_value_double(&config, "PARAMS", "global_bandwidth", NULL, &global_bandwidth);
configuration_get_value_double(&config, "PARAMS", "cn_bandwidth", NULL, &cn_bandwidth);
int num_routers = dragonfly_custom_cortex_topology.get_number_of_routers(topo_arg);
int total_cns = dragonfly_custom_cortex_topology.get_number_of_compute_nodes(topo_arg);
printf("\n Aggregate number of routers %d number of cns %d ", num_routers, total_cns);
/* First check for the same rows */
for(int i = 0; i < num_router_cols - 1; i++)
{
......@@ -99,13 +106,12 @@ int main(int argc, char** argv) {
for(int i = grp1_offset; i < grp1_offset + num_router_cols; i++)
{
int num_neighbors = dragonfly_custom_cortex_topology.get_router_neighbor_count(topo_arg, i);
//printf("\n Router %d Number of neighbors %d ", i, num_neighbors);
assert(num_neighbors == 22);
router_id_t * routers = malloc(num_neighbors * sizeof(router_id_t));
dragonfly_custom_cortex_topology.get_router_neighbor_list(topo_arg, i, routers);
if(i == 0)
if(i == grp1_offset)
{
for(int j = 0; j < num_neighbors; j++)
printf("\n Router id %d ", routers[j]);
......
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