def run(self): while not self.kill_received: # get a task try: job = self.work_queue.get_nowait() except Queue.Empty: break start_time = time.time(); bvpl_octree_batch.init_process("bvpl_taylor_global_add_error_process"); bvpl_octree_batch.set_input_from_db(0,job.global_taylor); bvpl_octree_batch.set_input_int(1, job.scene_id); bvpl_octree_batch.set_input_int(2, job.block_i); bvpl_octree_batch.set_input_int(3, job.block_j); bvpl_octree_batch.set_input_int(4, job.block_k); bvpl_octree_batch.run_process(); (id, type) = bvpl_octree_batch.commit_output(0); error_val = dbvalue(id, type); error = bvpl_octree_batch.get_output_double(id); self.result_queue.put(error); bvpl_octree_batch.clear(); print ("Runing time for worker:", self.name) print(time.time() - start_time);
def run(self): while not self.kill_received: # get a task try: job = self.work_queue.get_nowait() except Queue.Empty: break start_time = time.time(); bvpl_octree_batch.init_process("bvplThresholdHarrisProcess"); bvpl_octree_batch.set_input_string(0,job.taylor_path); bvpl_octree_batch.set_input_int(1, job.scene_id); bvpl_octree_batch.set_input_int(2, job.block_i); bvpl_octree_batch.set_input_int(3, job.block_j); bvpl_octree_batch.set_input_int(4, job.block_k); bvpl_octree_batch.set_input_double(5, job.harris_k); bvpl_octree_batch.run_process(); bvpl_octree_batch.clear(); print ("Runing time for worker:", self.name) print(time.time() - start_time); #output exit code in this case #important: having a result queue makes the execute_jobs wait for all jobs in the queue before exiting self.result_queue.put(0);
def run(self): while not self.kill_received: # get a task try: job = self.work_queue.get_nowait() except Queue.Empty: break start_time = time.time() print ("Creating a Scene") bvpl_octree_batch.init_process("boxmCreateSceneProcess") bvpl_octree_batch.set_input_string(0, job.path_scene_in) bvpl_octree_batch.run_process() (id, type) = bvpl_octree_batch.commit_output(0) scene = dbvalue(id, type) print ("Save Scene") bvpl_octree_batch.init_process("boxmSaveSceneRawProcess") bvpl_octree_batch.set_input_from_db(0, scene) bvpl_octree_batch.set_input_string(1, job.path_scene_out) bvpl_octree_batch.set_input_unsigned(2, 0) bvpl_octree_batch.set_input_unsigned(3, 1) bvpl_octree_batch.run_process() plot_histogram(job.path_scene_out + "_hist_plot.txt") bvpl_octree_batch.clear() print ("Runing time for worker:", self.name) print (time.time() - start_time)
def run(self): while not self.kill_received: # get a task try: job = self.work_queue.get_nowait() except Queue.Empty: break start_time = time.time(); bvpl_octree_batch.init_process("bvplThresholdCornersProcess"); bvpl_octree_batch.set_input_from_db(0,job.global_taylor); bvpl_octree_batch.set_input_from_db(1,job.global_corners); bvpl_octree_batch.set_input_int(2, job.scene_id); bvpl_octree_batch.set_input_float(3, job.harris_threshold); bvpl_octree_batch.set_input_string(4, job.output_path); bvpl_octree_batch.run_process(); #Save dristhi raw scene drishti_dir = job.output_path + "/drishti"; if not os.path.isdir(drishti_dir +"/"): os.mkdir(drishti_dir +"/"); path_scene_out = drishti_dir + "/valid_scene"; print("Creating a Scene"); bvpl_octree_batch.init_process("boxmCreateSceneProcess"); bvpl_octree_batch.set_input_string(0, job.output_path + "/valid_scene_" + str(job.scene_id) + ".xml"); bvpl_octree_batch.run_process(); (id, type) = bvpl_octree_batch.commit_output(0); scene= dbvalue(id, type); print("Save Scene"); bvpl_octree_batch.init_process("boxmSaveSceneRawProcess"); bvpl_octree_batch.set_input_from_db(0,scene); bvpl_octree_batch.set_input_string(1, path_scene_out); bvpl_octree_batch.set_input_unsigned(2,0); bvpl_octree_batch.set_input_unsigned(3,1); bvpl_octree_batch.run_process(); bvpl_octree_batch.clear(); print ("Runing time for worker:", self.name) print(time.time() - start_time);
def run(self): while not self.kill_received: # get a task try: job = self.work_queue.get_nowait() except Queue.Empty: break start_time = time.time(); bvpl_octree_batch.init_process("bvplInitGlobalPCAProcess"); bvpl_octree_batch.set_input_string(0,job.pca_dir); bvpl_octree_batch.set_input_unsigned(1, job.scene_id); bvpl_octree_batch.run_process(); bvpl_octree_batch.clear(); print ("Runing time for worker:", self.name) print(time.time() - start_time);
def run(self): while not self.kill_received: # get a task try: job = self.work_queue.get_nowait() except Queue.Empty: break start_time = time.time() bvpl_octree_batch.init_process("bvplCornerStatisticsProcess") bvpl_octree_batch.set_input_from_db(0, job.global_taylor) bvpl_octree_batch.set_input_from_db(1, job.global_corners) bvpl_octree_batch.set_input_int(2, job.scene_id) bvpl_octree_batch.run_process() bvpl_octree_batch.clear() print ("Runing time for worker:", self.name) print (time.time() - start_time)
def run(self): while not self.kill_received: # get a task try: job = self.work_queue.get_nowait() except Queue.Empty: break start_time = time.time(); bvpl_octree_batch.init_process("bvplPCAProjectProcess"); bvpl_octree_batch.set_input_from_db(0,job.global_pca); bvpl_octree_batch.set_input_int(1, job.scene_id); bvpl_octree_batch.set_input_int(2, job.block_i); bvpl_octree_batch.set_input_int(3, job.block_j); bvpl_octree_batch.set_input_int(4, job.block_k); bvpl_octree_batch.run_process(); bvpl_octree_batch.clear(); print ("Runing time for worker:", self.name) print(time.time() - start_time);
def run(self): while not self.kill_received: # get a task try: job = self.work_queue.get_nowait() except Queue.Empty: break start_time = time.time(); bvpl_octree_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt"); print("Running Kernel"); bvpl_octree_batch.init_process("bvplBlockKernelOperatorProcess"); bvpl_octree_batch.set_input_from_db(0,job.scene); bvpl_octree_batch.set_input_from_db(1,job.kernel); bvpl_octree_batch.set_input_int(2, job.block_i); bvpl_octree_batch.set_input_int(3, job.block_j) bvpl_octree_batch.set_input_int(4, job.block_k) bvpl_octree_batch.set_input_string(5,"algebraic"); bvpl_octree_batch.set_input_string(6, job.output_path); bvpl_octree_batch.set_input_double(7, job.cell_length); bvpl_octree_batch.run_process(); print ("Runing time for worker:", self.name) print(time.time() - start_time); #free memory bvpl_octree_batch.reset_stdout(); bvpl_octree_batch.clear(); #output exit code in this case #important: having a result queue makes the execute_jobs wait for all jobs in the queue before exiting self.result_queue.put(0);