Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report fails to read xml produced by record due to extraneous empty elements #2

Open
derekbruening opened this issue May 11, 2021 · 0 comments

Comments

@derekbruening
Copy link

There are extraneous empty elements in the xml produced:

$ ./roofline.py record ~/dr/test/roofline 1 100000
/mypath/extsw/roofline//dynamorio/build/bin64/drrun  -c /mypath/extsw/roofline//client/build/libroofline.so --output_folder /mypath/extsw/roofline//mypath/dr/test/roofline_1_1000002021-05-11_02:24:21/       -- /mypath/dr/test/roofline 1 100000
> Roofline is running to get FP and Bytes accessed.
<wrapping _RoiStart @0x00007ff57b900275
<wrapping _RoiEnd @0x00007ff57b900287
Estimation of pi is 3.141592653598162
Received 29 alarms
/mypath/extsw/roofline//dynamorio/build/bin64/drrun  -c /mypath/extsw/roofline//client/build/libroofline.so --output_folder /mypath/extsw/roofline//mypath/dr/test/roofline_1_1000002021-05-11_02:24:21/       --time_run -- /mypath/dr/test/roofline 1 100000
> Roofline is running for gathering timining information
<wrapping _RoiStart @0x00007f0eafb67275
<wrapping _RoiEnd @0x00007f0eafb67287
Estimation of pi is 3.141592653598162
Received 2 alarms

$ ./roofline.py report -i mypath/dr/test/roofline_1_1000002021-05-11_02\:24\:21 --line myhost_FP64 --output_dir out
Roofline: building report merging a roofline for myhost_FP64 precision. Please make sure you target application has used the same precision
Traceback (most recent call last):
  File "/mypath/extsw/roofline/./roofline.py", line 694, in <module>
    sys.exit(main())
  File "/mypath/extsw/roofline/./roofline.py", line 690, in main
    args.func(args)
  File "/mypath/extsw/roofline/./roofline.py", line 452, in report
    current_points = get_points(in_dir, colour_n+1, get_app_title(in_dir))
  File "/mypath/extsw/roofline/./roofline.py", line 131, in get_points
    root = ET.parse(in_dir + '/roofline.xml').getroot()
  File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 1229, in parse
    tree.parse(source, parser)
  File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 580, in parse
    self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: junk after document element: line 14, column 0

Here's the roofline.xml file:

<?xml version="1.0"?>
<roofline>
<point label="pi_estimation">
<flops>700004</flops>
<bytes>124807562</bytes>
<read_bytes>59204690</read_bytes>
<write_bytes>65602872</write_bytes>
<src_file_start>/mypath/dr/test/roofline.cpp</src_file_start>
<src_file_end>/mypath/dr/test/roofline.cpp</src_file_end>
<line_n_start>69</line_n_start>
<line_n_end>91</line_n_end>
</point>
</roofline>
<?xml version="1.0"?>
<roofline>
</roofline>

Note the final 3 lines: when I remove them (and similar lines in roofline_time.xml) then the report successfully parses them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant