I have started plaing with multithreading code to add smp to vajolet.
My cpu is intel core i5-m520 that should have 2 phisical core and up to 4 thread, I think it's due to Hyper-Thrading.
I have implemented my first multithreaded code and I started adding code to perft code.
these are my result for the stating position
#threads- speed
1 - 29.5Mn/s
2 - 53.2Mn/s
3 - 57.3Mn/s
4 - 60.2Mn/s
5 - 62.0Mn/s
6 - 60.8Mn/s
it's ok that I don't gain performance over 2 threads?
have you got some good advide for a newbie of multithreading?
my next step is to add transposition table to perft and next test it in a multithread environment
hyperthreading performance
Moderator: Ras
-
xmas79
- Posts: 286
- Joined: Mon Jun 03, 2013 7:05 pm
- Location: Italy
Re: hyperthreading performance
Hi,
be sure to disable cpu freq scaling before mesuring smp scaling... One core pushes cpu clock speed up to 2.93GHz (for your cpu), when you have multiple cores cpu freq goes down.
be sure to disable cpu freq scaling before mesuring smp scaling... One core pushes cpu clock speed up to 2.93GHz (for your cpu), when you have multiple cores cpu freq goes down.
-
elcabesa
- Posts: 858
- Joined: Sun May 23, 2010 1:32 pm
Re: hyperthreading performance
thank you, I don't konw how to disablit, maybe from bios?
-
cetormenter
- Posts: 170
- Joined: Sun Oct 28, 2012 9:46 pm
Re: hyperthreading performance
If you are under Windows then you can go to your power options and under "more power options", go to change plan settings and then advanced settings. Under processor power management change both the minimum and maximum to be 99%. This stops turbo boosting from occurring as long as you are on this power option.
There is also someway to change it in bios but I have never been able to find it. Plus this makes it easy to turn it off and on without needing a restart.
There is also someway to change it in bios but I have never been able to find it. Plus this makes it easy to turn it off and on without needing a restart.
-
elcabesa
- Posts: 858
- Joined: Sun May 23, 2010 1:32 pm
Re: hyperthreading performance
it looks like it's working pretty well with transposition table and multithread.
with 4 threads and no lock on Transposition i can reach
Perft 7 leaf nodes: 3195901860
10.86s 294282 kN/s
Perft 8 leaf nodes: 84998978956
141.4s 601124 kN/s
obviously if I add lock to transposition table the prformance go down
with 4 threads and no lock on Transposition i can reach
Perft 7 leaf nodes: 3195901860
10.86s 294282 kN/s
Perft 8 leaf nodes: 84998978956
141.4s 601124 kN/s
obviously if I add lock to transposition table the prformance go down
-
xmas79
- Posts: 286
- Joined: Mon Jun 03, 2013 7:05 pm
- Location: Italy
Re: hyperthreading performance
How does it scales with cores? TT should give a bigger boost per core, no?
-
elcabesa
- Posts: 858
- Joined: Sun May 23, 2010 1:32 pm
Re: hyperthreading performance
I only have 2 phisical core, the 2 core perft performance is 1.82 times faster.
using transposition tables perft 7 with 2 cores is 10 times faster.
perft 8 should be near 25 times faster
using transposition tables perft 7 with 2 cores is 10 times faster.
perft 8 should be near 25 times faster