#!/usr/bin/env python import os, time, string runtime = 60 noisedelay = 20 noisetime = 30 datasrc = ["talia", "192.168.20.3", "lyta.local"] noisesrc = ["lyta.local", "192.168.10.2", "talia"] dir = "cd /raid/home/hozer/cpre543x/tests/; " #bandwidth rates for noise (kilobits/sec), default iperf UDP packets noiserates = [ 0, 50, 100, 200, 500, 1000, 2000 ] #noiserates = [ 0 ] #iperf '-l' argument sizes = [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144] args = ['', '-z', '-u -b30M'] for sz in sizes: print "size %d" % sz for nz in noiserates: print "noise rate %d" % nz for arg in args: print "arg: %s" % arg file = datasrc[0] + '_sz-%d_nz-%d_'%(sz,nz) + \ string.replace(arg, ' ', '') #start data recv cmd = dir + "./iperf -i1 -s %s | tee rs/recv-%s" \ % (arg, file) datarecv = os.spawnlp(os.P_NOWAIT, 'ssh', 'ssh', \ datasrc[2], cmd) if nz: #start noise recv cmd = dir + "./iperf -i1 -s -u | tee rs/nsrc-%s" \ % (file) noiserecv = os.spawnlp(os.P_NOWAIT, 'ssh', 'ssh', \ noisesrc[2], cmd) time.sleep(1) #start data send cmd = dir+"./iperf -i1 -t%s -c%s -l%s %s | tee rs/send-%s"%( runtime, datasrc[1], sz, arg, file ) datasend = os.spawnlp(os.P_NOWAIT, 'ssh', 'ssh', \ datasrc[0], cmd) if nz: #start noise send cmd = dir+"./iperf -i1 -t%s -c%s -u -b%sK | tee rs/nssd-%s"%( noisetime, noisesrc[1], nz, file) time.sleep(noisedelay) noisesend = os.spawnlp(os.P_WAIT, 'ssh', 'ssh', \ noisesrc[0], cmd) os.waitpid(datasend, 0) time.sleep(1) os.system("ssh %s killall iperf" % datasrc[2]) if nz: os.system("ssh %s killall iperf" % noisesrc[2]) os.wait()
#!/usr/bin/env python import os, time, string, sys from Numeric import * from mayavi.tools import imv runtime = 60 noisedelay = 20 noisetime = 30 datasrc = ["talia", "192.168.20.3", "lyta.local"] noisesrc = ["lyta.local", "192.168.10.2", "talia"] dir = "cd /raid/home/hozer/cpre543x/tests/; " #bandwidth rates for noise (kilobits/sec), default iperf UDP packets noiserates = [ 0, 50, 100, 200, 500, 1000, 2000 ] #noiserates = [ 0 ] #iperf '-l' argument sizes = [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144] args = ['-u -b30M', '', '-z'] debug=0 v = '' for arg in args: z = [] for sz in sizes: n = [] for nz in noiserates: file = 'rs/send-' + datasrc[0] + '_sz-%d_nz-%d_'%(sz,nz) + \ string.replace(arg, ' ', '') f = open(file,'r') totbytes = 0 lastbw = 0 for line in f.readlines(): if line[0] != '[': continue if line[2:4] == 'ID': continue l = string.split(line,'Bytes') if len(l) < 2: continue bw = l[1][0:7] mag = l[1][7:12] mult = 0 if mag == "bits/": mult=1 elif mag == "Kbits": mult=1000 elif mag == "Mbits": mult=1000*1000 if debug: print bw +' --|' + mag + '|' try: bw = float(bw) * mult lastbw = bw except ValueError: continue sys.stdout.write("file %s" % file) sys.stdout.write(" bw %d\n" % lastbw) n.append(lastbw) z.append(n) # v = imv.view(array(z)) # v.master.wait_window() vis = not debug if vis: x = array(noiserates) y = array(sizes) z = array(z) s = [1.0/noiserates[-1],1.0/sizes[-1],1.0/25e7] s = [1.0/2000,1.0/200,1.0/25e7] if v: v = imv.surf(x,y,z,scale=s,viewer=v) else: v = imv.surf(x,y,z,scale=s) else: print z v.master.wait_window()
#!/usr/bin/env python import os, time, string, sys from Numeric import * from mayavi.tools import imv runtime = 60 noisedelay = 20 noisetime = 30 datasrc = ["talia", "192.168.20.3", "lyta.local"] noisesrc = ["lyta.local", "192.168.10.2", "talia"] dir = "cd /raid/home/hozer/cpre543x/tests/; " #bandwidth rates for noise (kilobits/sec), default iperf UDP packets noiserates = [ 0, 50, 100, 200, 500, 1000, 2000 ] #noiserates = [ 0 ] #iperf '-l' argument sizes = [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144] args = ['-u -b30M', '', '-z'] debug=0 v = '' for arg in args: z = [] for sz in sizes: n = [] for nz in noiserates: t = [] file = 'rs/send-' + datasrc[0] + '_sz-%d_nz-%d_'%(sz,nz) + \ string.replace(arg, ' ', '') f = open(file,'r') totbytes = 0 lastbw = 0 for line in f.readlines(): if line[0] != '[': continue if line[2:4] == 'ID': continue l = string.split(line,'Bytes') if len(l) < 2: continue bw = l[1][0:7] mag = l[1][7:12] mult = 0 if mag == "bits/": mult=1 elif mag == "Kbits": mult=1000 elif mag == "Mbits": mult=1000*1000 if debug: print bw +' --|' + mag + '|' try: bw = float(bw) * mult t.append(bw) lastbw = bw except ValueError: continue t.pop() if len(t) > 60: print "len t is %d" % len(t) sys.exit(1) while len(t) < 60: t.append(0) sys.stdout.write("%s, " % file) for i in t: sys.stdout.write("%d, " %i) sys.stdout.write("%d\n"%lastbw) z.append(t) # v = imv.view(array(z)) # v.master.wait_window() z = array(z) vis = 0 if vis: x = arange(60) y = arange(len(noiserates)*len(sizes)) s = [1.0,1.0,1.0/25e5] if v: v = imv.surf(x,y,z,scale=s,viewer=v) else: v = imv.surf(x,y,z,scale=s) else: pass # print z if vis: v.master.wait_window()