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