Skip to content

Commit 8d9fb59

Browse files
Shane SnyderShane Snyder
authored andcommitted
filter out DFS records that do no I/O operations
1 parent 331dc95 commit 8d9fb59

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

darshan-runtime/lib/darshan-dfs.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,12 +1250,39 @@ static void dfs_output(
12501250
void **dfs_buf, int *dfs_buf_sz)
12511251
{
12521252
int dfs_rec_count;
1253+
struct darshan_dfs_file *dfs_rec_buf = *(struct darshan_dfs_file **)dfs_buf;
1254+
int i, j;
1255+
int ops;
12531256

12541257
DFS_LOCK();
12551258
assert(dfs_runtime);
12561259

1257-
/* just pass back our updated total buffer size -- no need to update buffer */
12581260
dfs_rec_count = dfs_runtime->file_rec_count;
1261+
1262+
/* filter out records that have been opened, but don't have any
1263+
* I/O operations (e.g, open directories, etc.)
1264+
*/
1265+
for(i=0; i<dfs_rec_count; i++)
1266+
{
1267+
ops = 0;
1268+
for(j=DFS_READS; j<=DFS_STATS; j++)
1269+
{
1270+
ops = dfs_rec_buf[i].counters[j];
1271+
if(ops) break;
1272+
}
1273+
if(!ops)
1274+
{
1275+
if(i != (dfs_rec_count-1))
1276+
{
1277+
memmove(&dfs_rec_buf[i], &dfs_rec_buf[i+1],
1278+
(dfs_rec_count-i-1)*sizeof(dfs_rec_buf[i]));
1279+
i--;
1280+
}
1281+
dfs_rec_count--;
1282+
}
1283+
}
1284+
1285+
/* just pass back our updated total buffer size -- no need to update buffer */
12591286
*dfs_buf_sz = dfs_rec_count * sizeof(struct darshan_dfs_file);
12601287

12611288
dfs_runtime->frozen = 1;

0 commit comments

Comments
 (0)