Skip to content

Commit

Permalink
some changes i had lying around
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Kate committed Nov 14, 2014
1 parent 5829acc commit 08e8bd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/exp/paperexperiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def define_experiments():
# show difference in request routing
exp = {'name': "pkeys", 'defs': []}
users = "--graph=twitter_graph_1.8M.dat"
clientBase = "%s %s --popduration=0 --duration=1000000000 --postlimit=10000000 " \
clientBase = "%s %s --popduration=0 --duration=1000000000 --postlimit=1000000 " \
"--pactive=70 --ppost=1 --pread=100 --psubscribe=10 --plogout=5 " \
"--no-prevalidate --print-table=p" % (clientCmd, users)

Expand Down
14 changes: 8 additions & 6 deletions scripts/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ def start_memcache(expdef, id):
serverprocs = []
dbprocs = []

nservercpus = min(nprocesses, maxcpus - startcpu - ngroups)

if usedb or rediscompare:
dbenvpath = os.path.join(resdir, "store")
check_database_env(e)
Expand Down Expand Up @@ -358,7 +360,7 @@ def start_memcache(expdef, id):
fartfile = os.path.join(resdir, "fart_srv_" + str(s) + ".txt")

if affinity:
pin = "numactl -C " + str(startcpu + s) + " "
pin = "numactl -C " + str(startcpu + (s % nservercpus)) + " "

full_cmd = pin + servercmd + serverargs + " -kl=" + str(startport + s)
serverprocs.append(run_cmd_bg(full_cmd, fartfile, fartfile))
Expand All @@ -369,10 +371,10 @@ def start_memcache(expdef, id):
sleep(3)

clientcpulist = ""
if startcpu + nprocesses + ngroups > maxcpus:
if startcpu + nservercpus + ngroups > maxcpus:
# if we want to run more clients than we have processors left,
# just run them all on the set of remaining cpus
clientcpulist = ",".join([str(startcpu + nprocesses + c) for c in range(maxcpus - (startcpu + nprocesses))])
clientcpulist = ",".join([str(startcpu + nservercpus + c) for c in range(maxcpus - (startcpu + nservercpus))])

if 'initcmd' in e:
print "Initializing cache servers."
Expand All @@ -385,7 +387,7 @@ def start_memcache(expdef, id):
initcmd = initcmd + " -H=" + hostpath + " -B=" + str(nbacking)

if affinity:
pin = "numactl -C " + str(startcpu + nprocesses) + " "
pin = "numactl -C " + str(startcpu + nservercpus) + " "

full_cmd = pin + initcmd
run_cmd(full_cmd, fartfile, fartfile)
Expand Down Expand Up @@ -426,7 +428,7 @@ def start_memcache(expdef, id):

if affinity:
pin = "numactl -C " + (clientcpulist if clientcpulist and npop > 1 \
else str(startcpu + nprocesses + c)) + " "
else str(startcpu + nservercpus + c)) + " "

if npop > 1:
grouparg = " --ngroups=" + str(npop) + " --groupid=" + str(c) + \
Expand Down Expand Up @@ -491,7 +493,7 @@ def start_memcache(expdef, id):
clientcmd = clientcmd + " --writearound --dbhostfile=" + dbhostpath

if affinity:
pin = "numactl -C " + (clientcpulist if clientcpulist else str(startcpu + nprocesses + c)) + " "
pin = "numactl -C " + (clientcpulist if clientcpulist else str(startcpu + nservercpus + c)) + " "

if ngroups > 1:
grouparg = " --ngroups=" + str(ngroups) + " --groupid=" + str(c) + \
Expand Down

0 comments on commit 08e8bd5

Please sign in to comment.