diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2014-01-14 11:50:36 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2014-01-14 11:50:36 -0500 |
commit | 054d3d7b4a505f95641068b40c0ad280152fef0c (patch) | |
tree | de125cd67567ee0660acaef81110f128bbe3d554 /ecrts14/ecrts14.py | |
parent | 74aa3e69ce2e3aeb11fb5879868742dd32b32ace (diff) |
Compute abs path to overheads directory
Diffstat (limited to 'ecrts14/ecrts14.py')
-rwxr-xr-x | ecrts14/ecrts14.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/ecrts14/ecrts14.py b/ecrts14/ecrts14.py index 68200a9..b0a381a 100755 --- a/ecrts14/ecrts14.py +++ b/ecrts14/ecrts14.py | |||
@@ -8,6 +8,7 @@ import sys | |||
8 | import os | 8 | import os |
9 | import math | 9 | import math |
10 | import time | 10 | import time |
11 | import inspect | ||
11 | 12 | ||
12 | import sqlite3 as lite | 13 | import sqlite3 as lite |
13 | import json | 14 | import json |
@@ -233,18 +234,26 @@ def complete(results, n): | |||
233 | def update_mean(old_mean, n, new_sample): | 234 | def update_mean(old_mean, n, new_sample): |
234 | return (old_mean*n + new_sample)/(n+1) | 235 | return (old_mean*n + new_sample)/(n+1) |
235 | 236 | ||
237 | def get_ovh_dir(): | ||
238 | parent = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) | ||
239 | ovh_dir = os.path.join(parent, 'overheads') | ||
240 | return ovh_dir | ||
241 | |||
236 | def get_consumer_overheads(dp, _system): | 242 | def get_consumer_overheads(dp, _system): |
237 | co_file = 'overheads/%s/consumer/dco_host=%s_lvl=mem_polluters=%s_walk=%s_hpages=%s_upages=%s_type=%s.csv' % (dp.host, dp.host, str(dp.polluters), dp.walk, str(dp.huge_pages), str(dp.uncached), dp.ovh_type) | 243 | co_file = '%s/consumer/dco_host=%s_lvl=mem_polluters=%s_walk=%s_hpages=%s_upages=%s_type=%s.csv' % (dp.host, dp.host, str(dp.polluters), dp.walk, str(dp.huge_pages), str(dp.uncached), dp.ovh_type) |
244 | co_file = os.path.join(get_ovh_dir(), co_file) | ||
238 | co = ConsumerOverheads.from_file(co_file, non_decreasing=False, system=_system) | 245 | co = ConsumerOverheads.from_file(co_file, non_decreasing=False, system=_system) |
239 | return co | 246 | return co |
240 | 247 | ||
241 | def get_producer_overheads(dp): | 248 | def get_producer_overheads(dp): |
242 | po_file = 'overheads/%s/producer/dpo_host=%s_type=%s.csv' % (dp.host, dp.host, dp.ovh_type) | 249 | po_file = '%s/producer/dpo_host=%s_type=%s.csv' % (dp.host, dp.host, dp.ovh_type) |
250 | po_file = os.path.join(get_ovh_dir(), po_file) | ||
243 | po = ProducerOverheads.from_file(po_file, non_decreasing=False) | 251 | po = ProducerOverheads.from_file(po_file, non_decreasing=False) |
244 | return po | 252 | return po |
245 | 253 | ||
246 | def get_cpmds(dp): | 254 | def get_cpmds(dp): |
247 | cpmd_file = 'overheads/%s/cpmd/dpmo_host=%s_lvl=mem_wcycle=%s_polluters=%s_walk=%s_hpages=%s_upages=%s_type=%s.csv' % (dp.host, dp.host, str(dp.wcycle), str(dp.polluters), dp.walk, str(dp.huge_pages), str(dp.uncached), dp.ovh_type) | 255 | cpmd_file = '%s/cpmd/dpmo_host=%s_lvl=mem_wcycle=%s_polluters=%s_walk=%s_hpages=%s_upages=%s_type=%s.csv' % (dp.host, dp.host, str(dp.wcycle), str(dp.polluters), dp.walk, str(dp.huge_pages), str(dp.uncached), dp.ovh_type) |
256 | cpmd_file = os.path.join(get_ovh_dir(), cpmd_file) | ||
248 | cpmds = CacheDelay.from_file(cpmd_file, non_decreasing=False) | 257 | cpmds = CacheDelay.from_file(cpmd_file, non_decreasing=False) |
249 | return cpmds | 258 | return cpmds |
250 | 259 | ||
@@ -253,7 +262,8 @@ def get_overheads(dp, system = None): | |||
253 | max_dist = dp.system.distance(0, cluster_size-1) | 262 | max_dist = dp.system.distance(0, cluster_size-1) |
254 | lvl = dp.system.levels[max_dist] | 263 | lvl = dp.system.levels[max_dist] |
255 | max_wss = dp.system.max_wss() | 264 | max_wss = dp.system.max_wss() |
256 | ovh_file = 'overheads/ovh_host=%s_sched=%s_lvl=%s_type=%s.csv' % (dp.host, dp.sched, lvl, dp.ovh_type) | 265 | ovh_file = 'ovh_host=%s_sched=%s_lvl=%s_type=%s.csv' % (dp.host, dp.sched, lvl, dp.ovh_type) |
266 | ovh_file = os.path.join(get_ovh_dir(), ovh_file) | ||
257 | ovh = Overheads.from_file(ovh_file) | 267 | ovh = Overheads.from_file(ovh_file) |
258 | ovh.shared_cache = dp.system.schedcat_distance(0, max_dist) | 268 | ovh.shared_cache = dp.system.schedcat_distance(0, max_dist) |
259 | ovh.cache_affinity_loss = get_cpmds(dp) | 269 | ovh.cache_affinity_loss = get_cpmds(dp) |