diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-11-04 16:42:12 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-11-04 16:42:12 +0000 |
commit | 13c27c35937d0a565855d25d2923b556b2e66e5b (patch) | |
tree | e9ba079af0a02509f2ca8bd6bea4dcb3bca8e450 /bashrc | |
parent | Add alias for reporting on binary sizes (diff) | |
download | util-13c27c35937d0a565855d25d2923b556b2e66e5b.tar.bz2 util-13c27c35937d0a565855d25d2923b556b2e66e5b.tar.xz util-13c27c35937d0a565855d25d2923b556b2e66e5b.zip |
Take threads and cores into account when calculating the number parallel tasks to run
Diffstat (limited to 'bashrc')
-rw-r--r-- | bashrc | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -61,6 +61,8 @@ sizes() { PATH="/usr/lib/ccache/bin:$PATH" CORES=$(grep core\ id /proc/cpuinfo | sort -u | wc -l) +CPUS=$(grep core\ id /proc/cpuinfo -c) +TASKS=$((($CORES + $CPUS) / 2)) export FEATURES="ccache" alias :e="gvim" alias d="cd ~/dev" @@ -83,7 +85,7 @@ vg() { } build() { title "Build in progress" - CCACHE_BASEDIR=$(git root) nice -n5 b2 -j$CORES $@ + CCACHE_BASEDIR=$(git root) nice -n5 b2 -j$TASKS $@ rtn=$? if [ $rtn -eq 0 ]; then title "Build success ${PWD/#$HOME/\~}" |