CPU affinity and pinning threads
Posted: Thu Jun 01, 2023 5:59 pm
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:
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.
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
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.