Commit db3e020c authored by Shane Snyder's avatar Shane Snyder

Bug fixes for recorder workload generator

Note that the recorder workload now requires a parameter for the
number of ranks in the original application. the workload dump
utility has been updated to reflect this.
parent bdf478f9
...@@ -43,6 +43,7 @@ struct darshan_params ...@@ -43,6 +43,7 @@ struct darshan_params
struct recorder_params struct recorder_params
{ {
char trace_dir_path[MAX_NAME_LENGTH_WKLD]; char trace_dir_path[MAX_NAME_LENGTH_WKLD];
int64_t nprocs;
}; };
......
...@@ -67,10 +67,9 @@ static int rank_tbl_pop = 0; ...@@ -67,10 +67,9 @@ static int rank_tbl_pop = 0;
static int recorder_io_workload_load(const char *params, int rank) static int recorder_io_workload_load(const char *params, int rank)
{ {
recorder_params *r_params = (recorder_params *) params; recorder_params *r_params = (recorder_params *) params;
int64_t nprocs = 16384;
struct rank_traces_context *new = NULL; struct rank_traces_context *new = NULL;
int64_t nprocs = r_params->nprocs;
char *trace_dir = r_params->trace_dir_path; char *trace_dir = r_params->trace_dir_path;
if(!trace_dir) if(!trace_dir)
return -1; return -1;
...@@ -125,6 +124,7 @@ static int recorder_io_workload_load(const char *params, int rank) ...@@ -125,6 +124,7 @@ static int recorder_io_workload_load(const char *params, int rank)
r_op.codes_op.u.open.file_id = atoi(token); r_op.codes_op.u.open.file_id = atoi(token);
token = strtok(NULL, ", \n"); token = strtok(NULL, ", \n");
r_op.end_time = r_op.start_time + atof(token);
} }
else if(!strcmp(function_name, "close")) { else if(!strcmp(function_name, "close")) {
r_op.codes_op.op_type = CODES_WK_CLOSE; r_op.codes_op.op_type = CODES_WK_CLOSE;
...@@ -134,6 +134,7 @@ static int recorder_io_workload_load(const char *params, int rank) ...@@ -134,6 +134,7 @@ static int recorder_io_workload_load(const char *params, int rank)
token = strtok(NULL, ", "); token = strtok(NULL, ", ");
token = strtok(NULL, ", \n"); token = strtok(NULL, ", \n");
r_op.end_time = r_op.start_time + atof(token);
} }
else if(!strcmp(function_name, "read") || !strcmp(function_name, "read64")) { else if(!strcmp(function_name, "read") || !strcmp(function_name, "read64")) {
r_op.codes_op.op_type = CODES_WK_READ; r_op.codes_op.op_type = CODES_WK_READ;
...@@ -152,6 +153,7 @@ static int recorder_io_workload_load(const char *params, int rank) ...@@ -152,6 +153,7 @@ static int recorder_io_workload_load(const char *params, int rank)
token = strtok(NULL, ", "); token = strtok(NULL, ", ");
token = strtok(NULL, ", \n"); token = strtok(NULL, ", \n");
r_op.end_time = r_op.start_time + atof(token);
} }
else if(!strcmp(function_name, "write") || !strcmp(function_name, "write64")) { else if(!strcmp(function_name, "write") || !strcmp(function_name, "write64")) {
r_op.codes_op.op_type = CODES_WK_WRITE; r_op.codes_op.op_type = CODES_WK_WRITE;
...@@ -170,23 +172,20 @@ static int recorder_io_workload_load(const char *params, int rank) ...@@ -170,23 +172,20 @@ static int recorder_io_workload_load(const char *params, int rank)
token = strtok(NULL, ", "); token = strtok(NULL, ", ");
token = strtok(NULL, ", \n"); token = strtok(NULL, ", \n");
r_op.end_time = r_op.start_time + atof(token);
} }
else if(!strcmp(function_name, "MPI_Barrier")) { else if(!strcmp(function_name, "MPI_Barrier") ||
char *tmp; !strcmp(function_name, "MPI_File_read_at_all") ||
!strcmp(function_name, "MPI_File_write_at_all")) {
r_op.codes_op.op_type = CODES_WK_BARRIER; r_op.codes_op.op_type = CODES_WK_BARRIER;
r_op.codes_op.u.barrier.count = nprocs; r_op.codes_op.u.barrier.count = nprocs;
r_op.codes_op.u.barrier.root = 0; r_op.codes_op.u.barrier.root = 0;
r_op.end_time = r_op.start_time + .000001;
token = strtok(NULL, ", ()");
token = strtok(NULL, ", ");
tmp = strtok(NULL, ", \n");
if (tmp) token = tmp;
} }
else{ else{
continue; continue;
} }
r_op.end_time = r_op.start_time + atof(token);
new->trace_ops[new->trace_list_ndx++] = r_op; new->trace_ops[new->trace_list_ndx++] = r_op;
if (new->trace_list_ndx == 2048) break; if (new->trace_list_ndx == 2048) break;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,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 = {""}; static recorder_params r_params = {"", 0};
static int n = -1; static int n = -1;
static struct option long_opts[] = static struct option long_opts[] =
...@@ -27,6 +27,7 @@ static struct option long_opts[] = ...@@ -27,6 +27,7 @@ static struct option long_opts[] =
{"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'},
{"r-nprocs", required_argument, NULL, 'x'},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
...@@ -43,6 +44,7 @@ void usage(){ ...@@ -43,6 +44,7 @@ void usage(){
"--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"
"--r-nprocs: number of ranks in original recorder workload\n"
"-s: print final workload stats\n"); "-s: print final workload stats\n");
} }
...@@ -88,6 +90,9 @@ int main(int argc, char *argv[]) ...@@ -88,6 +90,9 @@ int main(int argc, char *argv[])
case 'd': case 'd':
strcpy(r_params.trace_dir_path, optarg); strcpy(r_params.trace_dir_path, optarg);
break; break;
case 'x':
r_params.nprocs = atol(optarg);
break;
case 's': case 's':
print_stats = 1; print_stats = 1;
break; break;
...@@ -149,6 +154,11 @@ int main(int argc, char *argv[]) ...@@ -149,6 +154,11 @@ int main(int argc, char *argv[])
usage(); usage();
return 1; return 1;
} }
if (r_params.nprocs == 0){
fprintf(stderr, "Expected \"--r-nprocs\" argument for recorder workload\n");
usage();
return 1;
}
else{ else{
wparams = (char *)&r_params; wparams = (char *)&r_params;
} }
......
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