PrimeGrid
Please visit donation page to help the project cover running costs for this month

Advanced search

Message boards : Project Staging Area : prpclient's cpuaffinity value?

Author Message
Profile xrmb
Send message
Joined: 16 Feb 17
Posts: 4
ID: 492587
Credit: 53,798,379
RAC: 10,798
321 LLR Gold: Earned 500,000 credits (889,589)Cullen LLR Ruby: Earned 2,000,000 credits (2,759,507)ESP LLR Amethyst: Earned 1,000,000 credits (1,343,917)Generalized Cullen/Woodall LLR Ruby: Earned 2,000,000 credits (3,951,038)PPS LLR Silver: Earned 100,000 credits (177,679)PSP LLR Ruby: Earned 2,000,000 credits (4,585,997)SoB LLR Jade: Earned 10,000,000 credits (13,884,867)SR5 LLR Gold: Earned 500,000 credits (625,065)SGS LLR Bronze: Earned 10,000 credits (37,160)TRP LLR Amethyst: Earned 1,000,000 credits (1,064,749)Woodall LLR Turquoise: Earned 5,000,000 credits (5,136,684)321 Sieve Silver: Earned 100,000 credits (198,823)Generalized Cullen/Woodall Sieve (suspended) Gold: Earned 500,000 credits (736,293)PPS Sieve Turquoise: Earned 5,000,000 credits (8,117,368)TRP Sieve (suspended) Silver: Earned 100,000 credits (475,162)AP 26/27 Ruby: Earned 2,000,000 credits (3,634,657)GFN Turquoise: Earned 5,000,000 credits (5,903,163)PSA Silver: Earned 100,000 credits (276,662)
Message 106112 - Posted: 17 Mar 2017 | 2:16:35 UTC

I hope this is the right place to ask.

What should the value for cpuaffinity be? A cpu number or a bitmask or a bitmask as a number? I assume it is bitmask as number since -1 would turn into FFFF... and mean all cpus.

So, if I want a client to only run on CPU 4 (assuming we start counting at 1), 8 (0b1000), and not "4" or "1000".

I tried them all, and at least llr64 did not care, so I used imagecfg to force the exe file to an affinity.

Profile composite
Volunteer tester
Send message
Joined: 16 Feb 10
Posts: 764
ID: 55391
Credit: 688,096,381
RAC: 78,145
Discovered 2 mega primesFound 1 prime in the 2018 Tour de Primes321 LLR Turquoise: Earned 5,000,000 credits (5,477,467)Cullen LLR Gold: Earned 500,000 credits (776,297)ESP LLR Ruby: Earned 2,000,000 credits (3,120,351)Generalized Cullen/Woodall LLR Ruby: Earned 2,000,000 credits (2,056,207)PPS LLR Jade: Earned 10,000,000 credits (18,195,180)PSP LLR Turquoise: Earned 5,000,000 credits (5,027,818)SoB LLR Sapphire: Earned 20,000,000 credits (24,671,131)SR5 LLR Turquoise: Earned 5,000,000 credits (6,110,877)SGS LLR Ruby: Earned 2,000,000 credits (3,477,744)TRP LLR Turquoise: Earned 5,000,000 credits (7,025,303)Woodall LLR Amethyst: Earned 1,000,000 credits (1,693,614)321 Sieve Emerald: Earned 50,000,000 credits (50,256,050)Cullen/Woodall Sieve (suspended) Turquoise: Earned 5,000,000 credits (5,571,178)Generalized Cullen/Woodall Sieve (suspended) Emerald: Earned 50,000,000 credits (50,009,610)PPS Sieve Double Silver: Earned 200,000,000 credits (312,256,351)Sierpinski (ESP/PSP/SoB) Sieve (suspended) Jade: Earned 10,000,000 credits (10,165,888)TRP Sieve (suspended) Sapphire: Earned 20,000,000 credits (20,071,454)AP 26/27 Turquoise: Earned 5,000,000 credits (6,616,128)GFN Emerald: Earned 50,000,000 credits (52,755,348)PSA Double Bronze: Earned 100,000,000 credits (102,762,384)
Message 106155 - Posted: 18 Mar 2017 | 20:25:23 UTC - in response to Message 106112.
Last modified: 18 Mar 2017 | 20:27:52 UTC

This is my script for startx.sh

#!/bin/bash instance=$(pwd | sed -re 's/.*-//') CPUs=$(grep processor /proc/cpuinfo | wc -l) cores=$(dc -e "$CPUs 2 / p") mincores=$cores if [ ! -z $1 ]; then if (( $1 < $mincores )); then mincores=$1 fi fi CPUa=$(dc -e "$instance 1 - $mincores % p") CPUb=$(dc -e "$CPUa $cores + p") echo running on logical CPUs $(dc -e "$CPUa 1 + p") and $(dc -e "$CPUb 1 + p") sed -i 's/^stopasapoption=./stopasapoption=0/' prpclient.ini # go rm -f nohup.out && nohup taskset -c $CPUa,$CPUb ./prpclient -v >nohup.out 2>&1 &

syntax: startx.sh [N]

The first argument "N" is an optional integer. It constrains affinity to be within the first N cores (to help you partition work on your system). If N is not supplied, affinity is on any core.

It uses the prpclient-X directory name to set CPU affinity for the task to the pair of HT CPUs on the same physical core (this is for Linux; in Windows HT pairs are adjacent N).

"taskset" here sets the affinity using a comma-separated list rather than a bitmask.

This is not an especially efficient use of HT, and you could remove $CPUb from the taskset command.

Profile xrmb
Send message
Joined: 16 Feb 17
Posts: 4
ID: 492587
Credit: 53,798,379
RAC: 10,798
321 LLR Gold: Earned 500,000 credits (889,589)Cullen LLR Ruby: Earned 2,000,000 credits (2,759,507)ESP LLR Amethyst: Earned 1,000,000 credits (1,343,917)Generalized Cullen/Woodall LLR Ruby: Earned 2,000,000 credits (3,951,038)PPS LLR Silver: Earned 100,000 credits (177,679)PSP LLR Ruby: Earned 2,000,000 credits (4,585,997)SoB LLR Jade: Earned 10,000,000 credits (13,884,867)SR5 LLR Gold: Earned 500,000 credits (625,065)SGS LLR Bronze: Earned 10,000 credits (37,160)TRP LLR Amethyst: Earned 1,000,000 credits (1,064,749)Woodall LLR Turquoise: Earned 5,000,000 credits (5,136,684)321 Sieve Silver: Earned 100,000 credits (198,823)Generalized Cullen/Woodall Sieve (suspended) Gold: Earned 500,000 credits (736,293)PPS Sieve Turquoise: Earned 5,000,000 credits (8,117,368)TRP Sieve (suspended) Silver: Earned 100,000 credits (475,162)AP 26/27 Ruby: Earned 2,000,000 credits (3,634,657)GFN Turquoise: Earned 5,000,000 credits (5,903,163)PSA Silver: Earned 100,000 credits (276,662)
Message 106198 - Posted: 20 Mar 2017 | 23:57:25 UTC - in response to Message 106155.

I ended up turning HT off... with 8 threads on 4 cores I got an "iteration time" of 9ms... with 4 threads on 4 cores with HT I get 5ms... when messing with affinity I get it down to 3ms... with 4 threads on 4 cores w/o HT I get well below 3ms, and dont have to mess with affinity at all...

Message boards : Project Staging Area : prpclient's cpuaffinity value?

[Return to PrimeGrid main page]
DNS Powered by DNSEXIT.COM
Copyright © 2005 - 2020 Rytis Slatkevičius (contact) and PrimeGrid community. Server load 2.05, 2.15, 2.83
Generated 30 Oct 2020 | 2:55:18 UTC