Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
darshan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
71
Issues
71
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
darshan
darshan
Commits
384e9b5c
Commit
384e9b5c
authored
Sep 18, 2016
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter out unused stdio records
parent
ad21fea6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
darshan-runtime/lib/darshan-stdio.c
darshan-runtime/lib/darshan-stdio.c
+28
-1
No files found.
darshan-runtime/lib/darshan-stdio.c
View file @
384e9b5c
...
...
@@ -78,6 +78,8 @@
#include <assert.h>
#include <libgen.h>
#include <pthread.h>
#include <stdint.h>
#include <limits.h>
#include "darshan.h"
#include "darshan-dynamic.h"
...
...
@@ -488,7 +490,6 @@ int DARSHAN_DECL(vfprintf)(FILE *stream, const char *format, va_list ap)
{
int
ret
;
double
tm1
,
tm2
;
long
start_off
,
end_off
;
MAP_OR_FAIL
(
vfprintf
);
...
...
@@ -1115,6 +1116,8 @@ static void stdio_shutdown(
MPI_Op
red_op
;
int
stdio_rec_count
;
double
stdio_time
;
FILE
*
fp
[
3
];
int
trim_records
=
0
;
STDIO_LOCK
();
assert
(
stdio_runtime
);
...
...
@@ -1219,6 +1222,30 @@ static void stdio_shutdown(
DARSHAN_MPI_CALL
(
PMPI_Op_free
)(
&
red_op
);
}
/* filter out any records that have no activity on them; this is
* specifically meant to filter out unused stdin, stdout, or stderr
* entries
*
* NOTE: we can no longer use the darshan_lookup_record_ref()
* function at this point to find specific records, because the
* logic above has likely broken the mapping to the static array.
* We walk it manually here instead.
*/
for
(
i
=
0
;
i
<
stdio_rec_count
;
i
++
)
{
if
(
stdio_rec_buf
[
i
].
counters
[
STDIO_WRITES
]
==
0
&&
stdio_rec_buf
[
i
].
counters
[
STDIO_READS
]
==
0
)
{
if
(
i
!=
(
stdio_rec_count
-
1
))
{
memmove
(
&
stdio_rec_buf
[
i
],
&
stdio_rec_buf
[
i
+
1
],
(
stdio_rec_count
-
i
-
1
)
*
sizeof
(
stdio_rec_buf
[
i
]));
stdio_rec_count
--
;
i
--
;
}
}
}
/* update output buffer size to account for shared file reduction */
*
stdio_buf_sz
=
stdio_rec_count
*
sizeof
(
struct
darshan_stdio_file
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment