From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dan.rpsys.net (dan.rpsys.net [93.97.175.187]) by mail.openembedded.org (Postfix) with ESMTP id 0F7906E7E2 for ; Mon, 27 Jan 2014 14:38:24 +0000 (UTC) Received: from localhost (dan.rpsys.net [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-2.1ubuntu4) with ESMTP id s0REcK4e001904 for ; Mon, 27 Jan 2014 14:38:20 GMT X-Virus-Scanned: Debian amavisd-new at dan.rpsys.net Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ae6tdft_ymsl for ; Mon, 27 Jan 2014 14:38:20 +0000 (GMT) Received: from [192.168.3.10] (rpvlan0 [192.168.3.10]) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id s0REcE6w001887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 27 Jan 2014 14:38:15 GMT Message-ID: <1390833488.17424.252.camel@ted> From: Richard Purdie To: openembedded-core Date: Mon, 27 Jan 2014 14:38:08 +0000 X-Mailer: Evolution 3.8.4-0ubuntu1 Mime-Version: 1.0 Subject: [PATCH] utils: Add a cpu_count wrapper function X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2014 14:38:25 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Add a cpu_count wrapper function (useful from annonymous python where the import would be trickier). Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 82987e8..36f82db 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -150,3 +150,7 @@ def trim_version(version, num_parts=2): parts = version.split(".") trimmed = ".".join(parts[:num_parts]) return trimmed + +def cpu_count(): + import multiprocessing + return multiprocessing.cpu_count()