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

Toggle Menu

Join PrimeGrid

Returning Participants

Community

Leader Boards

Results

Other

drummers-lowrise

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: 44,904,168
RAC: 32,215
321 LLR Gold: Earned 500,000 credits (675,737)Cullen LLR Ruby: Earned 2,000,000 credits (2,382,418)ESP LLR Amethyst: Earned 1,000,000 credits (1,029,917)Generalized Cullen/Woodall LLR Ruby: Earned 2,000,000 credits (3,599,544)PPS LLR Silver: Earned 100,000 credits (153,419)PSP LLR Ruby: Earned 2,000,000 credits (3,635,406)SoB LLR Jade: Earned 10,000,000 credits (11,155,110)SR5 LLR Gold: Earned 500,000 credits (566,353)SGS LLR Bronze: Earned 10,000 credits (31,452)TRP LLR Gold: Earned 500,000 credits (814,221)Woodall LLR Ruby: Earned 2,000,000 credits (4,679,744)321 Sieve Bronze: Earned 10,000 credits (99,411)Generalized Cullen/Woodall Sieve (suspended) Gold: Earned 500,000 credits (736,293)PPS Sieve Turquoise: Earned 5,000,000 credits (6,283,544)TRP Sieve (suspended) Silver: Earned 100,000 credits (475,162)AP 26/27 Ruby: Earned 2,000,000 credits (3,295,045)GFN Turquoise: Earned 5,000,000 credits (5,014,730)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: 748
ID: 55391
Credit: 615,592,564
RAC: 418,049
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 (16,307,262)PSP LLR Turquoise: Earned 5,000,000 credits (5,027,818)SoB LLR Sapphire: Earned 20,000,000 credits (20,435,007)SR5 LLR Turquoise: Earned 5,000,000 credits (6,110,877)SGS LLR Ruby: Earned 2,000,000 credits (3,050,669)TRP LLR Turquoise: Earned 5,000,000 credits (7,025,303)Woodall LLR Amethyst: Earned 1,000,000 credits (1,693,614)321 Sieve Sapphire: Earned 20,000,000 credits (27,911,083)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 (268,649,095)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: 44,904,168
RAC: 32,215
321 LLR Gold: Earned 500,000 credits (675,737)Cullen LLR Ruby: Earned 2,000,000 credits (2,382,418)ESP LLR Amethyst: Earned 1,000,000 credits (1,029,917)Generalized Cullen/Woodall LLR Ruby: Earned 2,000,000 credits (3,599,544)PPS LLR Silver: Earned 100,000 credits (153,419)PSP LLR Ruby: Earned 2,000,000 credits (3,635,406)SoB LLR Jade: Earned 10,000,000 credits (11,155,110)SR5 LLR Gold: Earned 500,000 credits (566,353)SGS LLR Bronze: Earned 10,000 credits (31,452)TRP LLR Gold: Earned 500,000 credits (814,221)Woodall LLR Ruby: Earned 2,000,000 credits (4,679,744)321 Sieve Bronze: Earned 10,000 credits (99,411)Generalized Cullen/Woodall Sieve (suspended) Gold: Earned 500,000 credits (736,293)PPS Sieve Turquoise: Earned 5,000,000 credits (6,283,544)TRP Sieve (suspended) Silver: Earned 100,000 credits (475,162)AP 26/27 Ruby: Earned 2,000,000 credits (3,295,045)GFN Turquoise: Earned 5,000,000 credits (5,014,730)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.98, 2.22, 2.32
Generated 5 Apr 2020 | 4:41:33 UTC