veg / hyphy

HyPhy: Hypothesis testing using Phylogenies
http://www.hyphy.org
Other
201 stars 68 forks source link

How to specify thread use #1602

Closed chenyangkang closed 1 year ago

chenyangkang commented 1 year ago

Hi,

I wanna specify thread use in the command line mode. Is that possible? Currently it takes 5 threads automatically for some reason, and that will be a problem if I batch submit my jobs.

Thanks!

Yangkang

spond commented 1 year ago

Dear @chenyangkang,

You can use CPU=N command line argument to indicate the maximum # of threads for HyPhy to use. HyPhy will auto-benchmark individual analyses to see if it's worth using more than one thread, but will never use more than N. By default N = the number of CPU cores (or threads, depending on what the system CPU count returns).

For example (-m writes out log files).

hyphy -m tests/hbltests/SimpleOptimizations/SmallCodon.bf         
...
 grep benchmark messages.log                              
Auto-benchmarked an optimal number (4) of threads.
hyphy -m CPU=2 tests/hbltests/SimpleOptimizations/SmallCodon.bf       
...
 grep benchmark messages.log                              
Auto-benchmarked an optimal number (2) of threads.
hyphy -m CPU=1 tests/hbltests/SimpleOptimizations/SmallCodon.bf
...
grep benchmark messages.log                              
<empty>

Best, Sergei

github-actions[bot] commented 1 year ago

Stale issue message