From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dieter Wilhelm Newsgroups: gmane.emacs.help Subject: Re: Getting Number of CPU(-core)s and giving it as the --jobs argument to GNU Make Date: Wed, 12 Sep 2007 00:11:03 +0200 Organization: The Church of Emacs Message-ID: <87odg84zuw.fsf@debby.local.net> References: <1189522398.029390.27390@50g2000hsm.googlegroups.com> <7C10B24D-B158-4C58-97DE-82441E1358AE@Web.DE> <877imxc5sp.fsf@debby.local.net> <0E646A4F-3738-4141-9E2F-4CD80927FB00@Web.DE> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1189548573 16742 80.91.229.12 (11 Sep 2007 22:09:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2007 22:09:33 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, =?utf-8?Q?Nordl=C3=B6w?= To: Peter Dyballa Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 12 00:09:30 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 1IVDvA-0003Hn-54 for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Sep 2007 00:09:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVDv9-0007cQ-SG for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Sep 2007 18:09:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IVDut-0007b5-T5 for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 18:09:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IVDus-0007ZP-AQ for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 18:09:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVDus-0007ZM-7m for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 18:09:06 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.174]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IVDur-00050k-PA for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 18:09:06 -0400 Original-Received: from drms-590c71ac.pool.einsundeins.de [89.12.113.172] (helo=debby.local.net) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis), id 0ML31I-1IVDuq0yc3-0001kz; Wed, 12 Sep 2007 00:09:04 +0200 Original-Received: from dieter by debby.local.net with local (Exim 4.63) (envelope-from ) id 1IVDwl-00066O-Vo; Wed, 12 Sep 2007 00:11:03 +0200 In-Reply-To: <0E646A4F-3738-4141-9E2F-4CD80927FB00@Web.DE> (Peter Dyballa's message of "Tue\, 11 Sep 2007 23\:52\:58 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Provags-ID: V01U2FsdGVkX18aYS39u8etkE744J5scy2u2YLOEPInGFiQyls jBCTPu4Kb4c4FIx6jRP2WPEj7bTC2RRLYjfjDAlDt3e36X8SLs ODDGgIE05sTbvTszUkGQ3m8tOaOmMNL X-Detected-Kernel: Linux 2.6? (barebone, rare!) 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:47512 Archived-At: Peter Dyballa writes: > 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 =E2=80=93 hyper-threading (parallel pipelines and parallel memory buse= s). > Many modern intel CPUs claim they are two (Xeons are four, or even > eight, I think). They are right, somehow: mostly you can assume that > in your case four commands are (can be) executed at the same time. I see, thanks for the explanation.=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` Wait! I'm not the guy which asked for this make related problem. I'm just a miscellaneous ignorant who sneaked into this threat, I'm sorry for that. > > 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 > $thrds. And it should also work when the CPU has no core ... Solaris, > AIX, HP-UX, IRIX ... have their own commands. > > > Anyway, a modern GNU make is able to determine by itself what's best. > This is done via 'make -j' without a limiting number. --=20 Best wishes H. Dieter Wilhelm Darmstadt, Germany