Commit 00d0e38b authored by Philip Carns's avatar Philip Carns
Browse files

not sure if we will keep this feature or not, but added --red-read option to

identify potential redundant read traffic by showing list of files that had
a BYTES_READ counter that exceeded the MAX_BYTE_READ counter.


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@685 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 59078f5e
...@@ -26,11 +26,13 @@ ...@@ -26,11 +26,13 @@
#define OPTION_TOTAL (1 << 1) /* aggregated fields */ #define OPTION_TOTAL (1 << 1) /* aggregated fields */
#define OPTION_PERF (1 << 2) /* derived performance */ #define OPTION_PERF (1 << 2) /* derived performance */
#define OPTION_FILE (1 << 3) /* file count totals */ #define OPTION_FILE (1 << 3) /* file count totals */
#define OPTION_RED_READ (1 << 4) /* files with redundant read traffic */
#define OPTION_ALL (\ #define OPTION_ALL (\
OPTION_BASE|\ OPTION_BASE|\
OPTION_TOTAL|\ OPTION_TOTAL|\
OPTION_PERF|\ OPTION_PERF|\
OPTION_FILE) OPTION_FILE|\
OPTION_RED_READ)
#define FILETYPE_SHARED (1 << 0) #define FILETYPE_SHARED (1 << 0)
#define FILETYPE_UNIQUE (1 << 1) #define FILETYPE_UNIQUE (1 << 1)
...@@ -102,6 +104,8 @@ void calc_perf(struct darshan_job *, hash_entry_t *, perf_data_t *); ...@@ -102,6 +104,8 @@ void calc_perf(struct darshan_job *, hash_entry_t *, perf_data_t *);
void accum_file(struct darshan_file *, hash_entry_t *, file_data_t *); void accum_file(struct darshan_file *, hash_entry_t *, file_data_t *);
void calc_file(struct darshan_job *, hash_entry_t *, file_data_t *); void calc_file(struct darshan_job *, hash_entry_t *, file_data_t *);
static void calc_red_read(struct darshan_job *djob,
hash_entry_t *file_hash);
int usage (char *exename) int usage (char *exename)
{ {
...@@ -111,6 +115,7 @@ int usage (char *exename) ...@@ -111,6 +115,7 @@ int usage (char *exename)
fprintf(stderr, " --file : total file counts\n"); fprintf(stderr, " --file : total file counts\n");
fprintf(stderr, " --perf : derived perf data\n"); fprintf(stderr, " --perf : derived perf data\n");
fprintf(stderr, " --total : aggregated darshan field data\n"); fprintf(stderr, " --total : aggregated darshan field data\n");
fprintf(stderr, " --red-read : files with redundant read traffic\n");
exit(1); exit(1);
} }
...@@ -126,6 +131,7 @@ int parse_args (int argc, char **argv, char **filename) ...@@ -126,6 +131,7 @@ int parse_args (int argc, char **argv, char **filename)
{"file", 0, NULL, OPTION_FILE}, {"file", 0, NULL, OPTION_FILE},
{"perf", 0, NULL, OPTION_PERF}, {"perf", 0, NULL, OPTION_PERF},
{"total", 0, NULL, OPTION_TOTAL}, {"total", 0, NULL, OPTION_TOTAL},
{"red-read", 0, NULL, OPTION_RED_READ},
{"help", 0, NULL, 0} {"help", 0, NULL, 0}
}; };
...@@ -144,6 +150,7 @@ int parse_args (int argc, char **argv, char **filename) ...@@ -144,6 +150,7 @@ int parse_args (int argc, char **argv, char **filename)
case OPTION_FILE: case OPTION_FILE:
case OPTION_PERF: case OPTION_PERF:
case OPTION_TOTAL: case OPTION_TOTAL:
case OPTION_RED_READ:
mask |= c; mask |= c;
break; break;
case 0: case 0:
...@@ -468,6 +475,12 @@ int main(int argc, char **argv) ...@@ -468,6 +475,12 @@ int main(int argc, char **argv)
printf("# agg_perf_by_slowest: %lf\n", pdata.agg_perf_by_slowest); printf("# agg_perf_by_slowest: %lf\n", pdata.agg_perf_by_slowest);
} }
/* Redundant read calc */
if((mask & OPTION_RED_READ))
{
calc_red_read(&job, file_hash);
}
/* File Calc */ /* File Calc */
calc_file(&job, file_hash, &fdata); calc_file(&job, file_hash, &fdata);
if ((mask & OPTION_FILE)) if ((mask & OPTION_FILE))
...@@ -660,6 +673,25 @@ void accum_file(struct darshan_file *dfile, ...@@ -660,6 +673,25 @@ void accum_file(struct darshan_file *dfile,
} }
static void calc_red_read(struct darshan_job *djob,
hash_entry_t *file_hash)
{
hash_entry_t *curr = NULL;
hash_entry_t *tmp = NULL;
printf("#<jobid>\t<type>\t<file_hash>\t<max_byte_read>\t<bytes_read>\n");
HASH_ITER(hlink, file_hash, curr, tmp)
{
if((curr->counters[CP_MAX_BYTE_READ]+1) < curr->counters[CP_BYTES_READ])
{
printf("%" PRId64 "\tred-read\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\n",
djob->jobid, curr->hash, curr->counters[CP_MAX_BYTE_READ], curr->counters[CP_BYTES_READ]);
}
}
return;
}
void calc_file(struct darshan_job *djob, void calc_file(struct darshan_job *djob,
hash_entry_t *file_hash, hash_entry_t *file_hash,
file_data_t *fdata) file_data_t *fdata)
......
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