Commit 18a0ae2a authored by Noah Wolfe's avatar Noah Wolfe

Moved input of generator sets to config file.

parent 562bdbbd
...@@ -2,25 +2,27 @@ LPGROUPS ...@@ -2,25 +2,27 @@ LPGROUPS
{ {
MODELNET_GRP MODELNET_GRP
{ {
repetitions="50"; # The number of repetitions of this modelnet group repetitions="50";
server="3"; # The number of servers attached to a terminal (should always equal num_terminals) server="3";
modelnet_slimfly="3"; # The number of terminals attached to a router modelnet_slimfly="3";
slimfly_router="1"; # The number of routers in a modelnet group slimfly_router="1";
} }
} }
PARAMS PARAMS
{ {
packet_size="256"; # Size of packets/messages in the simulation packet_size="256";
modelnet_order=( "slimfly" ); modelnet_order=( "slimfly" );
# scheduler options # scheduler options
modelnet_scheduler="fcfs"; modelnet_scheduler="fcfs";
chunk_size="256"; chunk_size="256";
# modelnet_scheduler="round-robin"; # modelnet_scheduler="round-robin";
num_vcs="4"; num_vcs="4";
num_routers="5"; # The number of routers in a slimfly group num_routers="5";
num_terminals="3"; # The number of terminals connected to a router (should be same as "modelnet_slimfly" above) num_terminals="3";
global_channels="5"; global_channels="5";
local_channels="2"; local_channels="2";
generator_set_X=("1","4"); # : Subgraph 0 generator set
generator_set_X_prime=("2","3"); # : Subgraph 1 generator set
local_vc_size="25600"; local_vc_size="25600";
global_vc_size="25600"; global_vc_size="25600";
cn_vc_size="25600"; cn_vc_size="25600";
...@@ -29,6 +31,6 @@ PARAMS ...@@ -29,6 +31,6 @@ PARAMS
cn_bandwidth="9.0"; cn_bandwidth="9.0";
router_delay="0"; router_delay="0";
link_delay="0"; link_delay="0";
message_size="512"; # Upper bound on MPI message size in ROSS message_size="512";
routing="minimal"; routing="minimal";
} }
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#define DEBUG 1 #define DEBUG 1
#define DEBUG_ROUTING 0 #define DEBUG_ROUTING 0
#define USE_DIRECT_SCHEME 1 #define USE_DIRECT_SCHEME 1
#define LOAD_FROM_FILE 1 #define LOAD_FROM_FILE 0
#define LP_CONFIG_NM (model_net_lp_config_names[SLIMFLY]) #define LP_CONFIG_NM (model_net_lp_config_names[SLIMFLY])
#define LP_METHOD_NM (model_net_method_names[SLIMFLY]) #define LP_METHOD_NM (model_net_method_names[SLIMFLY])
...@@ -48,31 +48,26 @@ ...@@ -48,31 +48,26 @@
#define PARAMS_LOG 1 #define PARAMS_LOG 1
#define N_COLLECT_POINTS 100 #define N_COLLECT_POINTS 100
//MMS7 //MMS7
#define TEMP_NUM_GROUPS 10
#define TEMP_NUM_ROUTERS 50 #define TEMP_NUM_ROUTERS 50
#define TEMP_NUM_TERMINALS 150 #define TEMP_NUM_TERMINALS 150
#define TEMP_RADIX 10 #define TEMP_RADIX 10
#define TEMP_NUM_VC 4 #define TEMP_NUM_VC 4
//MMS19 //MMS19
/*#define TEMP_NUM_GROUPS 26 /*#define TEMP_NUM_ROUTERS 338
#define TEMP_NUM_ROUTERS 338
#define TEMP_NUM_TERMINALS 3042 #define TEMP_NUM_TERMINALS 3042
#define TEMP_RADIX 28 #define TEMP_RADIX 28
#define TEMP_NUM_VC 4 #define TEMP_NUM_VC 4
*///MMS43 *///MMS43
//#define TEMP_NUM_GROUPS 58
//#define TEMP_NUM_ROUTERS 1682 //#define TEMP_NUM_ROUTERS 1682
//#define TEMP_NUM_TERMINALS 18502 //#define TEMP_NUM_TERMINALS 18502
//#define TEMP_RADIX 43 //#define TEMP_RADIX 43
//#define TEMP_NUM_VC 4 //#define TEMP_NUM_VC 4
//MMS55 //MMS55
//#define TEMP_NUM_GROUPS 37
//#define TEMP_NUM_ROUTERS 2738 //#define TEMP_NUM_ROUTERS 2738
//#define TEMP_NUM_TERMINALS 73926 //#define TEMP_NUM_TERMINALS 73926
//#define TEMP_RADIX 82 //#define TEMP_RADIX 82
//#define TEMP_NUM_VC 4 //#define TEMP_NUM_VC 4
//MMS245 //MMS245
//#define TEMP_NUM_GROUPS 326
//#define TEMP_NUM_ROUTERS 53138 //#define TEMP_NUM_ROUTERS 53138
//#define TEMP_NUM_TERMINALS 1009622 //#define TEMP_NUM_TERMINALS 1009622
//#define TEMP_RADIX 263 //#define TEMP_RADIX 263
...@@ -108,8 +103,8 @@ float adaptive_threshold = 0.1; ...@@ -108,8 +103,8 @@ float adaptive_threshold = 0.1;
float pe_throughput_percent = 0.0; float pe_throughput_percent = 0.0;
float pe_throughput = 0.0; float pe_throughput = 0.0;
// MMS7 q=5 Slimfly basic configuration parameters // MMS7 q=5 Slimfly basic configuration parameters
static int X[] = {1,4}; // : Subgraph 0 generator set //static int X[] = {1,4}; // : Subgraph 0 generator set
static int X_prime[] = {2,3}; // : Subgraph 1 generator set //static int X_prime[] = {2,3}; // : Subgraph 1 generator set
//#define GLOBAL_CHANNELS 13 //(h): Number of global channels per router //#define GLOBAL_CHANNELS 13 //(h): Number of global channels per router
//#define LOCAL_CHANNELS 6 // : Number of local channels per router //#define LOCAL_CHANNELS 6 // : Number of local channels per router
//#define NUM_ROUTER 13 //(a): Number of routers in each group //#define NUM_ROUTER 13 //(a): Number of routers in each group
...@@ -122,6 +117,8 @@ static int X_prime[] = {2,3}; // : Subgraph 1 generator set ...@@ -122,6 +117,8 @@ static int X_prime[] = {2,3}; // : Subgraph 1 generator set
//#define NUM_TERMINALS 9 //(p): Number of terminal connections per router //#define NUM_TERMINALS 9 //(p): Number of terminal connections per router
//static int X[] = {1,10,9,12,3,4}; // : Subgraph 0 generator set //static int X[] = {1,10,9,12,3,4}; // : Subgraph 0 generator set
//static int X_prime[] = {6,8,2,7,5,11}; // : Subgraph 1 generator set //static int X_prime[] = {6,8,2,7,5,11}; // : Subgraph 1 generator set
int *X;
int *X_prime;
// MMS43 q=29 Slimfly basic configuration parameters // MMS43 q=29 Slimfly basic configuration parameters
//static int X[] = {1,6,7,13,20,4,24,28,23,22,16,9,25,5}; //static int X[] = {1,6,7,13,20,4,24,28,23,22,16,9,25,5};
...@@ -603,6 +600,36 @@ static void slimfly_read_config(const char * anno, slimfly_param *params){ ...@@ -603,6 +600,36 @@ static void slimfly_read_config(const char * anno, slimfly_param *params){
fprintf(stderr, "Router delay not specified, setting to %lf\n", p->router_delay); fprintf(stderr, "Router delay not specified, setting to %lf\n", p->router_delay);
} }
char **values;
size_t length;
int ret = configuration_get_multivalue(&config, "PARAMS", "generator_set_X", anno, &values, &length);
if (ret != 1)
tw_error(TW_LOC, "unable to read PARAMS:generator_set_X\n");
if (length < 2)
fprintf(stderr, "generator set X less than 2 elements\n");
X = (int*)malloc(sizeof(int)*length);
for (size_t i = 0; i < length; i++)
{
X[i] = atoi(values[i]);
printf("X[%d]:%d\n",i,X[i]);
}
free(values);
ret = configuration_get_multivalue(&config, "PARAMS", "generator_set_X_prime", anno, &values, &length);
if (ret != 1)
tw_error(TW_LOC, "unable to read PARAMS:generator_set_X_prime\n");
if (length < 2)
fprintf(stderr, "generator set X_prime less than 2 elements\n");
X_prime = (int*)malloc(sizeof(int)*length);
for (size_t i = 0; i < length; i++)
{
X_prime[i] = atoi(values[i]);
printf("X_prime[%d]:%d\n",i,X_prime[i]);
}
free(values);
char routing_str[MAX_NAME_LENGTH]; char routing_str[MAX_NAME_LENGTH];
configuration_get_value(&config, "PARAMS", "routing", anno, routing_str, configuration_get_value(&config, "PARAMS", "routing", anno, routing_str,
MAX_NAME_LENGTH); MAX_NAME_LENGTH);
...@@ -1021,7 +1048,7 @@ void slim_router_setup(router_state * r, tw_lp * lp) ...@@ -1021,7 +1048,7 @@ void slim_router_setup(router_state * r, tw_lp * lp)
int local_idx = 0; int local_idx = 0;
int global_idx = 0; int global_idx = 0;
int generator_size = sizeof(X)/sizeof(int); int generator_size = sizeof(X)/sizeof(int);
printf("generator size:%d\n",generator_size); //printf("generator size:%d\n",generator_size);
for(rid_d=0;rid_d<r->params->slim_total_routers;rid_d++) for(rid_d=0;rid_d<r->params->slim_total_routers;rid_d++)
{ {
...@@ -1060,7 +1087,7 @@ printf("generator size:%d\n",generator_size); ...@@ -1060,7 +1087,7 @@ printf("generator size:%d\n",generator_size);
if(abs(j_s-j_d)==X[k]) if(abs(j_s-j_d)==X[k])
{ {
r->local_channel[local_idx++] = rid_d; r->local_channel[local_idx++] = rid_d;
printf("router%d,router%d\n",rid_s,rid_d); // printf("router%d,router%d\n",rid_s,rid_d);
} }
} }
} }
...@@ -1071,7 +1098,7 @@ printf("generator size:%d\n",generator_size); ...@@ -1071,7 +1098,7 @@ printf("generator size:%d\n",generator_size);
if(j_s == (i_d*i_s + j_d) % r->params->num_routers) // equation (3) y=mx+c if(j_s == (i_d*i_s + j_d) % r->params->num_routers) // equation (3) y=mx+c
{ {
r->global_channel[global_idx++] = rid_d; r->global_channel[global_idx++] = rid_d;
printf("router%d,router%d\n",rid_s,rid_d); // printf("router%d,router%d\n",rid_s,rid_d);
} }
} }
} }
...@@ -1114,7 +1141,7 @@ printf("generator size:%d\n",generator_size); ...@@ -1114,7 +1141,7 @@ printf("generator size:%d\n",generator_size);
if(abs(j_s-j_d)==X_prime[k]) if(abs(j_s-j_d)==X_prime[k])
{ {
r->local_channel[local_idx++] = rid_d; r->local_channel[local_idx++] = rid_d;
printf("router%d,router%d\n",rid_s,rid_d); // printf("router%d,router%d\n",rid_s,rid_d);
} }
} }
} }
...@@ -1125,7 +1152,7 @@ printf("generator size:%d\n",generator_size); ...@@ -1125,7 +1152,7 @@ printf("generator size:%d\n",generator_size);
if(j_d == (i_s*i_d + j_s) % r->params->num_routers) // equation (3) y=mx+c if(j_d == (i_s*i_d + j_s) % r->params->num_routers) // equation (3) y=mx+c
{ {
r->global_channel[global_idx++] = rid_d; r->global_channel[global_idx++] = rid_d;
printf("router%d,router%d\n",rid_s,rid_d); // printf("router%d,router%d\n",rid_s,rid_d);
} }
} }
} }
......
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