@@ -6,7 +6,7 @@ def cli():
66 cli .add_argument ('-y' ,'--yaml' , metavar = 'YAML' ,help = 'path to YAML file' ,required = True )
77 cli .add_argument ('-c' ,'--clara' , metavar = 'DIR' ,help = 'CLARA_HOME path (default=$CLARA_HOME)' ,default = os .getenv ('CLARA_HOME' ,None ))
88 cli .add_argument ('-t' ,'--threads' ,metavar = '#' ,help = 'threads (default=4,8)' ,default = '4,8' )
9- cli .add_argument ('-e' ,'--events' , metavar = '#' ,help = 'events per threads (default=2550 )' ,default = 555 ,type = int )
9+ cli .add_argument ('-e' ,'--events' , metavar = '#' ,help = 'events per threads (default=2555 )' ,default = 2555 ,type = int )
1010 cli .add_argument ('-N' ,'--numa' , metavar = '#' ,help = 'NUMA socket (default=None, choices=[0,1])' ,default = None ,type = int ,choices = [0 ,1 ])
1111 cli .add_argument ('datafile' , help = 'input EVIO/HIPO data file' )
1212 cfg = cli .parse_args ()
@@ -123,6 +123,22 @@ def save(benchmarks):
123123 for row in table (benchmarks ):
124124 f .write (' ' .join ([str (x ) for x in row ])+ '\n ' )
125125
126+ def plot ():
127+ import os ,shutil ,subprocess
128+ if shutil .which ('gnuplot' ):
129+ g = os .path .dirname (os .path .abspath (__file__ ))+ '/scaling.gpl'
130+ r = subprocess .run (['gnuplot' ,g ], capture_output = True , text = True )
131+ if r .returncode == 0 :
132+ with open ('scaling.svg' ,'w' ) as f :
133+ f .write (r .stdout )
134+ print ('Info: created scaling.svg from scaling.txt and scaling.gpl!' )
135+ else :
136+ print (r .stdout )
137+ print (r .stderr )
138+ print ('Error: gnuplot failed!' )
139+ else :
140+ print ('Warning: gnuplot is not in $PATH.' )
141+
126142if __name__ == '__main__' :
127143 cfg = cli ()
128144 import os
@@ -133,4 +149,5 @@ if __name__ == '__main__':
133149 benchmarks .append ([threads , benchmark (cfg , threads , log )])
134150 show (benchmarks )
135151 save (benchmarks )
152+ plot ()
136153
0 commit comments