Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
darshan
darshan
Commits
e4d608dd
Commit
e4d608dd
authored
Mar 11, 2021
by
Philip Carns
Browse files
validate input file format in dxt_analyzer
parent
4f87238e
Changes
1
Show whitespace changes
Inline
Side-by-side
darshan-util/dxt_analyzer.py
View file @
e4d608dd
...
@@ -80,6 +80,7 @@ import matplotlib
...
@@ -80,6 +80,7 @@ import matplotlib
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
import
re
import
re
import
argparse
import
argparse
import
sys
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Regular expression and helper funtion definitions
# Regular expression and helper funtion definitions
...
@@ -258,6 +259,14 @@ if (args.singlefile_mode):
...
@@ -258,6 +259,14 @@ if (args.singlefile_mode):
with
open
(
dxt_logname
)
as
infile
:
with
open
(
dxt_logname
)
as
infile
:
try
:
line
=
infile
.
readline
()
if
"# darshan"
not
in
line
:
raise
Exception
(
'Invalid file format'
)
except
:
print
(
"Error: unable to parse "
+
dxt_logname
+
"."
,
file
=
sys
.
stderr
)
print
(
" Please make sure that it was generated by the darshan-dxt-parser utility."
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
finfo_dict
=
{}
finfo_dict
=
{}
curr_fname
=
''
curr_fname
=
''
logdata
=
[]
logdata
=
[]
...
...
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