Skip to content

Request: Default to 1 CPU thread #70

@schorlton

Description

@schorlton

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions