def main(haplotypeMatrix):
#dictAccuracy = {} # {0 : [no. of snp , correctly identified]}\n",
manager = Manager()
dictAccuracy = manager.dict() # synchronize dictionary for multiprocessing
nprocs = [] # saves the process
for item in list_split(haplotypeMatrix.shape[0],arg2):
print 'range of haplotype given to each thread: ' ,item
for item in list_split(haplotypeMatrix.shape[0],arg2): #Specify number of thread
n = multiprocessing.Process(target=Computation, args=(item,haplotypeMatrix,dictAccuracy )) # multiprocessing
nprocs.append(n)
n.start()
for i in nprocs:
i.join() # waiting for all the process to finish
#print dictAccuracy
print 'Switch Accuracy is : ', SwitchAccuracy(dictAccuracy)
print 'Accuracy is : ', NewAccuracy(dictAccuracy)
评论列表
文章目录