From: Dave <foo@coo.com>
Subject: Re: Determine number of CPUs
Date: Thu, 15 Oct 2009 19:00:08 +0100 [thread overview]
Message-ID: <4ad76334@212.67.96.135> (raw)
In-Reply-To: <0d6fd7de-fb03-44ef-9fea-d60a38c594f8@j39g2000yqh.googlegroups.com>
sjm wrote:
> On 14 Oct, 11:07, Dave <f...@coo.com> wrote:
>
>> 3) It gives the number of physical CPUs, rather than cores.
>
> Well it all depends what *you* define as a "physical CPU" and what you
> are trying to achieve by that definition. In particular, IBM and Intel
> offer conflicting definitions of what is a CHIP, a CPU, a PROCESSOR
> and a CORE. Intel mainly make chips (as well as other stuff), so they
> refer to these CHIPS as PROCESSORS, even if they have multiple CORES.
> IBM mainly make systems (as well as other stuff) so they refer to
> CORES as PROCESSORS, even if there is more than one PROCESSOR per
> CHIP. And then you have to add that contemporary IBM chips like POWER5
> can have more than one THREAD per CORE, and more than one CORE per
> CHIP, and more than one CHIP per SOCKET.
>
> So what was it that you wanted to know?
Let me give you the background, as clearly I need to to avoid confusion.
1) I'm well aware there is some ambiguity in these terms. I use a Sun
T5240 which has two CPUs, 16 cores and 128 hardware threads. Depending
on how you test for 'cpus' you can get 2 or 128. (I'm not sure if there
is a way of finding the cores, so getting 16)
2) Sage
http://www.sagemath.org/
is a large maths program, which makes heavy use of programs written by
lots of people in lots of languages (C, C++, Fortran, Perl, Python) and
perhaps a few others. The basic concept of Sage is to not write a maths
package from scratch, but to make use of all the existing maths software
(some of which took many man-years to develop), and tie them all
together with a common interface (a web browser). Users write their
programs in a single language (pyton) by typing into their browser.
It uses things like ATLAS for linear algebra, maxima for calculus etc.
3) Several of the 100 or so packages in Sage make use of autoconf.
4) One package in Sage (libm4ri) makes use of this autoconf macro
http://www.nongnu.org/autoconf-archive/ax_count_cpus.html
which is supposed to count the number of CPUs. As you can see if you
read it, the macro's documentation is not exactly clear about what are
CPUs. I suspect it was written before the days of multi-core processors.
Even ignoring the fact of the ambiguity, I'm told by users of the
autoconf mailing list that the macro is badly written.
5) It would be nice to modify that macro so it counts the number of
processors fitted in a box (I'm aware too that some sockets on
motherboards can take a single or dual CPU). Then, for the good of the
community, there would a be a macro which did just this.
6) Having discussed with the author of the lib4mri, the number of cores
would be most useful to his package. Hence really we need a new macro
which determines the number of cores.
Perhaps I should just forget about that macro, and find a way of
counting the cores.
Either way, what options are available to me? The only HP-UX box I have
access to is an old single processor box, so I can't really do much
testing on that. For Solaris I have access to numerous machines, with
processors varying from 1 to 4, and cores varying from 1 to 16.
For AIX I have easy access to only one machine. I'm not sure of the spec
of that.
I know on Solaris, an admin can limit the number of CPUs in different
zones, take processors off-line.
Clearly this gets quite complex. Probably the best solution is the user
specifies how many CPUs he has in some environment variable, but an
automatic method, even if not 100% right, would be useful.
Ultimately, nobody is going to die because of a failure of this.
I believe this is one of those things that is really impossible to do
right, but if someone can tell me some commands that might be useful,
I'd be interested.
Dave
--
I respectfully request that this message is not archived by companies as
unscrupulous as 'Experts Exchange' . In case you are unaware,
'Experts Exchange' take questions posted on the web and try to find
idiots stupid enough to pay for the answers, which were posted freely
by others. They are leeches.
next prev parent reply other threads:[~2009-10-15 18:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 10:07 Determine number of CPUs Dave
2009-10-14 13:44 ` Leo
2009-10-15 22:51 ` Dave
2009-10-16 6:14 ` Michael Kraemer
2009-10-14 15:57 ` Don Morris
2009-10-14 18:52 ` Rick Jones
2009-10-15 13:59 ` sjm
2009-10-15 18:00 ` Dave [this message]
2009-10-15 19:49 ` Henry
2009-10-19 22:18 ` John F. Carr
2009-10-20 12:16 ` Dave
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox