openvax / mhcflurry

Peptide-MHC I binding affinity prediction
http://openvax.github.io/mhcflurry/
Apache License 2.0
191 stars 57 forks source link

Control spawned threads during predict #135

Closed ccario83 closed 5 years ago

ccario83 commented 5 years ago

I'm noticing that mhcflurry-predict will spawn ~34 threads on my 16 core development machine when running with a large number of peptides. This tends to overwhelm the system. Is there a way to control the number of threads per main prediction process?

Awesome tool, thanks for all the great work.

timodonnell commented 5 years ago

These threads are spawned by tensorflow by default. Agree it would be nice to be able to customize that. I'll try adding this

timodonnell commented 5 years ago

I added a --threads argument to mhcflurry-predict, so you can try e.g. --threads 1. The actual number of spawned threads may be higher than the value you specify since tensorflow seems to add some extra, but I don't think they're using much CPU.

Curious if this fixes your issue and thanks for your interest in mhcflurry!