# Control threads

**URL:** <https://discuss.hail.is/t/control-threads/1778>\
**Category:** Hail Query & hailctl\
**Created:** [November 7, 2020, 4:21pm UTC](https://discuss.hail.is/t/control-threads/1778 "2020-11-07T16:21:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzh](https://avatars.discourse-cdn.com/v4/letter/z/b77776/32.png) [@zzh](https://discuss.hail.is/u/zzh)\
**Post date:** [November 7, 2020, 4:21pm UTC](https://discuss.hail.is/t/control-threads/1778/1 "2020-11-07T16:21:15Z")

</div>

Hi,  
Every time I run Hail, all the threads are called in,so could you please tell me how do I control the threads used by the Hail runtime.  
Thanks!

---

<div class="post-metadata">

**Author:** ![cseed](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/cseed/32/361_2.png) [@cseed](https://discuss.hail.is/u/cseed)\
**Post date:** [November 7, 2020, 5:42pm UTC](https://discuss.hail.is/t/control-threads/1778/2 "2020-11-07T17:42:02Z")

</div>

This is controlled by Spark, and you can set it with the `master` argument to `hl.init`: [https://hail.is/docs/0.2/api.html#hail.init](https://hail.is/docs/0.2/api.html#hail.init). For example: `hl.init(master='local[2]')` to use 2 cores.
