def __exit__(self, ex_type, ex_val, ex_tb): if ex_type: print("exception in block:\n", ex_type, ex_val) import pdb; pdb.set_trace() print("tearing down the system") for vm in self.vms: if not vm.pid: #print(vm, "already dead, not stopping it on tear down") continue try: vm.unfreeze() vm.shared() except: pass if not hasattr(vm, "pipe") or vm.pipe is None: continue ret = vm.pipe.poll() if ret is not None: print("Test {bmark} on {vm} died with {ret}! Manual intervention needed\n\n" \ .format(bmark=vm.bname, vm=vm, ret=ret)) import pdb; pdb.set_trace() # vm.pipe.killall() TODO: hangs after tests. VMs frozen? #for vm in self.vms: # vm.stop() [vm.kill() for vm in VMS] run("killall -SIGCHLD tmux")
def __init__(self, vms, benchmarks=[], debug=False): assert len(benchmarks) <= len(vms) self.benchmarks = benchmarks self.vms = vms self.debug = debug run("killall -SIGCHLD tmux") if any([vm.kill() for vm in vms]): print("giving old VMs time to die...") sleep(3) run("killall -SIGCHLD tmux") if any(vm.pid for vm in vms): raise Exception("there are VMs still running!") if any([vm.start() for vm in vms]): print("let VMs to boot") sleep(10) else: print("no VM start was requested")
[('sdagp', 0), ('blosc', 1), ('static', 2), ('pgbench', 3), ('ffmpeg', 4), ('matrix', 5), ('wordpress', 6), ('sdag', 7)], [('wordpress', 0), ('blosc', 1), ('sdag', 2), ('matrix', 3), ('blosc', 4), ('sdagp', 5), ('sdag', 6), ('blosc', 7)], [('ffmpeg', 0), ('wordpress', 1), ('pgbench', 2), ('ffmpeg', 3), ('pgbench', 4), ('ffmpeg', 5), ('sdagp', 6), ('wordpress', 7)], [('pgbench', 0), ('static', 1), ('matrix', 2), ('ffmpeg', 3), ('wordpress', 4), ('ffmpeg', 5), ('pgbench', 6), ('sdagp', 7)], [('blosc', 0), ('pgbench', 1), ('matrix', 2), ('matrix', 3), ('wordpress', 4), ('pgbench', 5), ('static', 6), ('pgbench', 7)]] def try_all(vms): bmarks = ['pgbench', 'static', 'matrix', 'ffmpeg', 'wordpress', 'ffmpeg', 'pgbench', 'sdagp'] for alloc in combinator(bmarks, topology.all, topology.ht_map): print(alloc) yield alloc if __name__ == '__main__': vms = VMS run("killall -SIGCHLD tmux") time.sleep(0.1) [vm.kill() for vm in vms] time.sleep(2.0) run("killall -SIGCHLD tmux") time.sleep(0.3) vms = VMS time.sleep(5) [vm.start() for vm in vms] time.sleep(BOOT_TIME) # sys_speedups = [] # geom_speedups = [] # for load in try_all(vms): # apply_load(load, vms) # _, before = sysperf(t=30)