Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Default to 1 CPU thread #70

Open
schorlton opened this issue May 10, 2023 · 0 comments
Open

Request: Default to 1 CPU thread #70

schorlton opened this issue May 10, 2023 · 0 comments

Comments

@schorlton
Copy link

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:

# 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant