Commit f8b2641d authored by Shane Snyder's avatar Shane Snyder

Slight tweaks in workload replay delays

Darshan generates longer delays, and mpi replay tool now can be
configured to play a percentage of the overall delay.
parent 001f5a6f
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
#include "darshan-logutils.h" #include "darshan-logutils.h"
#define DEF_INTER_IO_DELAY_PCT 0.4 #define DEF_INTER_IO_DELAY_PCT 0.2
#define DEF_INTER_CYC_DELAY_PCT 0.2 #define DEF_INTER_CYC_DELAY_PCT 0.4
#define DARSHAN_NEGLIGIBLE_DELAY 0.00001 #define DARSHAN_NEGLIGIBLE_DELAY 0.00001
...@@ -552,9 +552,9 @@ void generate_psx_coll_file_events( ...@@ -552,9 +552,9 @@ void generate_psx_coll_file_events(
* This accounts for time spent synchronizing, since we generate barrier events. * This accounts for time spent synchronizing, since we generate barrier events.
* Note: 60% of mpi read/write time seems to be an appropriate approx of sync duration. * Note: 60% of mpi read/write time seems to be an appropriate approx of sync duration.
*/ */
total_delay -= ((((file->fcounters[CP_F_MPI_READ_TIME] + // total_delay -= ((((file->fcounters[CP_F_MPI_READ_TIME] +
file->fcounters[CP_F_MPI_WRITE_TIME]) / nprocs) - // file->fcounters[CP_F_MPI_WRITE_TIME]) / nprocs) -
file->fcounters[CP_F_SLOWEST_RANK_TIME]) * .6); // file->fcounters[CP_F_SLOWEST_RANK_TIME]) * .4);
extra_opens = file->counters[CP_POSIX_OPENS] - file->counters[CP_COLL_OPENS] - extra_opens = file->counters[CP_POSIX_OPENS] - file->counters[CP_COLL_OPENS] -
file->counters[CP_INDEP_OPENS]; file->counters[CP_INDEP_OPENS];
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#define DEBUG_PROFILING 1 #define DEBUG_PROFILING 1
#define WORKLOAD_DELAY_PCT 1
/* hash table entry for looking up file descriptor of a workload file id */ /* hash table entry for looking up file descriptor of a workload file id */
struct file_info struct file_info
{ {
...@@ -43,6 +41,7 @@ int hash_file_compare(void *key, struct qlist_head *link); ...@@ -43,6 +41,7 @@ int hash_file_compare(void *key, struct qlist_head *link);
static int opt_verbose = 0; static int opt_verbose = 0;
static int opt_noop = 0; static int opt_noop = 0;
static int opt_lockless = 0; static int opt_lockless = 0;
static double opt_delay_pct = 1.0;
/* hash table for storing file descriptors of opened files */ /* hash table for storing file descriptors of opened files */
static struct qhash_table *fd_table = NULL; static struct qhash_table *fd_table = NULL;
...@@ -51,12 +50,14 @@ static struct qhash_table *fd_table = NULL; ...@@ -51,12 +50,14 @@ static struct qhash_table *fd_table = NULL;
static FILE *log_stream = NULL; static FILE *log_stream = NULL;
/* global variables for profiling different portions of the replay, if enabled */ /* global variables for profiling different portions of the replay, if enabled */
#if DEBUG_PROFILING
static double total_open_time = 0.0; static double total_open_time = 0.0;
static double total_close_time = 0.0; static double total_close_time = 0.0;
static double total_read_time = 0.0; static double total_read_time = 0.0;
static double total_write_time = 0.0; static double total_write_time = 0.0;
static double total_delay_time = 0.0; static double total_delay_time = 0.0;
static double total_barrier_time = 0.0; static double total_barrier_time = 0.0;
#endif
void usage(char *exename) void usage(char *exename)
{ {
...@@ -81,6 +82,7 @@ void parse_args(int argc, char **argv, char **conf_path, char **test_dir) ...@@ -81,6 +82,7 @@ void parse_args(int argc, char **argv, char **conf_path, char **test_dir)
{"test-dir", 1, NULL, 'd'}, {"test-dir", 1, NULL, 'd'},
{"noop", 0, NULL, 'n'}, {"noop", 0, NULL, 'n'},
{"lockless", 0, NULL, 'l'}, {"lockless", 0, NULL, 'l'},
{"delay", 1, NULL, 'p'},
{"help", 0, NULL, 0}, {"help", 0, NULL, 0},
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
...@@ -111,6 +113,9 @@ void parse_args(int argc, char **argv, char **conf_path, char **test_dir) ...@@ -111,6 +113,9 @@ void parse_args(int argc, char **argv, char **conf_path, char **test_dir)
case 'd': case 'd':
*test_dir = optarg; *test_dir = optarg;
break; break;
case 'p':
opt_delay_pct = atof(optarg);
break;
case 0: case 0:
case '?': case '?':
default: default:
...@@ -252,6 +257,9 @@ int main(int argc, char *argv[]) ...@@ -252,6 +257,9 @@ int main(int argc, char *argv[])
goto error_exit; goto error_exit;
} }
/* synchronize before replay */
MPI_Barrier(MPI_COMM_WORLD);
/* loading is finished */ /* loading is finished */
load_end = MPI_Wtime(); load_end = MPI_Wtime();
...@@ -271,8 +279,6 @@ int main(int argc, char *argv[]) ...@@ -271,8 +279,6 @@ int main(int argc, char *argv[])
} }
else else
{ {
printf("Replay workload is %.4lf seconds behind original workload\n",
(double)(load_end - load_start));
continue; continue;
} }
} }
...@@ -281,7 +287,7 @@ int main(int argc, char *argv[]) ...@@ -281,7 +287,7 @@ int main(int argc, char *argv[])
{ {
if (next_op.op_type == CODES_WK_DELAY) if (next_op.op_type == CODES_WK_DELAY)
next_op.u.delay.seconds *= WORKLOAD_DELAY_PCT; next_op.u.delay.seconds *= opt_delay_pct;
/* replay the next workload operation */ /* replay the next workload operation */
ret = replay_workload_op(next_op, myrank, replay_op_number++); ret = replay_workload_op(next_op, myrank, replay_op_number++);
...@@ -326,9 +332,9 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i ...@@ -326,9 +332,9 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
struct qlist_head *hash_link = NULL; struct qlist_head *hash_link = NULL;
char *buf = NULL; char *buf = NULL;
int ret; int ret;
double start, end;
#if DEBUG_PROFILING #if DEBUG_PROFILING
double start, end;
start = MPI_Wtime(); start = MPI_Wtime();
#endif #endif
......
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