summaryrefslogtreecommitdiff
path: root/build.cmd
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2018-11-29 19:06:34 +0100
committerGitHub <noreply@github.com>2018-11-29 19:06:34 +0100
commit0cc4b0c3e6207fcae9ffde81096f86c40d2634b4 (patch)
treeb38590abfdefd04c0f3a3a5c4264489ee7895273 /build.cmd
parent2c13fb067b511bfdd3d054b63314292fcb0eebc7 (diff)
downloadcoreclr-0cc4b0c3e6207fcae9ffde81096f86c40d2634b4.tar.gz
coreclr-0cc4b0c3e6207fcae9ffde81096f86c40d2634b4.tar.bz2
coreclr-0cc4b0c3e6207fcae9ffde81096f86c40d2634b4.zip
Fix build parallelism on Windows with NUMA (#21278)
When multiple NUMA nodes are enabled on the machine where coreclr is built, we incorrectly detect the number of cores that we use for build parallelism of the native part of the build (NumberOfCores) as only a number in the last NUMA node. The reason is that the `wmic cpu get NumberOfCores /value` returns multiple lines, one per each NUMA node. This change fixes it by summing values from all the lines.
Diffstat (limited to 'build.cmd')
-rw-r--r--build.cmd4
1 files changed, 3 insertions, 1 deletions
diff --git a/build.cmd b/build.cmd
index 781ed9fbcf..41ff53d8e5 100644
--- a/build.cmd
+++ b/build.cmd
@@ -332,9 +332,11 @@ REM NumberOfCores is an WMI property providing number of physical cores on machi
REM processor(s). It is used to set optimal level of CL parallelism during native build step
if not defined NumberOfCores (
REM Determine number of physical processor cores available on machine
+ set TotalNumberOfCores=0
for /f "tokens=*" %%I in (
'wmic cpu get NumberOfCores /value ^| find "=" 2^>NUL'
- ) do set %%I
+ ) do set %%I & set /a TotalNumberOfCores=TotalNumberOfCores+NumberOfCores
+ set NumberOfCores=!TotalNumberOfCores!
)
echo %__MsgPrefix%Number of processor cores %NumberOfCores%