From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: e63b27eb52,f19613495899e6db X-Google-Attributes: gide63b27eb52,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!h14g2000pri.googlegroups.com!not-for-mail From: Henry Newsgroups: comp.sys.hp.hpux,comp.unix.aix,comp.unix.tru64 Subject: Re: Determine number of CPUs Date: Thu, 15 Oct 2009 12:49:04 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4ad5a2ed@212.67.96.135> <0d6fd7de-fb03-44ef-9fea-d60a38c594f8@j39g2000yqh.googlegroups.com> <4ad76334@212.67.96.135> NNTP-Posting-Host: 210.55.201.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1255636144 22361 127.0.0.1 (15 Oct 2009 19:49:04 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 15 Oct 2009 19:49:04 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h14g2000pri.googlegroups.com; posting-host=210.55.201.197; posting-account=KapJlAkAAACLIiU1FIdMZiBpRvJJQlRr User-Agent: G2/1.0 X-HTTP-Via: 1.1 V-MOHWEBP2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.sys.hp.hpux:1323 comp.unix.aix:3679 comp.unix.tru64:118 On Oct 16, 7:00=A0am, Dave wrote: > sjm wrote: > > On 14 Oct, 11:07, Dave 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' =A0take 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. lparstat ?