public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nate DeSimone" <nathaniel.l.desimone@intel.com>
To: "Chiu, Chasel" <chasel.chiu@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Kubacki, Michael A" <michael.a.kubacki@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>
Subject: Re: [PATCH] Platform/Intel: Dynamic NUMBER_OF_PROCESSORS in build.
Date: Thu, 13 Jun 2019 08:19:49 +0000	[thread overview]
Message-ID: <28613EDD-BA3A-4E4A-A577-58CD38CBA617@intel.com> (raw)
In-Reply-To: <20190613061439.10144-1-chasel.chiu@intel.com>

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

On 6/12/19, 11:17 PM, "Chiu, Chasel" <chasel.chiu@intel.com> wrote:

    REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1913
    
    To improve build performance by default the maximum
    processors should be used for building.
    To support this, NUMBER_OF_PROCESSORS in build.cfg has
    new definition:
      0 = AUTO. Maximum of processors will be used.
      non-zero = limit or force the number of processors.
    
    Test: tried several NUMBER_OF_PROCESSORS settings and
          the build parameter can be updated accordingly
          also builds successfully.
    
    Cc: Michael Kubacki <michael.a.kubacki@intel.com>
    Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
    Cc: Liming Gao <liming.gao@intel.com>
    Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
    ---
     Platform/Intel/build.cfg     | 2 +-
     Platform/Intel/build_bios.py | 8 +++++++-
     2 files changed, 8 insertions(+), 2 deletions(-)
    
    diff --git a/Platform/Intel/build.cfg b/Platform/Intel/build.cfg
    index 6c23e5eabc..fc6e4fe824 100644
    --- a/Platform/Intel/build.cfg
    +++ b/Platform/Intel/build.cfg
    @@ -46,7 +46,7 @@ FSP_TEST_RELEASE = FALSE
     SECURE_BOOT_ENABLE = FALSE
     REBUILD_MODE =
     BUILD_ROM_ONLY =
    -NUMBER_OF_PROCESSORS = 1
    +NUMBER_OF_PROCESSORS = 0
     
     
     [PLATFORMS]
    diff --git a/Platform/Intel/build_bios.py b/Platform/Intel/build_bios.py
    index 09eceddeff..864511ac4d 100644
    --- a/Platform/Intel/build_bios.py
    +++ b/Platform/Intel/build_bios.py
    @@ -21,6 +21,7 @@ import shutil
     import argparse
     import traceback
     import subprocess
    +import multiprocessing
     from importlib import import_module
     
     try:
    @@ -345,7 +346,12 @@ def build(config):
         print(" BUILD_ROM_ONLY = ", config.get("BUILD_ROM_ONLY"))
         print("==========================================")
     
    -    command = ["build", "-n", config["NUMBER_OF_PROCESSORS"]]
    +    NumberOfProcessors = config["NUMBER_OF_PROCESSORS"]
    +    if config["NUMBER_OF_PROCESSORS"] == "0":
    +        # 0 means AUTO, maximum number of processors will be set
    +        NumberOfProcessors = str(multiprocessing.cpu_count())
    +    print ("Number of processors set to " + NumberOfProcessors)
    +    command = ["build", "-n", NumberOfProcessors]
     
         if config["REBUILD_MODE"] and config["REBUILD_MODE"] != "":
             command.append(config["REBUILD_MODE"])
    -- 
    2.13.3.windows.1
    
    


  parent reply	other threads:[~2019-06-13  8:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13  6:14 [PATCH] Platform/Intel: Dynamic NUMBER_OF_PROCESSORS in build Chiu, Chasel
2019-06-13  7:39 ` [edk2-devel] " Bob Feng
2019-06-13  8:23   ` Chiu, Chasel
2019-06-13  8:19 ` Nate DeSimone [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-06-13  8:25 Chiu, Chasel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=28613EDD-BA3A-4E4A-A577-58CD38CBA617@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox