Commit 436e5f8b authored by Jonathan Jenkins's avatar Jonathan Jenkins

initial bgp cleaning

- fix noop workload ops
- get rid of unused workload option
parent 25b032ed
...@@ -27,14 +27,11 @@ typedef struct dumpi_trace_params dumpi_trace_params; ...@@ -27,14 +27,11 @@ typedef struct dumpi_trace_params dumpi_trace_params;
struct bgp_params struct bgp_params
{ {
/* We have the number of ranks passed in from the bg/p model because /* the rank count is defined in the workload config file */
* the I/O lang workloads have no information about the number of ranks.
* Only the bg/p config file knows the number of ranks. */
int num_cns; int num_cns;
/* flag - use path to find kernel files relative to the metafile */ /* flag - use path to find kernel files relative to the metafile */
int use_relpath; int use_relpath;
char io_kernel_meta_path[MAX_NAME_LENGTH_WKLD]; char io_kernel_meta_path[MAX_NAME_LENGTH_WKLD];
char bgp_config_file[MAX_NAME_LENGTH_WKLD];
char io_kernel_path[MAX_NAME_LENGTH_WKLD]; char io_kernel_path[MAX_NAME_LENGTH_WKLD];
char io_kernel_def_path[MAX_NAME_LENGTH_WKLD]; char io_kernel_def_path[MAX_NAME_LENGTH_WKLD];
}; };
...@@ -127,6 +124,10 @@ enum codes_workload_op_type ...@@ -127,6 +124,10 @@ enum codes_workload_op_type
CODES_WK_WAITANY, CODES_WK_WAITANY,
/* Testall operation */ /* Testall operation */
CODES_WK_TESTALL, CODES_WK_TESTALL,
/* for workloads that have events not yet handled
* (eg the workload language) */
CODES_WK_IGNORE
}; };
/* I/O operation paramaters */ /* I/O operation paramaters */
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
static char type[128] = {'\0'}; static char type[128] = {'\0'};
static darshan_params d_params = {"", 0}; static darshan_params d_params = {"", 0};
static bgp_params b_params = {0, 0, "", "", "", ""}; static bgp_params b_params = {0, 0, "", "", ""};
static recorder_params r_params = {"", 0}; static recorder_params r_params = {"", 0};
static int n = -1; static int n = -1;
...@@ -23,7 +23,6 @@ static struct option long_opts[] = ...@@ -23,7 +23,6 @@ static struct option long_opts[] =
{"d-log", required_argument, NULL, 'l'}, {"d-log", required_argument, NULL, 'l'},
{"d-aggregator-cnt", required_argument, NULL, 'a'}, {"d-aggregator-cnt", required_argument, NULL, 'a'},
{"i-meta", required_argument, NULL, 'm'}, {"i-meta", required_argument, NULL, 'm'},
{"i-bgp-config", required_argument, NULL, 'b'},
{"i-rank-cnt", required_argument, NULL, 'r'}, {"i-rank-cnt", required_argument, NULL, 'r'},
{"i-use-relpath", no_argument, NULL, 'p'}, {"i-use-relpath", no_argument, NULL, 'p'},
{"r-trace-dir", required_argument, NULL, 'd'}, {"r-trace-dir", required_argument, NULL, 'd'},
...@@ -40,7 +39,6 @@ void usage(){ ...@@ -40,7 +39,6 @@ void usage(){
"--d-log: darshan log file\n" "--d-log: darshan log file\n"
"--d-aggregator-cnt: number of aggregators for collective I/O in darshan\n" "--d-aggregator-cnt: number of aggregators for collective I/O in darshan\n"
"--i-meta: i/o language kernel meta file path\n" "--i-meta: i/o language kernel meta file path\n"
"--i-bgp-config: i/o language bgp config file\n"
"--i-rank-cnt: i/o language rank count\n" "--i-rank-cnt: i/o language rank count\n"
"--i-use-relpath: use i/o kernel path relative meta file path\n" "--i-use-relpath: use i/o kernel path relative meta file path\n"
"--r-trace-dir: directory containing recorder trace files\n" "--r-trace-dir: directory containing recorder trace files\n"
...@@ -90,7 +88,7 @@ int main(int argc, char *argv[]) ...@@ -90,7 +88,7 @@ int main(int argc, char *argv[])
int64_t num_testalls = 0; int64_t num_testalls = 0;
char ch; char ch;
while ((ch = getopt_long(argc, argv, "t:n:l:a:m:b:r:sp", long_opts, NULL)) != -1){ while ((ch = getopt_long(argc, argv, "t:n:l:a:m:r:sp", long_opts, NULL)) != -1){
switch (ch){ switch (ch){
case 't': case 't':
strcpy(type, optarg); strcpy(type, optarg);
...@@ -108,9 +106,6 @@ int main(int argc, char *argv[]) ...@@ -108,9 +106,6 @@ int main(int argc, char *argv[])
case 'm': case 'm':
strcpy(b_params.io_kernel_meta_path, optarg); strcpy(b_params.io_kernel_meta_path, optarg);
break; break;
case 'b':
strcpy(b_params.bgp_config_file, optarg);
break;
case 'r': case 'r':
b_params.num_cns = atoi(optarg); b_params.num_cns = atoi(optarg);
break; break;
...@@ -168,13 +163,6 @@ int main(int argc, char *argv[]) ...@@ -168,13 +163,6 @@ int main(int argc, char *argv[])
usage(); usage();
return 1; return 1;
} }
/* TODO: unused in codes-base, codes-triton, but don't remove entirely for now
else if (b_params.bgp_config_file[0] == '\0'){
fprintf(stderr, "Expected \"--i-bgp-conf\" argument for bgp io workload\n");
usage();
return 1;
}
*/
wparams = (char *)&b_params; wparams = (char *)&b_params;
} }
...@@ -202,6 +190,12 @@ int main(int argc, char *argv[]) ...@@ -202,6 +190,12 @@ int main(int argc, char *argv[])
/* if num_ranks not set, pull it from the workload */ /* if num_ranks not set, pull it from the workload */
if (n == -1){ if (n == -1){
n = codes_workload_get_rank_cnt(type, wparams); n = codes_workload_get_rank_cnt(type, wparams);
if (n == -1) {
fprintf(stderr,
"Unable to get rank count from workload. "
"Specify option --num-ranks\n");
return 1;
}
} }
for (i = 0 ; i < n; i++){ for (i = 0 ; i < n; i++){
...@@ -299,6 +293,10 @@ int main(int argc, char *argv[]) ...@@ -299,6 +293,10 @@ int main(int argc, char *argv[])
case CODES_WK_TESTALL: case CODES_WK_TESTALL:
num_testalls++; num_testalls++;
break; break;
case CODES_WK_END:
break;
case CODES_WK_IGNORE:
break;
default: default:
fprintf(stderr, fprintf(stderr,
"WARNING: unknown workload op type (code %d)\n", "WARNING: unknown workload op type (code %d)\n",
......
...@@ -285,10 +285,12 @@ void codes_workload_print_op(FILE *f, struct codes_workload_op *op, int rank){ ...@@ -285,10 +285,12 @@ void codes_workload_print_op(FILE *f, struct codes_workload_op *op, int rank){
fprintf(f, "op: rank:? type:collective " fprintf(f, "op: rank:? type:collective "
"bytes:%d\n", op->u.collective.num_bytes); "bytes:%d\n", op->u.collective.num_bytes);
break; break;
case CODES_WK_IGNORE:
break;
default: default:
tw_error(TW_LOC, fprintf(stderr,
"codes_workload_print_op: unrecognized workload type " "%s:%d: codes_workload_print_op: unrecognized workload type "
"(op code %d)\n", op->op_type); "(op code %d)\n", __FILE__, __LINE__, op->op_type);
} }
} }
......
...@@ -116,13 +116,13 @@ static int convertTypes(int inst) ...@@ -116,13 +116,13 @@ static int convertTypes(int inst)
case CL_EXIT: case CL_EXIT:
return CODES_WK_END; /* end of the operations/ no more operations in file */ return CODES_WK_END; /* end of the operations/ no more operations in file */
case CL_DELETE: case CL_DELETE:
return -2; return CODES_WK_IGNORE;
case CL_GETRANK: case CL_GETRANK:
return -3; /* defined in I/O lang but not in workloads API*/ return CODES_WK_IGNORE; /* defined in I/O lang but not in workloads API*/
case CL_GETSIZE: case CL_GETSIZE:
return -4; /* defined in I/O lang but not in workload API */ return CODES_WK_IGNORE; /* defined in I/O lang but not in workload API */
default: default:
return -1; return CODES_WK_IGNORE;
} }
} }
...@@ -143,6 +143,8 @@ void bgp_io_workload_get_next(int rank, struct codes_workload_op *op) ...@@ -143,6 +143,8 @@ void bgp_io_workload_get_next(int rank, struct codes_workload_op *op)
int type = codes_kernel_helper_parse_input(next_wrkld->codes_pstate, &(next_wrkld->codes_context),&(next_wrkld->next_event)); int type = codes_kernel_helper_parse_input(next_wrkld->codes_pstate, &(next_wrkld->codes_context),&(next_wrkld->next_event));
op->op_type = convertTypes(type); op->op_type = convertTypes(type);
if (op->op_type == CODES_WK_IGNORE)
return;
switch(op->op_type) switch(op->op_type)
{ {
case CODES_WK_WRITE: case CODES_WK_WRITE:
...@@ -198,6 +200,7 @@ void bgp_io_workload_get_next(int rank, struct codes_workload_op *op) ...@@ -198,6 +200,7 @@ void bgp_io_workload_get_next(int rank, struct codes_workload_op *op)
break; break;
default: default:
{ {
// Return error code // Return error code
//printf("\n Invalid operation specified %d ", op->op_type); //printf("\n Invalid operation specified %d ", op->op_type);
} }
......
...@@ -159,8 +159,6 @@ int load_workload(char *conf_path, int rank) ...@@ -159,8 +159,6 @@ int load_workload(char *conf_path, int rank)
/* get the bgp i/o params from the config file */ /* get the bgp i/o params from the config file */
configuration_get_value(&config, "PARAMS", "io_kernel_meta_path", configuration_get_value(&config, "PARAMS", "io_kernel_meta_path",
NULL, b_params.io_kernel_meta_path, MAX_NAME_LENGTH_WKLD); NULL, b_params.io_kernel_meta_path, MAX_NAME_LENGTH_WKLD);
configuration_get_value(&config, "PARAMS", "bgp_config_file",
NULL, b_params.bgp_config_file, MAX_NAME_LENGTH_WKLD);
configuration_get_value(&config, "PARAMS", "rank_count", NULL, rank_count, 10); configuration_get_value(&config, "PARAMS", "rank_count", NULL, rank_count, 10);
strcpy(b_params.io_kernel_path, ""); strcpy(b_params.io_kernel_path, "");
strcpy(b_params.io_kernel_def_path, ""); strcpy(b_params.io_kernel_def_path, "");
......
...@@ -36,7 +36,6 @@ static int num_clients_per_lp = -1; ...@@ -36,7 +36,6 @@ static int num_clients_per_lp = -1;
void workload_set_params() void workload_set_params()
{ {
char io_kernel_meta_path[MAX_NAME_LENGTH_WKLD]; char io_kernel_meta_path[MAX_NAME_LENGTH_WKLD];
char bgp_config_file[MAX_NAME_LENGTH_WKLD];
configuration_get_value(&config, "PARAMS", "workload_type", NULL, workload_type, MAX_NAME_LENGTH_WKLD); configuration_get_value(&config, "PARAMS", "workload_type", NULL, workload_type, MAX_NAME_LENGTH_WKLD);
if(strcmp(workload_type,"bgp_io_workload") == 0) if(strcmp(workload_type,"bgp_io_workload") == 0)
...@@ -47,9 +46,6 @@ void workload_set_params() ...@@ -47,9 +46,6 @@ void workload_set_params()
configuration_get_value(&config, "PARAMS", "io_kernel_meta_path", NULL, io_kernel_meta_path, MAX_NAME_LENGTH_WKLD); configuration_get_value(&config, "PARAMS", "io_kernel_meta_path", NULL, io_kernel_meta_path, MAX_NAME_LENGTH_WKLD);
strcpy(bgparams.io_kernel_meta_path, io_kernel_meta_path); strcpy(bgparams.io_kernel_meta_path, io_kernel_meta_path);
configuration_get_value(&config, "PARAMS", "bgp_config_file", NULL, bgp_config_file, MAX_NAME_LENGTH_WKLD);
strcpy(bgparams.bgp_config_file, bgp_config_file);
} }
} }
......
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