Commit 814b1266 authored by Shane Snyder's avatar Shane Snyder

add macro to detect partial posix file recs

parent e5bfa490
......@@ -176,4 +176,11 @@ struct darshan_posix_file
double fcounters[POSIX_F_NUM_INDICES];
};
/* This macro can be used to identify files that have been opened using
* pnetcdf, hdf5, or mpi-io, but were never opened at the posix level. As a
* result the record will not necessarily have all of the expected fields
* populated.
*/
#define POSIX_FILE_PARTIAL(__file)((((__file)->counters[POSIX_OPENS] || (__file)->counters[POSIX_FOPENS] || (__file)->counters[POSIX_STATS]) ? 0 : 1))
#endif /* __DARSHAN_POSIX_LOG_FORMAT_H */
......@@ -1719,7 +1719,10 @@ static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
tmp_file.counters[j] = infile->counters[j] + inoutfile->counters[j];
}
tmp_file.counters[POSIX_MODE] = infile->counters[POSIX_MODE];
if(POSIX_FILE_PARTIAL(infile))
tmp_file.counters[POSIX_MODE] = inoutfile->counters[POSIX_MODE];
else
tmp_file.counters[POSIX_MODE] = infile->counters[POSIX_MODE];
/* sum */
for(j=POSIX_BYTES_READ; j<=POSIX_BYTES_WRITTEN; j++)
......@@ -1742,8 +1745,10 @@ static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
tmp_file.counters[j] = infile->counters[j] + inoutfile->counters[j];
}
tmp_file.counters[POSIX_MEM_ALIGNMENT] = infile->counters[POSIX_MEM_ALIGNMENT];
tmp_file.counters[POSIX_FILE_ALIGNMENT] = infile->counters[POSIX_FILE_ALIGNMENT];
if(POSIX_FILE_PARTIAL(infile))
tmp_file.counters[POSIX_MEM_ALIGNMENT] = inoutfile->counters[POSIX_MEM_ALIGNMENT];
else
tmp_file.counters[POSIX_MEM_ALIGNMENT] = infile->counters[POSIX_MEM_ALIGNMENT];
/* sum */
for(j=POSIX_FILE_NOT_ALIGNED; j<=POSIX_FILE_NOT_ALIGNED; j++)
......@@ -1751,6 +1756,11 @@ static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
tmp_file.counters[j] = infile->counters[j] + inoutfile->counters[j];
}
if(POSIX_PARTIAL_FILE(infile))
tmp_file.counters[POSIX_FILE_ALIGNMENT] = inoutfile->counters[POSIX_FILE_ALIGNMENT];
else
tmp_file.counters[POSIX_FILE_ALIGNMENT] = infile->counters[POSIX_FILE_ALIGNMENT];
/* skip POSIX_MAX_*_TIME_SIZE; handled in floating point section */
for(j=POSIX_SIZE_READ_0_100; j<=POSIX_SIZE_WRITE_1G_PLUS; j++)
......
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