Commit 8f6db6ba authored by Shane Snyder's avatar Shane Snyder

Optimizations for generating access size sequences

parent 08cb4d92
This diff is collapsed.
......@@ -24,6 +24,8 @@
#include "codes/quickhash.h"
#include "codes/configuration.h"
#define WORKLOAD_PRINT 0
/* hash table entry for looking up file descriptor of a workload file id */
struct file_info
{
......@@ -136,8 +138,9 @@ int load_workload(char *conf_path, int rank)
configuration_get_value(&config, "PARAMS", "aggregator_count", aggregator_count, 10);
d_params.aggregator_cnt = atoi(aggregator_count);
#if WORKLOAD_PRINT
d_params.stream = NULL;
#if 0
#else
d_params.stream = log_stream;
opt_verbose = 0;
#endif
......@@ -274,9 +277,11 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
switch (replay_op.op_type)
{
case CODES_WK_DELAY:
#if WORKLOAD_PRINT
if (opt_verbose)
fprintf(log_stream, "[Rank %d] Operation %lld : DELAY %lf seconds\n",
rank, op_number, replay_op.u.delay.seconds);
#endif
if (!opt_noop)
{
......@@ -303,8 +308,10 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
}
return 0;
case CODES_WK_BARRIER:
#if WORKLOAD_PRINT
if (opt_verbose)
fprintf(log_stream, "[Rank %d] Operation %lld : BARRIER\n", rank, op_number);
#endif
if (!opt_noop)
{
......@@ -320,9 +327,11 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
}
return 0;
case CODES_WK_OPEN:
#if WORKLOAD_PRINT
if (opt_verbose)
fprintf(log_stream, "[Rank %d] Operation %lld: %s file %"PRIu64"\n", rank, op_number,
(replay_op.u.open.create_flag) ? "CREATE" : "OPEN", replay_op.u.open.file_id);
#endif
if (!opt_noop)
{
......@@ -357,9 +366,11 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
}
return 0;
case CODES_WK_CLOSE:
#if WORKLOAD_PRINT
if (opt_verbose)
fprintf(log_stream, "[Rank %d] Operation %lld : CLOSE file %"PRIu64"\n",
rank, op_number, replay_op.u.close.file_id);
#endif
if (!opt_noop)
{
......@@ -381,11 +392,13 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
}
return 0;
case CODES_WK_WRITE:
#if WORKLOAD_PRINT
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,
replay_op.u.write.offset);
#endif
if (!opt_noop)
{
......@@ -413,11 +426,12 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
}
return 0;
case CODES_WK_READ:
#if WORKLOAD_PRINT
if (opt_verbose)
fprintf(log_stream, "[Rank %d] Operation %lld : READ file %"PRIu64" (sz = %"PRId64
", off = %"PRId64")\n", rank, op_number, replay_op.u.read.file_id,
replay_op.u.read.size, replay_op.u.read.offset);
#endif
if (!opt_noop)
{
/* search for the corresponding file descriptor in the hash table */
......
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