message: feat: plot additional metrics
diff: @@ -152,31 +152,22 @@ rule plot_benchmarks:
  run:
  import pandas as pd
  import matplotlib.pyplot as plt
  - ls = ['-', '--', '-.', ':']
  + ls = ['-', '--', '-.', ':', ':']
  b = pd.read_csv(input[0], sep=None)
  threads = sorted(b.threads.unique())
  + for i, (key, label) in enumerate([("cpu_time", "CPU time"), ("max_rss", "max memory usage (max_rss)"), ("s", "total time [s]")]):
  plt.figure()
  for mi,method in enumerate(b.method.unique()):
  for ti,t in enumerate(threads):
  d = b.loc[(b.method==method)&(b.threads==t),:].groupby('size').mean()
  - plt.plot(d.index, d.cpu_time, label=f"{method}, t={t}", c=f'C{mi}', ls=ls[ti%len(ls)])
  + plt.plot(d.index, d[key]*t, label=f"{method}, t={t}" if t==1 else '',
  + c=f'C{mi}', ls=ls[ti%len(ls)])
  plt.ylabel('CPU time')
  plt.yscale('log')
  plt.xscale('log')
  plt.legend()
  - plt.savefig(output[0])
  -
  - plt.figure()
  - for mi,method in enumerate(b.method.unique()):
  - for ti,t in enumerate(threads):
  - d = b.loc[(b.method==method)&(b.threads==t),:].groupby('size').mean()
  - plt.plot(d.index, d.max_rss, label=f"{method}, t={t}", c=f'C{mi}', ls=ls[ti%len(ls)])
  - plt.ylabel('max memory usage (max_rss)')
  - plt.yscale('log')
  - plt.xscale('log')
  - plt.legend()
  - plt.savefig(output[1])
  + plt.savefig(output[i])
  rule clean:
  shell:
  