Created
January 3, 2017 06:07
-
-
Save rsaxvc/f34e33f9217d7e81b248b529bc6d8452 to your computer and use it in GitHub Desktop.
Cron Script to assign distinct CPU cores to Boinc jobs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#This script assumes #BOINC <= #Cores. To fix this, use a modulo function. | |
CORE=0 | |
pgrep -f "/usr/lib/virtualbox/VBoxHeadless --comment boinc_" | while read -r pid ; do | |
taskset -a -pc "$CORE" "$pid" #This locks the VM to a specific core. | |
CORE=$((CORE+1)) #Use this without hyperthreading | |
#CORE=$((CORE+2)) #Use this with hyperthreading | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment