From 57d87fed3fafd55ae34ddd35cfbeea8fb9c0d26e Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Thu, 2 Jan 2014 10:50:27 -0500 Subject: Script updates. --- cache_cost.py | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'cache_cost.py') 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 import copy import sys import string +import pwd import smtplib import socket import time @@ -114,6 +115,15 @@ def run_exp(nsamples, ncpu, numa_args, wss, wcycle, sleep_range_ms, walk, do_pol print str(p) print str(probe) +def send_email(_to, _msg): + user = pwd.getpwuid(os.getuid())[0] + host = socket.gethostname() + _from = "%s@%s" % (user, host) + _body = "\r\n".join(["From: %s" % _from, "To: %s" % _to, "Subject: Test Completed!", "", "{}"]) + mail = smtplib.SMTP("localhost") + mail.sendmail(_from, [_to], _body.format(_msg)) + mail.quit() + def main(argv): nsamples = 5000 @@ -128,12 +138,12 @@ def main(argv): # # todo: configure numa args for system automatically ncpu_and_numa_args = { - 6: ['--cpunodebind=0', '--interleave=0'] -# 12: ['--cpunodebind=0,1', '--interleave=0,1'] + 24: [] } wss_kb = [4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 3072, 4096, 8192, 12288, 16384] - write_cycle = [0, 64, 16, 4, 2, 1] + write_cycle = [16, 4, 2] +# write_cycle = [0] sleep_range_ms = [0,50] @@ -142,8 +152,11 @@ def main(argv): huge_pages = [False] pollute = [False, True] - walk = ['seq', 'rand'] -# walk = ['seq'] +# walk = ['seq', 'rand'] + walk = ['seq'] + + # disable rt throttling in linux scheduler + os.system("echo -1 > /proc/sys/kernel/sched_rt_runtime_us") for ncpu, numa_args in ncpu_and_numa_args.iteritems(): for u in uncache: @@ -158,16 +171,9 @@ def main(argv): run_exp(nsamples, ncpu, numa_args, wss, wcycle, sleep_range_ms, w, p, h, u) if email_notification: - _subject = "Cache Ovh Collection Complete!" - _to = "gelliott@cs.unc.edu" - _from = "gelliott@bonham.cs.unc.edu" - _text = "Cache Ovh Collection Complete!" - _body = string.join(("From: %s" % _from, "To: %s" % _to, "Subject: %s" % _subject, "", _text), "\r\n") - s = smtplib.SMTP("localhost") - s.sendmail(_from, [_to], _body) - s.quit() - - + to = "gelliott@cs.unc.edu" + msg = "Cache Ovh Collection Complete!" + send_email(to, msg) if __name__ == "__main__": -- cgit v1.2.2