Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Shane Snyder
darshan
Commits
cb7397ac
Commit
cb7397ac
authored
Sep 18, 2016
by
Philip Carns
Browse files
implement file list modes for stdio
parent
384e9b5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
darshan-util/darshan-parser.c
View file @
cb7397ac
...
...
@@ -116,6 +116,7 @@ void mpiio_file_list(hash_entry_t *file_hash, struct darshan_name_record_ref *na
void
stdio_accum_perf
(
struct
darshan_stdio_file
*
pfile
,
perf_data_t
*
pdata
);
void
stdio_accum_file
(
struct
darshan_stdio_file
*
pfile
,
hash_entry_t
*
hfile
,
int64_t
nprocs
);
void
stdio_calc_file
(
hash_entry_t
*
file_hash
,
file_data_t
*
fdata
);
void
stdio_file_list
(
hash_entry_t
*
file_hash
,
struct
darshan_name_record_ref
*
name_hash
,
int
detail_flag
);
void
calc_perf
(
perf_data_t
*
pdata
,
int64_t
nprocs
);
...
...
@@ -643,6 +644,13 @@ int main(int argc, char **argv)
else
mpiio_file_list
(
file_hash
,
name_hash
,
0
);
}
else
if
(
i
==
DARSHAN_STDIO_MOD
)
{
if
(
mask
&
OPTION_FILE_LIST_DETAILED
)
stdio_file_list
(
file_hash
,
name_hash
,
1
);
else
stdio_file_list
(
file_hash
,
name_hash
,
0
);
}
}
/* reset data structures for next module */
...
...
@@ -1700,6 +1708,90 @@ void mpiio_print_total_file(struct darshan_mpiio_file *mfile)
return
;
}
void
stdio_file_list
(
hash_entry_t
*
file_hash
,
struct
darshan_name_record_ref
*
name_hash
,
int
detail_flag
)
{
hash_entry_t
*
curr
=
NULL
;
hash_entry_t
*
tmp
=
NULL
;
struct
darshan_stdio_file
*
file_rec
=
NULL
;
struct
darshan_name_record_ref
*
ref
=
NULL
;
int
i
;
/* list of columns:
*
* normal mode
* - file id
* - file name
* - nprocs
* - slowest I/O time
* - average cumulative I/O time
*
* detailed mode
* - first open
* - first read
* - first write
* - last read
* - last write
* - last close
* - STDIO opens
*/
if
(
detail_flag
)
printf
(
"
\n
# Per-file summary of I/O activity (detailed).
\n
"
);
else
printf
(
"
\n
# Per-file summary of I/O activity.
\n
"
);
printf
(
"# <record_id>: darshan record id for this file
\n
"
);
printf
(
"# <file_name>: full file name
\n
"
);
printf
(
"# <nprocs>: number of processes that opened the file
\n
"
);
printf
(
"# <slowest>: (estimated) time in seconds consumed in IO by slowest process
\n
"
);
printf
(
"# <avg>: average time in seconds consumed in IO per process
\n
"
);
if
(
detail_flag
)
{
printf
(
"# <start_{open/close/write/read}>: start timestamp of first open, close, write, or read
\n
"
);
printf
(
"# <end_{open/close/write/read}>: end timestamp of last open, close, write, or read
\n
"
);
printf
(
"# <stdio_opens>: STDIO open calls
\n
"
);
}
printf
(
"
\n
# <record_id>
\t
<file_name>
\t
<nprocs>
\t
<slowest>
\t
<avg>"
);
if
(
detail_flag
)
{
printf
(
"
\t
<start_open>
\t
<start_close>
\t
<start_write>
\t
<start_read>"
);
printf
(
"
\t
<end_open>
\t
<end_close>
\t
<end_write>
\t
<end_read>
\t
<stdio_opens>"
);
}
printf
(
"
\n
"
);
HASH_ITER
(
hlink
,
file_hash
,
curr
,
tmp
)
{
file_rec
=
(
struct
darshan_stdio_file
*
)
curr
->
rec_dat
;
assert
(
file_rec
);
HASH_FIND
(
hlink
,
name_hash
,
&
(
curr
->
rec_id
),
sizeof
(
darshan_record_id
),
ref
);
assert
(
ref
);
printf
(
"%"
PRIu64
"
\t
%s
\t
%"
PRId64
"
\t
%f
\t
%f"
,
curr
->
rec_id
,
ref
->
name_record
->
name
,
curr
->
procs
,
curr
->
slowest_time
,
curr
->
cumul_time
/
(
double
)
curr
->
procs
);
if
(
detail_flag
)
{
for
(
i
=
STDIO_F_OPEN_START_TIMESTAMP
;
i
<=
STDIO_F_READ_END_TIMESTAMP
;
i
++
)
{
printf
(
"
\t
%f"
,
file_rec
->
fcounters
[
i
]);
}
printf
(
"
\t
%"
PRId64
,
file_rec
->
counters
[
STDIO_OPENS
]);
}
printf
(
"
\n
"
);
}
return
;
}
void
posix_file_list
(
hash_entry_t
*
file_hash
,
struct
darshan_name_record_ref
*
name_hash
,
int
detail_flag
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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