Commit 9d3d0492 authored by Shane Snyder's avatar Shane Snyder

Update recorder workload params and replay tool

parent d8650f54
......@@ -4,7 +4,7 @@
*
*/
/* I/O workload generator API to be used for reading I/O operations into
/* I/O workload generator API to be used for reading I/O operations into
* storage system simulations. This API just describes the operations to be
* executed; it does not service the operations.
*/
......@@ -17,11 +17,12 @@
typedef struct bgp_params bgp_params;
typedef struct darshan_params darshan_params;
typedef struct recorder_params recorder_params;
typedef struct codes_workload_info codes_workload_info;
struct bgp_params
{
/* We have the number of ranks passed in from the bg/p model because
/* We have the number of ranks passed in from the bg/p model because
* 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;
......@@ -38,12 +39,19 @@ struct darshan_params
int64_t aggregator_cnt;
};
struct recorder_params
{
FILE* stream;
char trace_dir_path[MAX_NAME_LENGTH_WKLD];
};
struct codes_workload_info
{
int group_id; /* group id */
int min_rank; /* minimum rank in the collective operation */
int max_rank; /* maximum rank in the collective operation */
int local_rank; /* local rank? never being used in the bg/p model */
int local_rank; /* local rank? never being used in the bg/p model */
int num_lrank; /* number of ranks participating in the collective operation*/
};
......@@ -51,14 +59,14 @@ struct codes_workload_info
enum codes_workload_op_type
{
/* terminator; there are no more operations for this rank */
CODES_WK_END = 1,
CODES_WK_END = 1,
/* sleep/delay to simulate computation or other activity */
CODES_WK_DELAY,
/* block until specified ranks have reached the same point */
CODES_WK_BARRIER,
/* open */
CODES_WK_OPEN,
/* close */
/* close */
CODES_WK_CLOSE,
/* write */
CODES_WK_WRITE,
......@@ -108,12 +116,12 @@ struct codes_workload_op
/* load and initialize workload of of type "type" with parameters specified by
* "params". The rank is the caller's relative rank within the collection
* of processes that will participate in this workload.
* of processes that will participate in this workload.
*
* This function is intended to be called by a compute node LP in a model
* and may be called multiple times over the course of a
* simulation in order to execute different application workloads.
*
*
* Returns and identifier that can be used to retrieve operations later.
* Returns -1 on failure.
*/
......
......@@ -115,12 +115,12 @@ static int rank_tbl_pop = 0;
/* load the workload generator for this rank, given input params */
static int recorder_io_workload_load(const char *params, int rank)
{
const char *trace_dir = params; /* for now, params is just the directory name of the trace files */
recorder_params *r_params = (recorder_params *) params;
int64_t nprocs = 0;
struct rank_traces_context *new = NULL;
char *trace_dir = r_params->trace_dir_path;
if(!trace_dir)
return -1;
......@@ -154,7 +154,7 @@ static int recorder_io_workload_load(const char *params, int rank)
char *function_name = (char*) malloc(sizeof(char) * 128);
/* Read the first chunk of data (of size RECORDER_MAX_TRACE_READ_COUNT) */
char *line;
char *line = NULL;
size_t len;
ssize_t ret_value;
int i;
......
......@@ -6,7 +6,7 @@
/* SUMMARY:
*
* MPI replay tool for replaying workloads from the codes workload API.
* MPI replay tool for replaying workloads from the codes workload API.
*
*/
......@@ -55,7 +55,7 @@ void usage(char *exename)
fprintf(stderr, "\t<workload_test_dir> : the directory to replay the workload I/O in\n");
fprintf(stderr, "\n\t[OPTIONS] includes:\n");
fprintf(stderr, "\t\t--noop : do not perform i/o\n");
fprintf(stderr, "\t\t -v : verbose (output i/o details)\n");
fprintf(stderr, "\t\t -v : verbose (output i/o details)\n");
exit(1);
}
......@@ -155,7 +155,7 @@ int load_workload(char *conf_path, int rank)
/* get the bgp i/o params from the config file */
configuration_get_value(&config, "PARAMS", "io_kernel_meta_path",
b_params.io_kernel_meta_path, MAX_NAME_LENGTH_WKLD);
configuration_get_value(&config, "PARAMS", "bgp_config_file",
configuration_get_value(&config, "PARAMS", "bgp_config_file",
b_params.bgp_config_file, MAX_NAME_LENGTH_WKLD);
configuration_get_value(&config, "PARAMS", "rank_count", rank_count, 10);
strcpy(b_params.io_kernel_path, "");
......@@ -164,6 +164,17 @@ int load_workload(char *conf_path, int rank)
return codes_workload_load(workload_type, (char *)&b_params, rank);
}
else if (strcmp(workload_type, "recorder_io_workload") == 0) {
struct recorder_params r_params;
/* get the darshan params from the config file */
configuration_get_value(&config, "PARAMS", "trace_dir_path",
r_params.trace_dir_path, MAX_NAME_LENGTH_WKLD);
r_params.stream = NULL;
return codes_workload_load(workload_type, (char *)&r_params, rank);
}
else
{
fprintf(stderr, "Error: Invalid workload type specified (%s)\n", workload_type);
......@@ -380,7 +391,7 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
tmp_list = qhash_entry(hash_link, struct file_info, hash_link);
fildes = tmp_list->file_descriptor;
free(tmp_list);
/* perform the close operation */
ret = close(fildes);
if (ret < 0)
......@@ -396,7 +407,7 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
if (opt_verbose)
fprintf(log_stream, "[Rank %d] Operation %lld : WRITE file %"PRIu64" (sz = %"PRId64
", off = %"PRId64")\n",
rank, op_number, replay_op.u.write.file_id, replay_op.u.write.size,
rank, op_number, replay_op.u.write.file_id, replay_op.u.write.size,
replay_op.u.write.offset);
#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