Page 1 of 1

CPU affinity and pinning threads

Posted: Thu Jun 01, 2023 5:59 pm
by bikeaddict
For the last few days, I've been testing whether pinning CPU task FahCore threads to a specific virtual processor affects performance. Below is the Bash script code run by cron on Linux I threw together to pin the threads:

Code: Select all

i=1
for p in $(ps -eLf | grep FahCore_a | grep -vE "Wrapper|grep|00:00:0" | awk '{print $4}' | sort); do
   #echo $p "-" $i
   taskset -p -c $i $p > /dev/null 2>&1
   i=$((i+1))
done
This is on a machine that leaves the GPU task on core/thread 0 and uses the rest for the CPU task. The messy grep is used to exclude the parent processes that spawn the threads.

Before this change, FAHControl was showing 900K PPD for most WUs. And after pinning, PPD estimates are mostly in the 1.1-1.3M range with rarely any lower. The number of WUs with PPD up to 1.5-1.6M seems higher now. It's possible that the WUs that have been sent in recent days just happen to have higher PPD. I figured I'd check if anyone else has seen the same improvement and provide the script in case anyone else want to do their own testing and report back.

Re: CPU affinity and pinning threads

Posted: Thu Jun 01, 2023 11:51 pm
by jchang6
I would check the WU's. My understanding of the FahCore_22 process (for nVidia GPUs) is that it is polling. Hence, a single core is pegged, bouncing between cores. If you reduce the CPU power/frequency, it doesn't really affect the PPD.

Re: CPU affinity and pinning threads

Posted: Fri Jun 02, 2023 12:16 am
by bikeaddict
This is regarding the CPU WU cores FahCore_a8 and FahCore_a9.