def create_worker_list(prm): # for each thread set up FsDriftWorkload instance, # create a thread instance, and delete the thread-ready file thread_list = [] for k in range(0, prm.threads): nextinv = worker_thread.FsDriftWorkload(prm) nextinv.tid = '%02d' % k t = invoke_process.subprocess(nextinv) thread_list.append(t) ensure_deleted(nextinv.gen_thread_ready_fname(nextinv.tid)) return thread_list
def create_worker_list(prm): # for each thread set up smf_invocation instance, # create a thread instance, and delete the thread-ready file thread_list = [] for k in range(0, prm.thread_count): nextinv = smallfile.smf_invocation.clone(prm.master_invoke) nextinv.tid = "%02d" % k if not prm.master_invoke.is_shared_dir: nextinv.src_dirs = [ d + os.sep + prm.master_invoke.onhost + os.sep + "thrd_" + nextinv.tid \ for d in nextinv.src_dirs ] nextinv.dest_dirs = [ d + os.sep + prm.master_invoke.onhost + os.sep + "thrd_" + nextinv.tid \ for d in nextinv.dest_dirs ] t = invoke_process.subprocess(nextinv) thread_list.append(t) ensure_deleted(nextinv.gen_thread_ready_fname(nextinv.tid)) return thread_list
def create_worker_list(prm): # for each thread set up smf_invocation instance, # create a thread instance, and delete the thread-ready file thread_list=[] for k in range(0,prm.thread_count): nextinv = smallfile.smf_invocation.clone(prm.master_invoke) nextinv.tid = "%02d"%k if not prm.master_invoke.is_shared_dir: nextinv.src_dirs = [ d + os.sep + prm.master_invoke.onhost + os.sep + "thrd_" + nextinv.tid \ for d in nextinv.src_dirs ] nextinv.dest_dirs = [ d + os.sep + prm.master_invoke.onhost + os.sep + "thrd_" + nextinv.tid \ for d in nextinv.dest_dirs ] t = invoke_process.subprocess(nextinv) thread_list.append(t) ensure_deleted(nextinv.gen_thread_ready_fname(nextinv.tid)) return thread_list
def create_worker_list(prm): # for each thread set up SmallfileWorkload instance, # create a thread instance, and delete the thread-ready file thread_list = [] for k in range(0, prm.thread_count): nextinv = copy.copy(prm.master_invoke) nextinv.tid = '%02d' % k if not prm.master_invoke.is_shared_dir: nextinv.src_dirs = [d + os.sep + prm.master_invoke.onhost + os.sep + 'thrd_' + nextinv.tid for d in nextinv.src_dirs] nextinv.dest_dirs = [d + os.sep + prm.master_invoke.onhost + os.sep + 'thrd_' + nextinv.tid for d in nextinv.dest_dirs] t = invoke_process.subprocess(nextinv) thread_list.append(t) ensure_deleted(nextinv.gen_thread_ready_fname(nextinv.tid)) return thread_list
# this is all that gets run # for each thread set up smf_invocation instance, # create a thread instance, and delete the thread-ready file thread_list=[] for k in range(0,prm_thread_count): nextinv = smallfile.smf_invocation.clone(master_invoke) nextinv.tid = "%02d"%k if master_invoke.is_shared_dir: nextinv.src_dir += "/d" + nextinv.tid nextinv.dest_dir += "/d" + nextinv.tid else: nextinv.src_dir += "/" + master_invoke.onhost + "/d" + nextinv.tid nextinv.dest_dir += "/" + master_invoke.onhost + "/d" + nextinv.tid t = invoke_process.subprocess(nextinv) thread_list.append(t) starting_gate = thread_list[0].invoke.starting_gate my_host_invoke = thread_list[0].invoke host = short_hostname(None) if not prm_slave: smallfile.ensure_deleted(starting_gate) # start threads, wait for them to reach starting gate # to do this, look for thread-ready files print "starting worker threads on host " + host smallfile.ensure_deleted(my_host_invoke.gen_host_ready_fname(host)) for t in thread_list: smallfile.ensure_dir_exists(t.invoke.src_dir) smallfile.ensure_dir_exists(t.invoke.dest_dir)