-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Thanks for the great tool. I'm of the opinion that Kleborate should not use more than 1 thread unless allocated more via a command line arg as I suppose it would be possible for it to clobber hundreds of CPUs in a worst case scenario without the user being able to control it.
I see this in the code:
Kleborate/kleborate/kaptive.py
Lines 53 to 68 in f2c9c31
| # Try with multiple threads, and if that fails (possible due to a multithreading BLAST | |
| # error), try again with one thread. | |
| kaptive_results = run_kaptive(kaptive_py, kaptive_db, contigs, outfile, | |
| args.min_kaptive_confidence, one_thread=False) | |
| if kaptive_results is None: | |
| kaptive_results = run_kaptive(kaptive_py, kaptive_db, contigs, outfile, | |
| args.min_kaptive_confidence, one_thread=True) | |
| assert len(headers) == len(kaptive_results) | |
| return dict(zip(headers, kaptive_results)) | |
| else: | |
| return {} | |
| def run_kaptive(kaptive_py, kaptive_db, contigs, output_file, min_confidence, one_thread): | |
| thread_option = ' --threads 1' if one_thread else '' |
Is it possible limit to 1 thread by default and add a flag when calling the tool if the user wants more? I don't expect that multithreading would provide significant speed advantage regardless?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels