# Number of cores need to be specified at compile time?

**URL:** <https://forum.zcashcommunity.com/t/number-of-cores-need-to-be-specified-at-compile-time/1657>\
**Category:** zcashd client\
**Created:** [September 11, 2016, 5:36pm UTC](https://forum.zcashcommunity.com/t/number-of-cores-need-to-be-specified-at-compile-time/1657 "2016-09-11T17:36:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@adrian](https://forum.zcashcommunity.com/u/adrian)\
**Post date:** [September 11, 2016, 5:36pm UTC](https://forum.zcashcommunity.com/t/number-of-cores-need-to-be-specified-at-compile-time/1657/1 "2016-09-11T17:36:55Z")

</div>

Hi

The beta mining guide is awesome, thanks!

The compile command line however, is the following:

```
./zcutil/build.sh -j$(nproc)

```

Does that mean the number of core used by the program need to be determined pre-compilation?

Or that can be changed in the conf file?

Does this concerns computation of transactions, or mining as well?

Thanks

---

<div class="post-metadata">

**Author:** ![Shawn](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/shawn/32/187_2.png) [@Shawn](https://forum.zcashcommunity.com/u/Shawn)\
**Post date:** [September 11, 2016, 5:49pm UTC](https://forum.zcashcommunity.com/t/number-of-cores-need-to-be-specified-at-compile-time/1657/2 "2016-09-11T17:49:25Z")

</div>

That line only applies to the the compilation step to help speed up the process. It’s not used in mining or in the .conf file.

You can also use `./zcutil/build.sh` by itself without a processor argument it will just use one CPU to do the work.

If you want to use more cores for mining your can set `genproclimit=4` in the .conf file. Change that number to however many cores you have.

---

<div class="post-metadata">

**Author:** ![adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@adrian](https://forum.zcashcommunity.com/u/adrian)\
**Post date:** [September 11, 2016, 5:53pm UTC](https://forum.zcashcommunity.com/t/number-of-cores-need-to-be-specified-at-compile-time/1657/3 "2016-09-11T17:53:35Z")

</div>

Ok I see. Makes sense 🙂

About the `genproclimit` option. Is there any difference (memory-wise) on using one daemon spread over a many-core setup, or many dameon on many single-core setups?

I guess it’s the same? Or some of the memory can be shared on the many-cores setup?

The hashing bottleneck being the memory bandwidth, is it a problem to mine on many-core s - because the core would “fight” for the memory bus, or is it not a concern?

Thanks

---

<div class="post-metadata">

**Author:** ![Shawn](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/shawn/32/187_2.png) [@Shawn](https://forum.zcashcommunity.com/u/Shawn)\
**Post date:** [September 11, 2016, 6:17pm UTC](https://forum.zcashcommunity.com/t/number-of-cores-need-to-be-specified-at-compile-time/1657/4 "2016-09-11T18:17:41Z")

</div>

Zcash’s Equihash solver is not internally paralleized, so when you set genproclimit=(?) you are actually launching that many solvers to crunch Equihash. That’s why I don’t reccomend setting it more than the _physical_ number of cores on your CPU.

If you have a 4core/8thread (ie: intel hyperthreading) CPU and set the number to 8 you can actually lose performance vs if you had set the number to 4.

Test it out for yourself, and feel free to post your results at [benchmark.minezcash.com](http://benchmark.minezcash.com)

---

<div class="post-metadata">

**Author:** ![Eon](https://avatars.discourse-cdn.com/v4/letter/e/b38774/32.png) [@Eon](https://forum.zcashcommunity.com/u/Eon)\
**Post date:** [September 11, 2016, 6:31pm UTC](https://forum.zcashcommunity.com/t/number-of-cores-need-to-be-specified-at-compile-time/1657/5 "2016-09-11T18:31:41Z")

</div>

> [@Shawn](#):
>
> Zcash’s Equihash solver is not internally paralleized

Do you think this is something in the future that will be improved upon?

---

<div class="post-metadata">

**Author:** ![Shawn](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/shawn/32/187_2.png) [@Shawn](https://forum.zcashcommunity.com/u/Shawn)\
**Post date:** [September 11, 2016, 7:02pm UTC](https://forum.zcashcommunity.com/t/number-of-cores-need-to-be-specified-at-compile-time/1657/6 "2016-09-11T19:02:47Z")

</div>

I’ve seen the developers mention it before on Github, but it was ultimately decided not to do so because it would add unneeded complexity, plus the whole point of Equihash is to keep the playing field (somewhat) level between CPU and GPU.

I don’t know if you could/would be able to keep the desired 700MB per mining core requirement if it was internally paralleized.

---

<div class="post-metadata">

**Author:** ![zawy](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/zawy/32/11892_2.png) [@zawy](https://forum.zcashcommunity.com/u/zawy)\
**Post date:** [September 11, 2016, 7:33pm UTC](https://forum.zcashcommunity.com/t/number-of-cores-need-to-be-specified-at-compile-time/1657/7 "2016-09-11T19:33:04Z")

</div>

> [@adrian](#):
>
> The hashing bottleneck being the memory bandwidth, is it a problem to mine on many-core s - because the core would “fight” for the memory bus, or is it not a concern?

When you use genproclimit=4 it seems to be about 4x more blocks gained than when using genproclimit=1, and I can’t tell a difference in machines that use DDR3 1333 and DDR3 1600, but the 1333 machines have a faster CPU. All the benchmarks I’ve seen have been indicating

solve speed = CPU speed x RAM bandwidth

And the consequences I see support it:  
blocks gained = CPU speed x RAM bandwidth x cores

This assumes you run the solver with the miner off and on 1 thread.

I also have not been able to tell a difference in number of RAM cards. I can use an 8 GB in one slot, 8 GB in 2, or 4 GB in each of 4, and it’s all the same in terms of number of blocks gain on testnet.

---

<div class="post-metadata">

**Author:** ![adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@adrian](https://forum.zcashcommunity.com/u/adrian)\
**Post date:** [September 11, 2016, 7:40pm UTC](https://forum.zcashcommunity.com/t/number-of-cores-need-to-be-specified-at-compile-time/1657/8 "2016-09-11T19:40:16Z")

</div>

@zawy thanks for sharing your results, very interesting!
