def calculate(srv, run_id, accum): root = getRoot(accum) tag = getTag(accum) params = "--no-ssl {my_initfile}".format(my_initfile=rjoin(root, "inject", tag + ".ini")) execute_injected_python_script(srv, "benchmark.py", root, params) # hirarchy thread_hierarchy = [ { "slave1": ("deploy", deploy(ljoin(ipath, "mult"), "test_framework/mytmp_viff_mult")), "slave2": ("deploy", deploy(ljoin(ipath, "mult"), "test_framework/mytmp_viff_mult")), "slave3": ("deploy", deploy(ljoin(ipath, "mult"), "test_framework/mytmp_viff_mult")), }, {"slave1": ("generate init files", vtf.generate_init_files(["slave1", "slave2", "slave3"], 9001))}, { "slave1": ("put init file", vtf.put_my_init_file), "slave2": ("put init file", vtf.put_my_init_file), "slave3": ("put init file", vtf.put_my_init_file), }, { "slave1": ("do some multiplication", calculate), "slave2": ("do some multiplication", calculate), "slave3": ("do some multiplication", calculate), }, { "slave1": ("do some multiplication", calculate), "slave2": ("do some multiplication", calculate), "slave3": ("do some multiplication", calculate), },
def execute_deploy_1(): ''' helper method for hierarchy 1 ''' localpath = ljoin(ipath, 'viff_three_millionaires') remote_root = rjoin('test_framework', 'benchmarking_example') return deploy(localpath, remote_root) thread_hierarchy_1 = [ { 'bob' : ('deploy', execute_deploy_1()), 'alice' : ('deploy', execute_deploy_1()), 'conrad' : ('deploy', execute_deploy_1()), }, { 'bob' : ('generate init files', vtf.generate_init_files(['bob', 'alice', 'conrad'], 9220)), }, { 'bob' : ('put init file', vtf.put_my_init_file), 'alice' : ('put init file', vtf.put_my_init_file), 'conrad' : ('put init file', vtf.put_my_init_file), } ] # #**Fourth, fifth, sixth and seventh tier**: execute the injected runner.py script, #which in turn executes and benchmarks the viff program. # #Note that in the current implementation the 'tag' and 'run_id' strings #are parsed and used as keyword arguments in the remote script #
slaves = [ { 'tag' : 'slave1', }, { 'tag' : 'slave2', }, { 'tag' : 'slave3', }, ] #hierarchy thread_hierarchy = [ { 'slave1' : ('setup', deploy(ljoin(ipath, 'example'), 'test_framework/millionaires')), 'slave2' : ('setup', deploy(ljoin(ipath, 'example'), 'test_framework/millionaires')), 'slave3' : ('setup', deploy(ljoin(ipath, 'example'), 'test_framework/millionaires')), }, { 'slave1' : ('generate init files', vtf.generate_init_files(['slave1', 'slave2', 'slave3'], 9050)), }, { 'slave1' : ('put init file', vtf.put_my_init_file), 'slave2' : ('put init file', vtf.put_my_init_file), 'slave3' : ('put init file', vtf.put_my_init_file), }, # The results will only be visible in in the log and when the debug flag is set. { 'slave1' : ('who\'s richest?', vtf.let_my_millionaire_participate), 'slave2' : ('who\'s richest?', vtf.let_my_millionaire_participate), 'slave3' : ('who\'s richest?', vtf.let_my_millionaire_participate), }, ]