Commit 2c40940f authored by Shane Snyder's avatar Shane Snyder

Merge branch 'issue-241-fopen-upconvert' into 'master'

omit outputting with old-style fopen counters

Closes #241

See merge request !22
parents 81683bb5 1980d236
......@@ -4,6 +4,9 @@ Darshan Release Change Log
Darshan-3.1.7
=============
* bug fix for darshan-parser backwards compatibility: Darshan logs generated
by Darshan versions prior to 3.1.0 may have included stdio counters that
were not properly up-converted. Reported by Teng Wang.
* bug fix to MiB reported in I/O performance estimate of
darshan-job-summary.pl when both posix and stdio access is present
......
......@@ -86,13 +86,27 @@ static int darshan_log_get_posix_file(darshan_fd fd, void** posix_buf_p)
if(fd->mod_ver[DARSHAN_POSIX_MOD] == 1)
{
rec_len = DARSHAN_POSIX_FILE_SIZE_1;
int64_t *fopen_counter;
/* This version of the posix module had some stdio counters
* mixed in with the posix counters. If the fopen counters are
* 0, then we can simply update the record format to skip those
* counters. If the fopen counters are non-zero, then we omit
* the entire record because there is no clean way to properly
* up-convert it.
*/
dest_p = scratch + (sizeof(struct darshan_base_record) +
(6 * sizeof(int64_t)));
fopen_counter = (int64_t*)dest_p;
do
{
/* pull POSIX records until we find one that doesn't have STDIO data */
ret = darshan_log_get_mod(fd, DARSHAN_POSIX_MOD, scratch, rec_len);
} while(ret == rec_len && *fopen_counter > 0);
if(ret != rec_len)
goto exit;
/* upconvert version 1 to version 2 in-place */
dest_p = scratch + (sizeof(struct darshan_base_record) +
(6 * sizeof(int64_t)));
src_p = dest_p + (4 * sizeof(int64_t));
len = rec_len - (src_p - scratch);
memmove(dest_p, src_p, len);
......@@ -230,9 +244,9 @@ static void darshan_log_print_posix_description(int ver)
if(ver <= 1)
{
printf("\n# WARNING: POSIX module log format version 1 has the following limitations:\n");
printf("# - Partial instrumentation of stdio stream I/O functions not parsable by Darshan versions >= 3.1.0\n");
printf("# * Using darshan-logutils versions < 3.1.0, this data can be found in the following POSIX counters:\n");
printf("# * POSIX_FOPENS, POSIX_FREADS, POSIX_FWRITES, POSIX_FSEEKS\n");
printf("# - Darshan version 3.1.0 and earlier had only partial instrumentation of stdio stream I/O functions.\n");
printf("# File records with stdio counters present will be omitted from output.\n");
printf("# Use darshan-logutils < 3.1.0 to retrieve those records.\n");
}
if(ver <= 2)
{
......
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