From: Jan Vorlicek Date: Thu, 29 Nov 2018 18:06:34 +0000 (+0100) Subject: Fix build parallelism on Windows with NUMA (#21278) X-Git-Tag: accepted/tizen/unified/20190422.045933~507 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0cc4b0c3e6207fcae9ffde81096f86c40d2634b4;p=platform%2Fupstream%2Fcoreclr.git 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. --- diff --git a/build.cmd b/build.cmd index 781ed9f..41ff53d 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%