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
struct recorder_params
{
char trace_dir_path[MAX_NAME_LENGTH_WKLD];
int64_t nprocs;
};
......
......@@ -67,10 +67,9 @@ static int rank_tbl_pop = 0;
static int recorder_io_workload_load(const char *params, int rank)
{
recorder_params *r_params = (recorder_params *) params;
int64_t nprocs = 16384;
struct rank_traces_context *new = NULL;
int64_t nprocs = r_params->nprocs;
char *trace_dir = r_params->trace_dir_path;
if(!trace_dir)
return -1;
......@@ -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);
token = strtok(NULL, ", \n");
r_op.end_time = r_op.start_time + atof(token);
}
else if(!strcmp(function_name, "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)
token = strtok(NULL, ", ");
token = strtok(NULL, ", \n");
r_op.end_time = r_op.start_time + atof(token);
}
else if(!strcmp(function_name, "read") || !strcmp(function_name, "read64")) {
r_op.codes_op.op_type = CODES_WK_READ;
......@@ -152,6 +153,7 @@ static int recorder_io_workload_load(const char *params, int rank)
token = strtok(NULL, ", ");
token = strtok(NULL, ", \n");
r_op.end_time = r_op.start_time + atof(token);
}
else if(!strcmp(function_name, "write") || !strcmp(function_name, "write64")) {
r_op.codes_op.op_type = CODES_WK_WRITE;
......@@ -170,23 +172,20 @@ static int recorder_io_workload_load(const char *params, int rank)
token = strtok(NULL, ", ");
token = strtok(NULL, ", \n");
r_op.end_time = r_op.start_time + atof(token);
}
else if(!strcmp(function_name, "MPI_Barrier")) {
char *tmp;
else if(!strcmp(function_name, "MPI_Barrier") ||
!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.u.barrier.count = nprocs;
r_op.codes_op.u.barrier.root = 0;
token = strtok(NULL, ", ()");
token = strtok(NULL, ", ");
tmp = strtok(NULL, ", \n");
if (tmp) token = tmp;
r_op.end_time = r_op.start_time + .000001;
}
else{
continue;
}
r_op.end_time = r_op.start_time + atof(token);
new->trace_ops[new->trace_list_ndx++] = r_op;
if (new->trace_list_ndx == 2048) break;
......
......@@ -13,7 +13,7 @@
static char type[128] = {'\0'};
static darshan_params d_params = {"", 0};
static bgp_params b_params = {0, 0, "", "", "", ""};
static recorder_params r_params = {""};
static recorder_params r_params = {"", 0};
static int n = -1;
static struct option long_opts[] =
......@@ -27,6 +27,7 @@ static struct option long_opts[] =
{"i-rank-cnt", required_argument, NULL, 'r'},
{"i-use-relpath", no_argument, NULL, 'p'},
{"r-trace-dir", required_argument, NULL, 'd'},
{"r-nprocs", required_argument, NULL, 'x'},
{NULL, 0, NULL, 0}
};
......@@ -43,6 +44,7 @@ void usage(){
"--i-rank-cnt: i/o language rank count\n"
"--i-use-relpath: use i/o kernel path relative meta file path\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");
}
......@@ -88,6 +90,9 @@ int main(int argc, char *argv[])
case 'd':
strcpy(r_params.trace_dir_path, optarg);
break;
case 'x':
r_params.nprocs = atol(optarg);
break;
case 's':
print_stats = 1;
break;
......@@ -149,6 +154,11 @@ int main(int argc, char *argv[])
usage();
return 1;
}
if (r_params.nprocs == 0){
fprintf(stderr, "Expected \"--r-nprocs\" argument for recorder workload\n");
usage();
return 1;
}
else{
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