-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ def facet(df): | |
df, | ||
col='Library', | ||
margin_titles="true", | ||
sharex=False, | ||
sharey=False, | ||
) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import pandas as pd | ||
import seaborn as sns | ||
import matplotlib.pyplot as plt | ||
from keyname import keyname as kn | ||
from slugify import slugify | ||
import subprocess | ||
import sys | ||
from iterpop import iterpop as ip | ||
import numpy as np | ||
|
||
__, filename = sys.argv | ||
|
||
nproc = int(subprocess.check_output(['nproc'])) | ||
|
||
df = pd.read_csv(filename) | ||
|
||
for k, v in kn.unpack(filename).items(): | ||
df[k] = v | ||
|
||
df = df.astype({ 'num agents' : int }) | ||
|
||
df = df.groupby(['Library', 'Implementation', 'num agents',]).mean().reset_index() | ||
|
||
vanilla = df[df['Implementation'] == 'vanilla'] | ||
lite = df[df['Implementation'] == 'lite'] | ||
|
||
ratio = pd.DataFrame() | ||
ratio['Library'] = vanilla['Library'] | ||
ratio['num agents'] = vanilla['num agents'] | ||
|
||
ratio['Wall Speedup'] = ( | ||
np.array( vanilla['Wall Nanoseconds'] ) | ||
/ np.array( lite['Wall Nanoseconds'] ) | ||
) | ||
|
||
ratio['CPU Speedup'] = ( | ||
np.array( vanilla['CPU Nanoseconds'] ) | ||
/ np.array( lite['CPU Nanoseconds'] ) | ||
) | ||
|
||
sns.barplot( | ||
data=ratio, | ||
x='num agents', | ||
y='Wall Speedup', | ||
hue='Library', | ||
) | ||
|
||
plt.savefig( | ||
kn.pack({ | ||
'measurement' : slugify('Wall Speedup'), | ||
'ext' : '.png', | ||
}), | ||
transparent=True, | ||
dpi=300, | ||
) | ||
|
||
plt.clf() | ||
|
||
sns.barplot( | ||
data=ratio, | ||
x='num agents', | ||
y='CPU Speedup', | ||
hue='Library', | ||
) | ||
|
||
plt.savefig( | ||
kn.pack({ | ||
'measurement' : slugify('CPU Speedup'), | ||
'ext' : '.png', | ||
}), | ||
transparent=True, | ||
dpi=300, | ||
) | ||
|
||
plt.clf() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters