Commit e4d608dd authored by Philip Carns's avatar Philip Carns
Browse files

validate input file format in dxt_analyzer

parent 4f87238e
......@@ -80,6 +80,7 @@ import matplotlib
import matplotlib.pyplot as plt
import re
import argparse
import sys
# Regular expression and helper funtion definitions
......@@ -258,6 +259,14 @@ if (args.singlefile_mode):
with open(dxt_logname) as infile:
line = infile.readline()
if "# darshan" not in line:
raise Exception('Invalid file format')
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)
finfo_dict = {}
curr_fname = ''
logdata = []
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment