use one process more than we have cores (#8545)
authorGereon Kremer <gkremer@cs.stanford.edu>
Sat, 2 Apr 2022 20:03:56 +0000 (22:03 +0200)
committerGitHub <noreply@github.com>
Sat, 2 Apr 2022 20:03:56 +0000 (20:03 +0000)
This PR uses one process more than we have cores in the CI. This speeds up the CI jobs when time is spent waiting on IO instead of actually using the CPU.

.github/actions/install-dependencies/action.yml

index 1dc3a1ad322e672499c71f34a996191117e1b7ad..85bf208da2e722f0ae5e91c684b08ecbccbcb539 100644 (file)
@@ -38,7 +38,7 @@ runs:
         echo "SED=sed" >> $GITHUB_ENV
         echo "CCACHE_CONFIGPATH=/home/runner/.ccache/ccache.conf" >> $GITHUB_ENV
         echo "image_version=$ImageVersion" >> $GITHUB_ENV
-        echo "num_proc=$(nproc)" >> $GITHUB_ENV
+        echo "num_proc=$(( $(nproc) + 1 ))" >> $GITHUB_ENV
         echo "/usr/lib/ccache" >> $GITHUB_PATH
         echo "::endgroup::"
 
@@ -81,7 +81,7 @@ runs:
         echo "SED=gsed" >> $GITHUB_ENV
         echo "CCACHE_CONFIGPATH=/Users/runner/Library/Preferences/ccache/ccache.conf" >> $GITHUB_ENV
         echo "image_version=$ImageVersion" >> $GITHUB_ENV
-        echo "num_proc=$(sysctl -n hw.logicalcpu)" >> $GITHUB_ENV
+        echo "num_proc=$(( $(sysctl -n hw.logicalcpu) + 1 ))" >> $GITHUB_ENV
         echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
         echo "::endgroup::"