Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
darshan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
61
Issues
61
List
Boards
Labels
Milestones
Merge Requests
6
Merge Requests
6
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
darshan
darshan
Commits
b51c463b
Commit
b51c463b
authored
Jun 15, 2016
by
Glenn K. Lockwood
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working set of tools to parse darshan lustre-mod logfiles
parent
735fc530
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
14 deletions
+77
-14
darshan-lustre-logutils.c
darshan-util/darshan-lustre-logutils.c
+77
-14
No files found.
darshan-util/darshan-lustre-logutils.c
View file @
b51c463b
...
...
@@ -49,27 +49,45 @@ static int darshan_log_get_lustre_record(darshan_fd fd, void* lustre_buf,
int
i
;
int
ret
;
/* retrieve the fixed-size portion of the record */
ret
=
darshan_log_getmod
(
fd
,
DARSHAN_LUSTRE_MOD
,
lustre_buf
,
sizeof
(
struct
darshan_lustre_record
));
if
(
ret
<
0
)
return
(
-
1
);
else
if
(
ret
<
sizeof
(
struct
darshan_lustre_record
))
return
(
0
);
else
{
rec
=
(
struct
darshan_lustre_record
*
)
lustre_buf
;
/* swap bytes if necessary */
if
(
fd
->
swap_flag
)
{
/* swap bytes if necessary */
DARSHAN_BSWAP64
(
&
rec
->
rec_id
);
DARSHAN_BSWAP64
(
&
rec
->
rank
);
for
(
i
=
0
;
i
<
LUSTRE_NUM_INDICES
;
i
++
)
DARSHAN_BSWAP64
(
&
rec
->
counters
[
i
]);
}
/* now read the rest of the record */
if
(
rec
->
counters
[
LUSTRE_STRIPE_WIDTH
]
>
1
)
{
ret
=
darshan_log_getmod
(
fd
,
DARSHAN_LUSTRE_MOD
,
(
void
*
)(
&
(
rec
->
ost_ids
[
1
])),
(
rec
->
counters
[
LUSTRE_STRIPE_WIDTH
]
-
1
)
*
sizeof
(
OST_ID
)
);
if
(
ret
<
0
)
return
(
-
1
);
else
if
(
ret
<
sizeof
(
struct
darshan_lustre_record
))
return
(
0
);
/* swap bytes if necessary */
if
(
fd
->
swap_flag
)
for
(
i
=
1
;
i
<
rec
->
counters
[
LUSTRE_STRIPE_WIDTH
];
i
++
)
DARSHAN_BSWAP64
(
&
(
rec
->
ost_ids
[
i
]));
}
*
rec_id
=
rec
->
rec_id
;
return
(
1
);
}
}
static
int
darshan_log_put_lustre_record
(
darshan_fd
fd
,
void
*
lustre_buf
,
int
ver
)
...
...
@@ -78,7 +96,7 @@ static int darshan_log_put_lustre_record(darshan_fd fd, void* lustre_buf, int ve
int
ret
;
ret
=
darshan_log_putmod
(
fd
,
DARSHAN_LUSTRE_MOD
,
rec
,
sizeof
(
struct
darshan_lustre_record
),
ver
);
LUSTRE_RECORD_SIZE
(
rec
->
counters
[
LUSTRE_STRIPE_WIDTH
]
),
ver
);
if
(
ret
<
0
)
return
(
-
1
);
...
...
@@ -99,6 +117,20 @@ static void darshan_log_print_lustre_record(void *rec, char *file_name,
lustre_rec
->
counters
[
i
],
file_name
,
mnt_pt
,
fs_type
);
}
for
(
i
=
0
;
i
<
lustre_rec
->
counters
[
LUSTRE_STRIPE_WIDTH
];
i
++
)
{
char
strbuf
[
25
];
snprintf
(
strbuf
,
25
,
"LUSTRE_OST_ID_%d"
,
i
);
DARSHAN_COUNTER_PRINT
(
darshan_module_names
[
DARSHAN_LUSTRE_MOD
],
lustre_rec
->
rank
,
lustre_rec
->
rec_id
,
strbuf
,
lustre_rec
->
ost_ids
[
i
],
file_name
,
mnt_pt
,
fs_type
);
}
return
;
}
...
...
@@ -110,7 +142,8 @@ static void darshan_log_print_lustre_description()
printf
(
"# LUSTRE_MDTS: number of MDTs across the entire file system.
\n
"
);
printf
(
"# LUSTRE_STRIPE_SIZE: stripe size for file in bytes.
\n
"
);
printf
(
"# LUSTRE_STRIPE_WIDTH: number of OSTs over which file is striped.
\n
"
);
printf
(
"# LUSTRE_STRIPE_OFFSET: OBD index of the file's first stripe.
\n
"
);
printf
(
"# LUSTRE_STRIPE_OFFSET: OST ID offset specified when the file was created.
\n
"
);
printf
(
"# LUSTRE_OST_ID_*: indices of OSTs over which the file is striped.
\n
"
);
DARSHAN_PRINT_HEADER
();
...
...
@@ -156,6 +189,36 @@ static void darshan_log_print_lustre_record_diff(void *rec1, char *file_name1,
}
}
/* would it be more or less useful to sort the OST IDs before comparing? */
if
(
lustre_rec1
->
counters
[
LUSTRE_STRIPE_WIDTH
]
==
lustre_rec2
->
counters
[
LUSTRE_STRIPE_WIDTH
]
)
{
for
(
i
=
0
;
i
<
lustre_rec1
->
counters
[
LUSTRE_STRIPE_WIDTH
];
i
++
)
{
if
(
lustre_rec1
->
ost_ids
[
i
]
!=
lustre_rec2
->
ost_ids
[
i
])
{
char
strbuf
[
25
];
snprintf
(
strbuf
,
25
,
"LUSTRE_OST_ID_%d"
,
i
);
printf
(
"- "
);
DARSHAN_COUNTER_PRINT
(
darshan_module_names
[
DARSHAN_LUSTRE_MOD
],
lustre_rec1
->
rank
,
lustre_rec1
->
rec_id
,
strbuf
,
lustre_rec1
->
ost_ids
[
i
],
file_name1
,
""
,
""
);
printf
(
"+ "
);
DARSHAN_COUNTER_PRINT
(
darshan_module_names
[
DARSHAN_LUSTRE_MOD
],
lustre_rec2
->
rank
,
lustre_rec2
->
rec_id
,
strbuf
,
lustre_rec2
->
ost_ids
[
i
],
file_name2
,
""
,
""
);
}
}
}
return
;
}
...
...
Glenn K. Lockwood
@glock
mentioned in issue
#134 (closed)
·
Jun 15, 2016
mentioned in issue
#134 (closed)
mentioned in issue #134
Toggle commit list
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