From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Dyballa Newsgroups: gmane.emacs.help Subject: Re: Getting Number of CPU(-core)s and giving it as the --jobs argument to GNU Make Date: Tue, 11 Sep 2007 23:52:58 +0200 Message-ID: <0E646A4F-3738-4141-9E2F-4CD80927FB00@Web.DE> References: <1189522398.029390.27390@50g2000hsm.googlegroups.com> <7C10B24D-B158-4C58-97DE-82441E1358AE@Web.DE> <877imxc5sp.fsf@debby.local.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1189547603 13395 80.91.229.12 (11 Sep 2007 21:53:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2007 21:53:23 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, =?ISO-8859-1?Q?Nordl=F6w?= To: Dieter Wilhelm Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 11 23:53:20 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IVDfa-0007p9-Ep for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Sep 2007 23:53:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVDfa-0006bE-Il for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Sep 2007 17:53:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IVDfL-0006am-SL for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 17:53:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IVDfJ-0006aR-QO for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 17:53:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVDfJ-0006aO-Mn for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 17:53:01 -0400 Original-Received: from fmmailgate01.web.de ([217.72.192.221]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IVDfJ-0001DF-6U for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 17:53:01 -0400 Original-Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate01.web.de (Postfix) with ESMTP id 4FE839D664C6; Tue, 11 Sep 2007 23:53:00 +0200 (CEST) Original-Received: from [195.4.207.175] (helo=[192.168.1.2]) by smtp08.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.108 #197) id 1IVDfI-0002pt-00; Tue, 11 Sep 2007 23:53:00 +0200 In-Reply-To: <877imxc5sp.fsf@debby.local.net> X-Mailer: Apple Mail (2.752.2) X-Sender: Peter_Dyballa@web.de X-Provags-ID: V01U2FsdGVkX18x+jJmcdnS2NOH+PVZDUB0DVbYM+Twdk7d3HX2 Vc5VeRY77sm2QahXErRnbmJEKAZwzAbLWKQe0gA4dw6YmHAwu6 pqXvaxyh8BxU499WSkvA== X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:47511 Archived-At: Am 11.09.2007 um 22:20 schrieb Dieter Wilhelm: > That's a bit confusing, I thought I had *one* processor with *two* > cores and the content in /proc/cpuinfo claims two processor, 0 and 1 > with two cores, respectively, where am I wrong? HT =96 hyper-threading (parallel pipelines and parallel memory buses). =20= Many modern intel CPUs claim they are two (Xeons are four, or even =20 eight, I think). They are right, somehow: mostly you can assume that =20 in your case four commands are (can be) executed at the same time. =20 For your PC 'make -j 4' will improve compilation time. So doing in bash cores=3D`grep cores /proc/cpuinfo | wc -l` if [ $cores -eq 0 ]; then cores=3D1; fi procs=3D`grep processor /proc/cpuinfo | wc -l` thrds=3D`expr $cores \* $procs` or in (t)csh set cores=3D`grep cores /proc/cpuinfo | wc -l` if ($cores =3D=3D 0) set cores=3D1 set procs=3D`grep processor /proc/cpuinfo | wc -l` set thrds=3D`expr $cores \* $procs` would determine how many compilation threads can be executed in =20 $thrds. And it should also work when the CPU has no core ... Solaris, =20= AIX, HP-UX, IRIX ... have their own commands. Anyway, a modern GNU make is able to determine by itself what's best. =20= This is done via 'make -j' without a limiting number. -- Mit friedvollen Gr=FC=DFen Pete Der Bezug einer Zeitung oder der Kauf eines Buches gibt niemand das =20 Recht, an die Verfasserinnen von Artikeln oder B=FCchern dreiste Briefe =20= zu schreiben. (Friedrich Sieburg)