Rovanion / iozone-results-comparator

Tool for comparing outputs of iozone to each other
GNU General Public License v3.0
5 stars 7 forks source link

Value Error when parsing iozone output #5

Closed arnehueggenberg closed 5 years ago

arnehueggenberg commented 6 years ago

When trying to pare output generated by iozone 3.424 a ValueError is thrown:

ValueError: invalid literal for int() with base 10: '28985 1'

I have attached the iozone output files baseline_1.iozone.txt target_1.iozone.txt

Rovanion commented 6 years ago

As you can see from the commit history this repository was originally authored by Petr Benas only to be fluffed up by me in 2015. In other words, this issue is probably going to be fixed by you if anyone.

thom24 commented 5 years ago

I got the same issue than you, and I created a patch to fix it.

--- a/src/parse_iozone.py   2015-12-29 15:16:48.000000000 +0100
+++ b/src/parse_iozone.py   2019-06-14 14:22:14.772489128 +0200
@@ -52,31 +52,11 @@
     def split_iozone_line(self,line):
         # See CONTROL_STRING3 definition in iozone.c source code
         #Manual test - check the position of the last digit in iozone result file
-        if ( self.version < 3.4 ):
-            field_list = [16, 8, 8, 8, 9, 9, 8, 8, 8, 9, 9, 9, 9, 8, 9]
-        else:
-            field_list = [16, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 9, 9, 9, 9]
-  #                          24    42    60 69 78 87      07  16 25 34 43
-
-        offset = 0
         output = []
         line=line.rstrip('\n')
-        for i in range(len(field_list)):
-            width = field_list[i]
-            substring=line[offset:width+offset]
-            offset += width
-            if len(substring) == width:
-                matchObj = re.match( r'^\s+$', substring, re.M)
-                if matchObj:
-                    output.append(None)
-                else:
-                    output.append(int(substring))
-            else:
-                output.append(None)
-                if i != len(field_list) -1 or ( width - len(substring) ) > 3 :
-                    sys.stderr.write('%s "%s"\n' % ("Line:", line ) )
-                    sys.stderr.write('\t%s "%s"\n' % ("Substring:", substring ) )
-                    sys.stderr.write('\t%s %d, %s %d\n' % ("Length:", len(substring), "Expecting:", width  ) )
+        line = line.split()
+        for elem in line:
+            output.append(int(elem))
         return output

     # read data from input files
Rovanion commented 5 years ago

That looks great @thom24! Could you apply that to a git branch, push it to GitHub and open a pull request against this repo?

thom24 commented 5 years ago

Yes I can !! But i get a permission denied when i try to push my branch on github.

Rovanion commented 5 years ago

Make sure that you have your public key added to GitHub and that the remote you are pushing to is actually yours. Instructions for the former you'll find here: https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account and the latter by running git remote -v.