If you have one hyperthreaded Intel CPU the default affinity should be correct for any thread count.
Just find the number of threads that gives the best performance.
Affinity should only be a concern with AMD CPUs that have a different way of implementing multicore HW.
As the previous discussions have shown it's still in the learning stage.
Otherwise your calculations are correct.
I tried a different number of threads without cpu-affinity. This gives a worse result than with cpu-affinity. Example:
:: c:\Miners\cpuminer-opt-3.6.1-windows\cpuminer-aes-avx2.exe -a zoin -o stratum+tcp://hexx.suprnova.cc:2876 -u spronkin1.Rig1 -p x --cpu-priority 2 -t 1
:: -t 1=478H/s
:: -t 2=660H/s
:: -t 4=1230H/s
:: -t 5=1530H/s
:: -t 6=1470H/s
:: -t 7=1600H/s
:: -t 8=1472H/s
:: -t 9=1423H/s
:: -t 10=1312H/s
:: -t 11=1220H/s
:: -t 12=1210H/s
:: -t 16=1070H/s
:: -t 20=1000H/s
:: -t 23=900H/s
:: -t 7 + --cpu-affinity 0xffffff= 1712H/s - why?:
:: c:\Miners\cpuminer-opt-3.6.1-windows\cpuminer-aes-avx2.exe -a zoin -o stratum+tcp://hexx.suprnova.cc:2876 -u spronkin1.Rig1 -p x --cpu-priority 2 -t 7 --cpu-affinity 0xffffff
Don't use affinity with default thread count, it just messes things up.
Try different affinities with 12 threads. The default should be the same as 0xffffff.
Here are the results I received:
:: 0d4095=0b111111111111=0xfff=1230H/s
:: 0d8191=0x1FFF=1240H/s
:: 0d16383=0x3FFF=1240H/s
:: 0d32767=0b111111111111111=0x7FFF=1231H/s
:: 0d33023=0b1000000011111111=0x80FF=1450H/s
:: 0d33151=0b1000000101111111=0x817F=1460H/s
:: 0d33167=0b1000000110001111=0x818F=1763H/s
:: 0d33168=0b1000000110010000=0x8190=1850H/s
:: 0d33169=0b1000000110010001=0x8191=2140H/s
:: 0d33171=0b1000000110010011=0x8193=2200H/s
:: 0d33175=0b1000000110010111=0x8197=2200H/s
:: 0d33199=0bx1000000110101111=0x81AF=1700H/s
:: 0d33279=0b1000000111111111=0x81FF=1430H/s
:: 0d16777215=0b111111111111111111111111=0xffffff=1234H/s (as default affinity)
While I chose this result:
c:\Miners\cpuminer-opt-3.6.1-windows\cpuminer-aes-avx2.exe -a zoin -o stratum+tcp://hexx.suprnova.cc:2876 -u spronkin1.Rig1 -p x --cpu-priority 2 --cpu-affinity 0x8197
I did not check the hashrate with --cpu-affinity outside this range between 33279 and 65535 or more. I do not know, maybe there are better results. I just can not understand the principle of the -cpu-affinity parameter, how does it work?