aboutsummaryrefslogtreecommitdiffstats
path: root/cache_cost.py
diff options
context:
space:
mode:
Diffstat (limited to 'cache_cost.py')
-rwxr-xr-xcache_cost.py36
1 files changed, 21 insertions, 15 deletions
diff --git a/cache_cost.py b/cache_cost.py
index 9f4e54a..9c8f2ac 100755
--- a/cache_cost.py
+++ b/cache_cost.py
@@ -4,6 +4,7 @@ import os
4import copy 4import copy
5import sys 5import sys
6import string 6import string
7import pwd
7import smtplib 8import smtplib
8import socket 9import socket
9import time 10import time
@@ -114,6 +115,15 @@ def run_exp(nsamples, ncpu, numa_args, wss, wcycle, sleep_range_ms, walk, do_pol
114 print str(p) 115 print str(p)
115 print str(probe) 116 print str(probe)
116 117
118def send_email(_to, _msg):
119 user = pwd.getpwuid(os.getuid())[0]
120 host = socket.gethostname()
121 _from = "%s@%s" % (user, host)
122 _body = "\r\n".join(["From: %s" % _from, "To: %s" % _to, "Subject: Test Completed!", "", "{}"])
123 mail = smtplib.SMTP("localhost")
124 mail.sendmail(_from, [_to], _body.format(_msg))
125 mail.quit()
126
117def main(argv): 127def main(argv):
118 nsamples = 5000 128 nsamples = 5000
119 129
@@ -128,12 +138,12 @@ def main(argv):
128 # 138 #
129 # todo: configure numa args for system automatically 139 # todo: configure numa args for system automatically
130 ncpu_and_numa_args = { 140 ncpu_and_numa_args = {
131 6: ['--cpunodebind=0', '--interleave=0'] 141 24: []
132# 12: ['--cpunodebind=0,1', '--interleave=0,1']
133 } 142 }
134 143
135 wss_kb = [4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 3072, 4096, 8192, 12288, 16384] 144 wss_kb = [4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 3072, 4096, 8192, 12288, 16384]
136 write_cycle = [0, 64, 16, 4, 2, 1] 145 write_cycle = [16, 4, 2]
146# write_cycle = [0]
137 147
138 sleep_range_ms = [0,50] 148 sleep_range_ms = [0,50]
139 149
@@ -142,8 +152,11 @@ def main(argv):
142 huge_pages = [False] 152 huge_pages = [False]
143 153
144 pollute = [False, True] 154 pollute = [False, True]
145 walk = ['seq', 'rand'] 155# walk = ['seq', 'rand']
146# walk = ['seq'] 156 walk = ['seq']
157
158 # disable rt throttling in linux scheduler
159 os.system("echo -1 > /proc/sys/kernel/sched_rt_runtime_us")
147 160
148 for ncpu, numa_args in ncpu_and_numa_args.iteritems(): 161 for ncpu, numa_args in ncpu_and_numa_args.iteritems():
149 for u in uncache: 162 for u in uncache:
@@ -158,16 +171,9 @@ def main(argv):
158 run_exp(nsamples, ncpu, numa_args, wss, wcycle, sleep_range_ms, w, p, h, u) 171 run_exp(nsamples, ncpu, numa_args, wss, wcycle, sleep_range_ms, w, p, h, u)
159 172
160 if email_notification: 173 if email_notification:
161 _subject = "Cache Ovh Collection Complete!" 174 to = "gelliott@cs.unc.edu"
162 _to = "gelliott@cs.unc.edu" 175 msg = "Cache Ovh Collection Complete!"
163 _from = "gelliott@bonham.cs.unc.edu" 176 send_email(to, msg)
164 _text = "Cache Ovh Collection Complete!"
165 _body = string.join(("From: %s" % _from, "To: %s" % _to, "Subject: %s" % _subject, "", _text), "\r\n")
166 s = smtplib.SMTP("localhost")
167 s.sendmail(_from, [_to], _body)
168 s.quit()
169
170
171 177
172if __name__ == "__main__": 178if __name__ == "__main__":
173 179