aboutsummaryrefslogtreecommitdiffstats
path: root/ecrts14/ecrts14.py
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2014-01-14 11:50:36 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2014-01-14 11:50:36 -0500
commit054d3d7b4a505f95641068b40c0ad280152fef0c (patch)
treede125cd67567ee0660acaef81110f128bbe3d554 /ecrts14/ecrts14.py
parent74aa3e69ce2e3aeb11fb5879868742dd32b32ace (diff)
Compute abs path to overheads directory
Diffstat (limited to 'ecrts14/ecrts14.py')
-rwxr-xr-xecrts14/ecrts14.py18
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
8import os 8import os
9import math 9import math
10import time 10import time
11import inspect
11 12
12import sqlite3 as lite 13import sqlite3 as lite
13import json 14import json
@@ -233,18 +234,26 @@ def complete(results, n):
233def update_mean(old_mean, n, new_sample): 234def 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
237def 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
236def get_consumer_overheads(dp, _system): 242def 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
241def get_producer_overheads(dp): 248def 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
246def get_cpmds(dp): 254def 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)