Skip to content

Commit

Permalink
and also don't start more python processes than necessary. #14
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoslicki committed Mar 27, 2020
1 parent 1002eb5 commit b8d6ded
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMash/GroundTruth.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def __return_containment_index(set1: set, set2: set):
def __compute_all_training_kmers(self):
training_file_to_ksize_to_kmers = dict()
num_threads = multiprocessing.cpu_count()
pool = multiprocessing.Pool(processes=num_threads)
pool = multiprocessing.Pool(processes=int(min(num_threads, len(self.training_file_names))))
# res is returned in the same order as self.training_file_names according to the docs
res = pool.map(self._return_ksize_to_kmers, self.training_file_names)
for (item, file_name) in zip(res, self.training_file_names):
Expand Down

0 comments on commit b8d6ded

Please sign in to comment.